:root{
  --bg:#eef1f6;
  --bg2:#e4e8f0;
  --card:#ffffff;
  --ink:#1d2430;
  /* --muted is text: 4.62:1 on white, clearing WCAG AA 4.5:1. Do not lighten. */
  --muted:#6b7684;
  --line:#d7dde8;
  --accent:#5b6cff;
  --accent-soft:#eef0ff;
  --green:#22c55e;
  --green-soft:#e9faf0;
  --radius:22px;
  --shadow:0 24px 60px -20px rgba(36,46,74,.28), 0 8px 20px -12px rgba(36,46,74,.18);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Inter,system-ui,sans-serif;
  color:var(--ink);
  /* The height:100% rule above pins this box to the viewport while content can be
     far taller, so a repeating background tiles the gradient down long pages — the
     sample report is about 3 viewports. background-color fills whatever the
     gradient does not, no-repeat stops the tiling, and fixed anchors the glow to
     the viewport so "at 50% -10%" means the same thing on a short and a long page.
     If a browser ignores fixed, no-repeat plus the base colour still look right.
     Note: no braces in this comment — they break naive brace matching in tooling. */
  background-color:var(--bg2);
  background-image:radial-gradient(1200px 700px at 50% -10%,var(--bg) 0%,var(--bg2) 100%);
  background-repeat:no-repeat;
  background-attachment:fixed;
  display:flex;align-items:flex-start;justify-content:center;
  min-height:100vh;padding:40px 24px;
  -webkit-font-smoothing:antialiased;
}

/* The browser hides [hidden] via its own stylesheet, which ANY author display
   rule outranks — so `hidden` silently does nothing on .rail, .err and .foot,
   all of which set display. !important makes the attribute authoritative, so
   hiding an element never depends on it having no layout rule. */
[hidden]{display:none !important}

.stage{width:100%;max-width:600px;display:flex;flex-direction:column;align-items:center;gap:18px}

.brand{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:13px;font-weight:600;letter-spacing:.04em;text-transform:uppercase}
.brand .dot{width:9px;height:9px;border-radius:50%;background:var(--accent);box-shadow:0 0 0 4px var(--accent-soft)}

/* progress rail */
.rail{width:100%;display:flex;align-items:center;gap:12px;color:var(--muted);font-size:13px;font-weight:600}
.rail .track{flex:1;height:6px;border-radius:999px;background:#dfe4ee;overflow:hidden}
.rail .track > i{display:block;height:100%;width:0;border-radius:999px;background:linear-gradient(90deg,var(--accent),#8b7bff);transition:width .5s cubic-bezier(.4,0,.2,1)}

/* card */
.card{
  position:relative;width:100%;background:var(--card);border-radius:var(--radius);
  box-shadow:var(--shadow);padding:38px 36px 30px;overflow:hidden;
  transition:transform .35s cubic-bezier(.2,.7,.2,1),opacity .35s ease,background .3s ease;
}
.card .fill{
  position:absolute;inset:0;width:0;background:linear-gradient(90deg,rgba(91,108,255,.14),rgba(139,123,255,.20));
  border-radius:var(--radius) 0 0 var(--radius);pointer-events:none;z-index:0;
}
.card.processing .fill{width:100%;transition:width .9s cubic-bezier(.45,.05,.35,1)}
.card > *{position:relative;z-index:1}

.card.success{background:var(--green-soft)}
.card.leaving{transform:translateY(-22px);opacity:0}
.card.entering{transform:translateY(22px);opacity:0}

.question{font-size:25px;line-height:1.25;font-weight:650;margin:8px 0 4px;letter-spacing:-.01em}
.question b{color:var(--accent);font-weight:750}
.hint{font-size:13.5px;color:var(--muted);margin:0 0 22px;line-height:1.5}

/* text input */
.answer{margin-top:18px}
textarea.field,input.field{
  width:100%;border:1.5px solid var(--line);border-radius:14px;
  padding:14px 16px;font:inherit;font-size:16px;color:var(--ink);background:#fbfcfe;
  transition:border-color .2s ease,box-shadow .2s ease;
}
textarea.field{min-height:84px;resize:none}
textarea.field:focus,input.field:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 4px var(--accent-soft);background:#fff}

/* footer / submit */
/* flex-wrap is load-bearing: on step 4 this row holds the whole consent
   sentence, the Privacy link and the Send button. Without it they collide. */
.foot{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;margin-top:26px;gap:12px}
/* Keeps the action on the right whether or not there is text beside it, so the
   layout does not depend on a label existing. */
.foot .btn{margin-left:auto}
.kbd{font-size:12.5px;color:var(--muted)}
.kbd b{background:#f0f2f7;border:1px solid var(--line);border-radius:6px;padding:1px 7px;font-weight:600;color:#566070}
.btn{
  border:none;background:var(--accent);color:#fff;font:inherit;font-weight:650;font-size:15px;
  padding:12px 22px;border-radius:12px;cursor:pointer;transition:transform .08s ease,background .15s ease,opacity .2s;
  box-shadow:0 8px 18px -8px rgba(91,108,255,.7);
}
.btn:hover{background:#4c5cf0}
.btn:active{transform:translateY(1px)}
.btn:disabled{opacity:.45;cursor:not-allowed;box-shadow:none}

/* thinking dots */
.thinking{display:flex;align-items:center;gap:6px;color:var(--muted);font-size:14px;font-weight:600}
.thinking i{width:7px;height:7px;border-radius:50%;background:var(--accent);animation:bounce 1s infinite}
.thinking i:nth-child(2){animation-delay:.15s}
.thinking i:nth-child(3){animation-delay:.3s}

/* success check overlay */
.check{position:absolute;top:16px;right:18px;z-index:2;width:30px;height:30px;border-radius:50%;background:var(--green);
  display:grid;place-items:center;opacity:0;transform:scale(.4);transition:all .3s cubic-bezier(.2,.8,.3,1.4)}
.check.show{opacity:1;transform:scale(1)}
.check svg{width:16px;height:16px}

/* ---- form ---- */
.formgrid{display:flex;flex-direction:column;gap:12px;margin-top:4px}
.flabel{font-size:12.5px;font-weight:650;color:var(--muted);margin-bottom:5px;display:block}

/* ---- confirmation panels ---- */
.done-head{display:flex;align-items:center;gap:12px;margin-bottom:4px}
.done-head .ok{width:40px;height:40px;border-radius:50%;background:var(--green);display:grid;place-items:center;flex:none}
.done-head .ok svg{width:22px;height:22px}

@keyframes bounce{0%,60%,100%{transform:translateY(0);opacity:.5}30%{transform:translateY(-6px);opacity:1}}
@keyframes blink{0%,100%{opacity:1}50%{opacity:.25}}

:where(a, button, input, textarea, [tabindex]):focus-visible{
  outline:3px solid var(--accent);
  outline-offset:2px;
}

/* Choices are real inputs. The visual box is the ::before on the label. */
.choicegroup{border:none;margin:0;padding:0}
.choicegroup legend{font-size:25px;line-height:1.25;font-weight:650;
  letter-spacing:-.01em;margin:0 0 6px;padding:0}
.choices{display:flex;flex-wrap:wrap;gap:10px;margin-top:4px}
.choice{display:inline-flex;align-items:center;gap:10px;
  border:1.5px solid var(--line);background:#fbfcfe;border-radius:14px;
  padding:13px 16px;font-size:15px;font-weight:550;cursor:pointer;
  transition:border-color .15s ease,background .15s ease,box-shadow .15s ease}
.choice:hover{border-color:#c7cfe0;background:#fff}
.choice input{appearance:none;width:20px;height:20px;margin:0;flex:none;
  border:2px solid #c2cad8;border-radius:50%;background:#fff;
  transition:all .15s ease;cursor:pointer}
.choice input:checked{border-color:var(--accent);
  background:radial-gradient(circle,var(--accent) 42%,#fff 46%)}
.choice:has(input:checked){border-color:var(--accent);background:var(--accent-soft)}
.choice:has(input:focus-visible){outline:3px solid var(--accent);outline-offset:2px}

/* Entry: two equally weighted choices. Neither is a secondary action. */
.entry{display:flex;flex-direction:column;gap:12px;margin-top:22px}
.entry .btn{width:100%;text-align:center;padding:16px 22px;font-size:16px}
.entry .btn.alt{background:#fff;color:var(--ink);
  border:1.5px solid var(--line);box-shadow:none}
.entry .btn.alt:hover{background:#fbfcfe;border-color:#c7cfe0}

.err{display:block;font-size:12.5px;font-weight:600;color:#c2410c;margin-top:6px}
.field[aria-invalid="true"]{border-color:#f0824a}

/* Honeypot: off-screen, not display:none — bots skip hidden fields. */
.hp{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}

.backrow{margin-top:14px}
.back{background:none;border:none;font:inherit;font-size:13px;font-weight:600;
  color:var(--muted);cursor:pointer;padding:6px 2px;text-decoration:underline;
  text-underline-offset:3px}
.back:hover{color:var(--accent)}

.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;
  clip:rect(0 0 0 0);white-space:nowrap}

@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{animation-duration:.001ms !important;
    animation-iteration-count:1 !important;transition-duration:.001ms !important}
  .card.leaving,.card.entering{transform:none;opacity:1}
}

/* ---- sample report ---- */
.samplenote{font-size:11.5px;color:var(--muted);line-height:1.5;margin:0 0 18px;
  padding:9px 12px;background:#f6f8fc;border-radius:10px}
.ctx{display:flex;flex-direction:column;gap:0;margin:0 0 22px;
  border:1.5px solid var(--line);border-radius:14px;overflow:hidden}
.ctx div{display:flex;justify-content:space-between;gap:14px;
  padding:10px 14px;font-size:13px;border-bottom:1px solid var(--line)}
.ctx div:last-child{border-bottom:none}
.ctx dt{color:var(--muted);font-weight:600;margin:0;flex:none}
.ctx dd{margin:0;text-align:right;color:var(--ink)}
.lede{font-size:16.5px;line-height:1.5;font-weight:600;margin:0 0 22px;
  padding-left:14px;border-left:3px solid var(--accent);letter-spacing:-.005em}
.sec{margin:0 0 20px}
.sec h3{font-size:12.5px;font-weight:700;text-transform:uppercase;
  letter-spacing:.05em;color:var(--muted);margin:0 0 6px}
.sec p{font-size:14px;line-height:1.6;color:#46505f;margin:0}
.pairs{margin:0 0 20px;padding:0;list-style:none}
.pairs li{font-size:14px;line-height:1.6;color:#46505f;margin:0 0 8px}
.pairs b{color:var(--ink);font-weight:650}

/* Meters. One hue: the bar is the only coloured thing; all text wears ink tokens.
   Track is a lighter step of the same hue, not gray, so state reads across the
   full width. Values are always shown, so a near-zero bar reads as measured. */
.meters{margin:0 0 6px}
.meterscale{font-size:11.5px;color:var(--muted);margin:0 0 12px}
.meter{display:grid;grid-template-columns:1fr auto;align-items:baseline;
  column-gap:12px;margin:0 0 13px}
.meter .mlabel{font-size:13.5px;color:var(--ink);font-weight:550}
.meter .mval{font-size:13.5px;color:var(--ink);font-weight:700;
  font-variant-numeric:tabular-nums}
.meter .mtrack{grid-column:1 / -1;margin-top:5px;height:8px;border-radius:0 4px 4px 0;
  background:var(--accent-soft);overflow:hidden}
.meter .mfill{height:100%;background:var(--accent);border-radius:0 4px 4px 0}

.pdfnote{font-size:13px;color:var(--muted);line-height:1.55;margin:20px 0 0}

/* ---- narrow viewports ----
   At 375px the card's content box is about 255px wide. The footer button goes
   full width and the context rows stack, so nothing has to be read sideways. */
@media (max-width: 420px){
  body{padding:20px 16px}
  .card{padding:26px 22px 22px}
  .question{font-size:22px}
  .foot{gap:14px}
  .foot .btn{width:100%;text-align:center}
  .ctx div{flex-direction:column;gap:2px}
  .ctx dd{text-align:left}
}
