/* Carrot platform look (ClientApp/src/scss/vars.scss): Inter, primary #305FFF, 8px corners. */
:root {
  --primary: #305FFF;
  --primary-hover: #4565E4;
  --secondary: #D7E0FF;
  --text: #1F2022;
  --text-standard: #3D3F46;
  --text-tertiary: #5E616D;
  --muted: #848998;
  --border: #D0D3DB;
  --border-light: #E3E4E9;
  --bg: #F2F3F5;
  --bg-info: #EAEFFF;
  --red: #F34A4A;
  --red-bg: #FEF6F6;
  --green: #19AE3A;
  --green-bg: #F5FBF6;
  --yellow: #FFB446;
  --yellow-bg: #FFF9EC;
  font-family: "Inter", Helvetica, Arial, sans-serif;
  color: var(--text-standard);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 15px; line-height: 1.45; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; }
code { font-family: "SFMono-Regular", Menlo, Consolas, monospace; font-size: 13px; }
h1 { font-size: 32px; font-weight: 700; color: var(--text); margin: 0 0 6px; letter-spacing: -0.01em; }
h2 { font-size: 20px; font-weight: 600; color: var(--text); margin: 0 0 16px; }
.muted { color: var(--muted); font-size: 14px; }
[hidden] { display: none !important; }

/* Header: logo on the left, user on the right, like the platform top bar. */
header.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 40px; background: var(--bg);
}
header.top .brand { display: flex; align-items: center; gap: 16px; color: var(--text); text-decoration: none; }
header.top .brand img { height: 18px; }
header.top .brand span { font-size: 20px; font-weight: 600; }
header.top .user { display: flex; align-items: center; gap: 16px; color: var(--text-tertiary); font-size: 14px; }

/* White sheet with rounded top corners, like the platform pages. */
main.sheet {
  background: #fff; border-radius: 24px 24px 0 0; min-height: calc(100vh - 80px);
  padding: 40px 0 60px;
}
.container { max-width: 1120px; margin: 0 auto; padding: 0 40px; }

section.card { border: 1px solid var(--border-light); border-radius: 8px; padding: 24px; margin: 24px 0; background: #fff; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 8px; }
.section-head h2 { margin: 0; }

.alert { background: var(--red-bg); border: 1px solid #FFC9C9; color: var(--red); padding: 12px 16px; border-radius: 8px; margin: 0 0 20px; white-space: pre-wrap; }
.notice { background: var(--yellow-bg); border: 1px solid #FFE2A8; padding: 12px 16px; border-radius: 8px; margin: 16px 0; }

/* Buttons (theme-2.0/button.scss). */
button, .button {
  font-family: inherit; font-size: 15px; font-weight: 600; line-height: 1;
  height: 44px; padding: 0 22px; border-radius: 8px; cursor: pointer; justify-self: start;
  background: var(--primary); color: #fff; border: 1px solid var(--primary);
  box-shadow: 0 5px 10px 0 rgba(99, 99, 99, 0.2), 0 10px 40px 0 rgba(74, 116, 255, 0.3);
  transition: background-color .2s ease;
}
button:hover { background: var(--primary-hover); }
button.secondary { background: #fff; color: var(--primary); border-color: var(--secondary); box-shadow: none; }
button.secondary:hover { background: var(--bg-info); }
button.link { background: none; border: 0; box-shadow: none; color: var(--primary); height: auto; padding: 0; font-weight: 500; }
button.link:hover { text-decoration: underline; background: none; }
button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
button.block { width: 100%; }

/* Forms (theme-2.0/input.scss). */
.run-form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field > label, legend { font-size: 14px; font-weight: 500; color: var(--text); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
input[type=number], input[type=text], input[type=email], input[type=password], select {
  font-family: inherit; font-size: 15px; color: var(--text);
  height: 44px; padding: 0 14px; border: 1px solid var(--border); border-radius: 8px; background: #fff; max-width: 460px; width: 100%;
}
input:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--bg-info); }
fieldset { border: 1px solid var(--border-light); border-radius: 8px; padding: 14px 18px; margin: 0; display: flex; flex-wrap: wrap; gap: 10px 28px; }
fieldset legend { padding: 0 6px; color: var(--muted); font-weight: 500; }
fieldset.danger { border-color: #FFC9C9; flex-direction: column; }
fieldset label, .check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
input[type=radio], input[type=checkbox] { accent-color: var(--primary); width: 18px; height: 18px; margin: 0; }

/* Tables (platform lists). */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; color: var(--muted); padding: 12px; border-bottom: 1px solid var(--border-light); }
td { padding: 12px; border-bottom: 1px solid var(--border-light); vertical-align: top; color: var(--text-standard); }
tr:hover td { background: #FAFAFB; }

.status { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 13px; font-weight: 500; background: var(--bg); color: var(--text-tertiary); }
.status.running { background: var(--yellow-bg); color: #B7791F; }
.status.succeeded { background: var(--green-bg); color: var(--green); }
.status.failed { background: var(--red-bg); color: var(--red); }

.cards { list-style: none; padding: 0; margin: 16px 0 32px; display: grid; gap: 12px; }
.cards li { border: 1px solid var(--border-light); border-radius: 8px; padding: 18px 20px; display: flex; gap: 20px; align-items: center; }
.cards li a.name { font-size: 18px; font-weight: 600; }

.log { background: #1F2022; color: #E3E4E9; padding: 20px; border-radius: 8px; font-size: 13px; line-height: 1.5; min-height: 320px; white-space: pre-wrap; word-break: break-word; }

/* Sign-in: Okta sign-in widget layout (card, logo, divider, full-width button). */
body.auth { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; }
.auth-card {
  width: 400px; max-width: calc(100vw - 32px); background: #fff; border: 1px solid #ddd; border-radius: 4px;
  box-shadow: 0 2px 0 rgba(175, 175, 175, 0.12);
}
.auth-card .auth-header { padding: 30px 90px 24px; border-bottom: 1px solid #ddd; text-align: center; }
.auth-card .auth-header img { max-width: 200px; height: 26px; object-fit: contain; }
.auth-card .auth-body { padding: 30px 42px 32px; }
.auth-card h2 { text-align: center; font-size: 15px; font-weight: 600; margin: 0 0 22px; color: #5e5e5e; }
.auth-card .field { margin-bottom: 18px; }
.auth-card .field > label { font-size: 14px; font-weight: 600; color: #6e6e78; }
.auth-card input { max-width: none; border-radius: 3px; border-color: #8c8c96; height: 40px; }
.auth-card button.block { border-radius: 3px; height: 50px; margin-top: 8px; box-shadow: none; font-size: 14px; }
.auth-card .alert { margin-bottom: 18px; font-size: 14px; }
.auth-card .auth-footer { padding: 0 42px 26px; font-size: 13px; color: var(--muted); text-align: center; }
.auth-note { margin-top: 18px; font-size: 13px; color: var(--muted); }

@media (max-width: 720px) {
  header.top { padding: 16px 20px; }
  .container { padding: 0 20px; }
  .row { grid-template-columns: 1fr; }
}

/* Environment page: stage list on the left, run panel on the right. */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 8px; }
.crumbs { margin: 0 0 6px; font-size: 14px; color: var(--muted); }
.small { font-size: 13px; }
.layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 24px; align-items: start; }
.layout section.card { margin: 24px 0 0; }
.run-card { position: sticky; top: 24px; }

.steps { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.step { display: flex; gap: 14px; padding: 12px 14px; border: 1px solid var(--border-light); border-radius: 8px; cursor: pointer; transition: border-color .15s, background-color .15s; }
.step:hover, .step:focus { border-color: var(--border); background: #FAFAFB; outline: none; }
.step.target { border-color: var(--primary); background: var(--bg-info); }
.step-number { flex: 0 0 28px; height: 28px; border-radius: 50%; background: var(--bg); color: var(--text-tertiary); font-weight: 600; font-size: 13px; display: grid; place-items: center; }
.step.target .step-number { background: var(--primary); color: #fff; }
.step-title { font-weight: 600; color: var(--text); }
.step-type { font-size: 13px; color: var(--text-tertiary); }
.step-note { font-size: 12px; color: var(--muted); margin-top: 2px; }
.badge { display: inline-block; font-size: 11px; font-weight: 600; color: var(--text-tertiary); background: var(--bg); border-radius: 4px; padding: 1px 6px; margin-left: 4px; vertical-align: 1px; }

.label { font-size: 14px; font-weight: 600; color: var(--text); }
.hint { font-size: 12px; color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { position: relative; display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; transition: border-color .15s, background-color .15s; }
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile strong { font-size: 14px; color: var(--text); }
.tile span { font-size: 12px; color: var(--muted); }
.tile:hover { border-color: var(--primary); }
.tile:has(input:checked) { border-color: var(--primary); background: var(--bg-info); box-shadow: 0 0 0 1px var(--primary) inset; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; padding: 3px; gap: 3px; width: fit-content; }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 7px 16px; border-radius: 6px; font-size: 14px; font-weight: 500; color: var(--text-tertiary); }
.segmented label:has(input:checked) span { background: var(--primary); color: #fff; }
.danger-zone { border: 1px solid #FFC9C9; background: var(--red-bg); border-radius: 8px; padding: 14px 16px; display: grid; gap: 12px; }
.danger-zone .check { align-items: flex-start; }
.actions { display: flex; justify-content: space-between; align-items: center; padding-top: 6px; border-top: 1px solid var(--border-light); margin-top: 4px; padding-top: 16px; }
.run-form select, .run-form input[type=number], .run-form input[type=text] { max-width: none; }

@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .run-card { position: static; }
  .tiles { grid-template-columns: 1fr; }
}

/* Dashboard card. */
.dashboard-layout { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); margin-top: 8px; }
.restore-form { border-left: 1px solid var(--border-light); padding-left: 24px; align-content: start; }
input[type=file] { font-family: inherit; font-size: 14px; padding: 10px; border: 1px dashed var(--border); border-radius: 8px; background: #FAFAFB; max-width: none; }
@media (max-width: 960px) { .restore-form { border-left: 0; padding-left: 0; border-top: 1px solid var(--border-light); padding-top: 16px; } }
