/* Participant portal. Visual design ported from the approved mockup.
   Fonts: Space Grotesk (headings), Inter (body), JetBrains Mono (code/terminal/wordmark).
   Light inner pages (#FAFAF7), dark landing/debrief (#0C0E13), green accent #12C98E. */
@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap");

:root {
  --bg: #FAFAF7; --fg: #15181F; --muted: #6B7180; --faint: #9AA0AC;
  --card: #fff; --line: #E7E6DF; --field-line: #D8D7CE;
  --accent: #12C98E; --accent-ink: #06281E; --accent-deep: #0B7A54;
  --ok: #0B7A54; --warn: #B3261E; --info: #345; --warn-bg: #FFF6E6; --warn-line: #F3D79B; --warn-ink: #6B5422;
  --rail-sep: #D2D4CF; --pill-line: #D8D7CE;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg);
  font: 19px/1.6 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; }
.mono, code, .terminal-status, .timer { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---- header / step rail ---- */
header { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center;
  padding: 18px 48px; border-bottom: 1px solid var(--line); background: #fff; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto;
  font-family: "JetBrains Mono", monospace; font-size: 17px; letter-spacing: .06em; color: var(--muted); }
.brand::before { content: ">_"; display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 7px; background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 17px; }
.steps { display: flex; align-items: center; gap: 10px; list-style: none; margin: 0; padding: 0;
  font-size: 16.5px; flex-wrap: wrap; }
.steps li { color: #B6BAC4; }
.steps li + li::before { content: "\203A"; color: var(--rail-sep); margin-right: 10px; }
.steps li.done { color: var(--faint); }
.steps li.done::after { content: " \2713"; }        /* no-op; done marked by the leading check below */
.steps li.done > span, .steps li.done { }
.steps li.on { color: var(--accent-deep); font-weight: 600; }
.steps li.on::marker { content: ""; }

/* ---- layout: full-width with page gutters, not a centered narrow column ---- */
main { padding: 30px 48px 40px; width: 100%; }
main.narrow, main.mid, main.wide { max-width: none; margin: 0; }
footer { padding: 14px 48px; border-top: 1px solid var(--line); background: #fff;
  color: var(--faint); font-size: 15.5px; text-align: center; }
footer a { color: var(--muted); }

h1 { font-family: "Space Grotesk", sans-serif; font-weight: 600; font-size: 34px; margin: 0 0 20px; letter-spacing: -.01em; }
h2 { font-size: 17.5px; margin: 0 0 9px; color: var(--accent-deep); }
a { color: var(--accent-deep); }

/* ---- cards ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px 22px; margin: 16px 0; box-shadow: 0 1px 2px rgba(20,20,20,.04); }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.card-grid .card { margin: 0; display: flex; flex-direction: column; }
.card-grid .card p { font-size: 17px; line-height: 1.55; color: #444B59; margin: 0; }
fieldset.card { border: 1px solid var(--line); }
fieldset.card legend { font-weight: 500; font-size: 18.5px; padding: 0 .3rem; color: var(--fg); }

/* ---- forms / inputs ---- */
label { display: block; margin: .4rem 0; }
.confirm label { display: flex; align-items: center; gap: 9px; font-size: 17px; color: #2A2F3A; cursor: pointer; margin: 7px 0; }
.confirm input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--accent); flex-shrink: 0; }
.eyebrow { font-size: 16.5px; color: #7E879B; margin: 0 0 14px; letter-spacing: .04em; text-transform: uppercase; }
input:not([type=checkbox]):not([type=radio]), textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--field-line); border-radius: 10px;
  background: #fff; color: var(--fg); font: inherit; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row input { flex: 1 1 14rem; }
button, .button, a.button { display: inline-flex; align-items: center; gap: 8px; padding: 13px 26px; border: 0;
  border-radius: 10px; background: var(--accent); color: var(--accent-ink) !important; font: inherit; font-weight: 600;
  font-size: 19px; cursor: pointer; text-decoration: none; line-height: 1; }
body.dark a.button, body.dark .button { color: var(--accent-ink) !important; }
button.secondary, .button.secondary { background: transparent; color: var(--muted); border: 0; padding: 13px 10px; font-weight: 400; }
button.link { background: none; color: var(--faint); padding: 0; text-decoration: none; font-size: 17px; }
.withdraw { margin-top: .5rem; }

/* ---- likert / pills (survey) ---- */
.likert { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.likert .muted { font-size: 16px; color: var(--faint); max-width: 120px; }
.likert label { display: inline-flex; align-items: center; justify-content: center; margin: 0; cursor: pointer;
  border: 1px solid var(--pill-line); background: #fff; border-radius: 9px; min-width: 40px; padding: 9px 13px;
  font-size: 17px; color: #3A4050; }
.likert label:has(input:checked) { border-color: var(--accent); background: #EAF8F1; color: var(--accent-deep); font-weight: 600; }
.likert input { position: absolute; opacity: 0; width: 0; height: 0; }
.choices { display: flex; gap: 9px; flex-wrap: wrap; }
.choices label { display: inline-flex; align-items: center; margin: 0; cursor: pointer; border: 1px solid var(--pill-line);
  background: #fff; border-radius: 9px; padding: 9px 15px; font-size: 17px; color: #3A4050; }
.choices label:has(input:checked) { border-color: var(--accent); background: #EAF8F1; color: var(--accent-deep); font-weight: 600; }
.choices input { position: absolute; opacity: 0; width: 0; height: 0; }
.req { color: #C0392B; font-weight: 400; }

/* ---- task banner / warning ---- */
blockquote.task { margin: 0 0 16px; padding: 0; border: 0; background: none; color: #444B59; font-size: 19px; font-weight: 400; }
.exercise-title { font-family: "Space Grotesk", sans-serif; font-weight: 600; font-size: 27px; margin: 0 0 6px; }
.warn-banner { display: flex; align-items: center; gap: 10px; background: var(--warn-bg); border: 1px solid var(--warn-line);
  border-radius: 12px; padding: 12px 18px; margin-bottom: 16px; }
.warn-banner p { margin: 0; font-size: 18px; color: var(--warn-ink); }

/* ---- status messages ---- */
.ok, .alert, .info { padding: 12px 16px; border-radius: 10px; margin: 0 0 16px; font-size: 18px; }
.ok { color: var(--ok); background: #EAF8F1; border: 1px solid #BFE6D4; }
.alert { color: var(--warn); background: #FBEBEA; border: 1px solid #F3C9C6; }
.info { color: #345; background: #EEF3F7; border: 1px solid #D4E0EA; }
.muted { color: var(--faint); font-size: 16.5px; }
code { font-size: .95em; }
.secret { user-select: all; }

/* ---- terminal ---- */
.terminal-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: 0 0 .5rem; flex-wrap: wrap; }
.terminal-status { font-size: 15px; color: #28C840; }
.terminal-status.bad { color: var(--warn); }
.timer { font-variant-numeric: tabular-nums; font-size: 17px; color: var(--muted); }
.terminal { height: 26rem; background: #0B0D12; border: 1px solid #171B26; border-radius: 13px; padding: .6rem; margin-bottom: 1rem; overflow: hidden; }
main.wide .terminal { height: 36rem; }

/* ---- dark pages (landing, debrief): body gets .dark ---- */
body.dark { background: #0C0E13; color: #E8EAF0; }
body.dark header, body.dark footer { background: transparent; border-color: #1C2030; }
body.dark .brand { color: #8A93A7; }
body.dark footer { color: #5A637A; }
body.dark footer a { color: #8A93A7; }
body.dark h1 { font-weight: 700; font-size: 48px; line-height: 1.05; letter-spacing: -.02em; color: #E8EAF0; }
body.dark a { color: #12C98E; }
body.dark .eyebrow { color: #12C98E; letter-spacing: .14em; }
body.dark .lead { font-size: 22px; line-height: 1.6; color: #AEB6C8; max-width: 620px; }
body.dark .sub { font-size: 19px; line-height: 1.65; color: #9AA3B6; }
body.dark .card { background: #12151D; border-color: #1E2335; box-shadow: none; }
body.dark .card p, body.dark .card li { color: #C9D2E3; }
body.dark .steps li { color: #5A637A; }
body.dark .steps li + li::before { color: #323A4D; }
body.dark .steps li.on { color: #12C98E; }
body.dark .muted { color: #7E879B; }
body.dark .code-xl { font-family: "JetBrains Mono", monospace; font-size: 34px; font-weight: 600; color: #12C98E; letter-spacing: .08em; }

/* landing hero + expectation cards: fill the space, cap text line length for readability only */
.hero { padding: 40px 0; }
.hero .lead, .hero .eyebrow { max-width: 820px; }
.expect { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; margin: 30px 0 38px; max-width: 480px; }
.expect .card { padding: 20px; }
.expect .big { font-family: "JetBrains Mono", monospace; color: #12C98E; font-size: 32px; margin-bottom: 10px; line-height: 1; }
.expect .cap { font-size: 17.5px; color: #9AA3B6; line-height: 1.45; }

/* ---- admin/containers tables keep legacy look ---- */
table { width: 100%; border-collapse: collapse; font-size: .92rem; margin-bottom: 1rem; display: block; overflow-x: auto; }
th, td { text-align: left; padding: .35rem .6rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.good { color: var(--ok); } .bad { color: var(--warn); }
form.inline { display: inline; margin-left: .5rem; }
td.wrap { white-space: normal; max-width: 32rem; word-break: break-word; }
input.small { width: 5rem !important; flex: 0 0 5rem !important; }
select { padding: .5rem; border: 1px solid var(--field-line); border-radius: 6px; background: #fff; color: var(--fg); font: inherit; }

/* ---- responsive ---- */
@media (max-width: 720px) {
  header, main, footer { padding-left: 16px; padding-right: 16px; }
  .hero { padding: 32px 16px; }
  .card-grid, .expect { grid-template-columns: 1fr; }
  body.dark h1 { font-size: 38px; }
}
