/* ============================================================================
   Niti — styles.css
   Brand tokens live in :root so they're easy to swap (spec §9).
   Mobile-first. No external fonts (offline-safe, zero CDN — spec §2).
   ========================================================================= */

:root {
  /* ── Brand ─────────────────────────────────────────────── */
  --navy:        #0F2A4A;   /* deep trust navy — headers, dark surfaces */
  --navy-700:    #16385E;
  --primary:     #2563EB;   /* accent: trust blue */
  --primary-700: #1D4ED8;
  --primary-50:  #EFF5FF;
  --cta:         #F97316;   /* single warm CTA — used sparingly */
  --cta-700:     #EA580C;

  /* ── Neutrals ──────────────────────────────────────────── */
  --bg:        #F8FAFC;
  --surface:   #FFFFFF;
  --text:      #1E293B;
  --text-mute: #475569;      /* 4.5:1 on --bg — never lighter for body */
  --line:      #E2E8F0;
  --line-2:    #CBD5E1;

  /* ── RAG semantics (always paired with a text label) ───── */
  --red:      #DC2626;
  --red-bg:   #FEF2F2;
  --amber:    #B45309;       /* darkened for AA text contrast */
  --amber-bg: #FFFBEB;
  --green:    #15803D;
  --green-bg: #F0FDF4;

  /* ── Type: system stack, no network fetch ──────────────── */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", sans-serif;

  /* ── Scale ─────────────────────────────────────────────── */
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;
  --shadow:    0 1px 2px rgba(15, 42, 74, .06), 0 4px 16px rgba(15, 42, 74, .06);
  --shadow-lg: 0 2px 4px rgba(15, 42, 74, .06), 0 12px 32px rgba(15, 42, 74, .10);
  --ring: 0 0 0 3px rgba(37, 99, 235, .35);
  --wrap: 640px;
  --ease: cubic-bezier(.22, .61, .36, 1);   /* ease-out for entering */

  /* z-index scale */
  --z-header: 10;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;              /* ≥16px on mobile */
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;           /* no horizontal scroll */
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.2; letter-spacing: -.02em; margin: 0; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button, input { font: inherit; color: inherit; }
svg { display: block; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 50;
  background: var(--surface); color: var(--primary-700);
  padding: 10px 16px; border-radius: var(--r-sm); font-weight: 600;
  transition: top .15s var(--ease);
}
.skip-link:focus { top: 12px; }

/* Visible focus everywhere (never removed without replacement) */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Header ──────────────────────────────────────────────── */
.site-header {
  background: var(--navy);
  color: #fff;
  position: relative;
  z-index: var(--z-header);
}
.header-inner { display: flex; align-items: center; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 30px; height: 30px; color: #7FB2FF; flex: none; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: 19px; font-weight: 700; letter-spacing: -.01em; line-height: 1.15; }
.brand-sub  { font-size: 11.5px; color: #A9C4E6; letter-spacing: .02em; }

/* ── Screens ─────────────────────────────────────────────── */
.screen { padding-block: 36px 56px; }
.screen[hidden] { display: none; }

/* Enter animation — one element per view, honours reduced motion */
.screen:not([hidden]) { animation: rise .32s var(--ease) both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ── Landing ─────────────────────────────────────────────── */
.eyebrow {
  display: inline-block;
  font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--primary-700); background: var(--primary-50);
  padding: 5px 11px; border-radius: 999px; margin-bottom: 16px;
}
h1 { font-size: clamp(30px, 8vw, 42px); font-weight: 800; }
.lede {
  margin-top: 14px; font-size: 17.5px; color: var(--text-mute);
  max-width: 62ch;                       /* readable line length */
}
#btn-start { margin-top: 26px; }

.meta-row {
  display: flex; flex-wrap: wrap; gap: 8px 20px;
  margin-top: 22px; font-size: 14px; color: var(--text-mute);
}
.meta-row li { display: flex; align-items: center; gap: 7px; }
.meta-icon { width: 16px; height: 16px; color: var(--line-2); flex: none; }

.trust-line {
  display: flex; gap: 10px; align-items: flex-start;
  margin-top: 28px; padding: 14px 16px;
  background: var(--green-bg);
  border: 1px solid #BBF7D0; border-radius: var(--r);
  font-size: 14.5px; color: #14532D;
}
.trust-line--sm { margin-top: 24px; font-size: 13.5px; padding: 11px 14px; }
.trust-icon { width: 18px; height: 18px; color: var(--green); flex: none; margin-top: 2px; }

.cover-grid { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--line); }
.section-title { font-size: 19px; font-weight: 700; }
#gaps-title { margin-top: 36px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chips li {
  font-size: 13.5px; font-weight: 500; color: var(--text-mute);
  background: var(--surface); border: 1px solid var(--line);
  padding: 7px 12px; border-radius: 999px;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px;                      /* ≥44px touch target */
  padding: 12px 22px;
  border: 1px solid transparent; border-radius: var(--r);
  font-size: 16px; font-weight: 600;
  cursor: pointer;
  transition: background-color .2s var(--ease), border-color .2s var(--ease),
              color .2s var(--ease), box-shadow .2s var(--ease);
  /* colour/shadow transitions only — no scale, so layout never shifts */
}
.btn-lg    { min-height: 54px; font-size: 17px; padding-inline: 26px; }
.btn-block { display: flex; width: 100%; }
.btn-icon  { width: 18px; height: 18px; flex: none; }

.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover:not(:disabled) { background: var(--primary-700); }

.btn-cta { background: var(--cta); color: #fff; box-shadow: var(--shadow); text-decoration: none; }
.btn-cta:hover { background: var(--cta-700); }

.btn-ghost {
  background: var(--surface); color: var(--text-mute); border-color: var(--line-2);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--text-mute); color: var(--text); }

.btn:disabled { opacity: .45; cursor: not-allowed; }

.spinner {
  width: 17px; height: 17px; flex: none;
  border: 2px solid rgba(255,255,255,.45); border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Assessment ──────────────────────────────────────────── */
.progress-head { margin-bottom: 26px; }
.progress-label {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  font-size: 13px; font-weight: 600; color: var(--text-mute); margin-bottom: 8px;
}
.progress-cat { color: var(--primary-700); font-weight: 600; text-align: right; }
.progress-track {
  height: 6px; background: var(--line); border-radius: 999px; overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0; background: var(--primary); border-radius: 999px;
  transition: width .3s var(--ease);
}

.q-block { border: 0; padding: 0; margin: 0; }
.q-text {
  font-size: clamp(21px, 5.4vw, 26px); font-weight: 700;
  min-height: 2.4em;                     /* reserves space — no layout shift */
}
.options { display: grid; gap: 10px; margin-top: 24px; }

.option {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 14px 16px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  font-weight: 500; cursor: pointer;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.option:hover { border-color: var(--line-2); background: #FCFDFF; }
.option input { position: absolute; opacity: 0; width: 0; height: 0; }
.option-mark {
  width: 21px; height: 21px; flex: none;
  border: 2px solid var(--line-2); border-radius: 50%;
  display: grid; place-items: center;
  transition: border-color .2s var(--ease);
}
.option-mark::after {
  content: ""; width: 10px; height: 10px; border-radius: 50%;
  background: var(--primary); transform: scale(0);
  transition: transform .18s var(--ease);
}
.option input:checked ~ .option-mark { border-color: var(--primary); }
.option input:checked ~ .option-mark::after { transform: scale(1); }
.option:has(input:checked) { border-color: var(--primary); background: var(--primary-50); }
.option:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Not-applicable: a real answer, but visually secondary so it doesn't compete
   with the four scored options. Full width, since it's the odd fifth. */
.option--na { color: var(--text-mute); border-style: dashed; }
.option--na:has(input:checked) { color: var(--text); }

.nav-row { display: flex; gap: 12px; margin-top: 28px; }
.nav-row .btn { flex: 1; }

/* ── Email gate ──────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 24px; box-shadow: var(--shadow);
}
.teaser { text-align: center; }
.teaser .eyebrow { margin-bottom: 12px; }
.teaser-band { display: flex; align-items: center; justify-content: center; gap: 9px; }
.band-label { font-size: 23px; font-weight: 800; letter-spacing: -.01em; }
.band-dot { width: 11px; height: 11px; border-radius: 50%; flex: none; background: var(--line-2); }
.teaser-gaps { margin-top: 12px; font-size: 17px; }
.teaser-gaps strong { font-size: 20px; }
.teaser-note {
  margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line);
  font-size: 14px; color: var(--text-mute);
}

.gate-title { margin-top: 32px; font-size: 22px; font-weight: 700; }
.gate-form { margin-top: 18px; display: grid; gap: 16px; }
.field { display: grid; gap: 7px; }
.field label { font-size: 14px; font-weight: 600; }
.optional { font-weight: 400; color: var(--text-mute); }
.field input {
  min-height: 50px; padding: 12px 14px;
  background: var(--surface);
  border: 1.5px solid var(--line-2); border-radius: var(--r);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field input::placeholder { color: #94A3B8; }
.field input:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.field input[aria-invalid="true"] { border-color: var(--red); }
.field-err { font-size: 13.5px; font-weight: 500; color: var(--red); }

/* ── Result ──────────────────────────────────────────────── */
.score-card { text-align: center; padding-block: 30px; }
.dial-wrap { position: relative; width: 156px; height: 156px; margin: 0 auto; }
.dial { width: 100%; height: 100%; }
.dial-track { stroke: var(--line); }
.dial-value {
  stroke: var(--line-2);
  stroke-dasharray: 327;                 /* 2πr, r=52 */
  stroke-dashoffset: 327;
  transition: stroke-dashoffset .9s var(--ease), stroke .3s var(--ease);
}
.dial-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.dial-score { font-size: 44px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.dial-unit { font-size: 12.5px; color: var(--text-mute); margin-top: 3px; }

.band-pill {
  display: inline-flex; align-items: center; gap: 9px;
  margin-top: 20px; padding: 8px 16px;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: 15.5px; font-weight: 700;
}
.band-blurb {
  margin-top: 14px; font-size: 15px; color: var(--text-mute);
  max-width: 46ch; margin-inline: auto;
}

/* RAG modifiers — colour reinforces the label, never replaces it */
.is-red   .band-pill { background: var(--red-bg);   border-color: #FECACA; color: var(--red); }
.is-amber .band-pill { background: var(--amber-bg); border-color: #FDE68A; color: var(--amber); }
.is-green .band-pill { background: var(--green-bg); border-color: #BBF7D0; color: var(--green); }
.is-red   .band-dot  { background: var(--red); }
.is-amber .band-dot  { background: var(--amber); }
.is-green .band-dot  { background: var(--green); }
.is-red   .dial-value { stroke: var(--red); }
.is-amber .dial-value { stroke: var(--amber); }
.is-green .dial-value { stroke: var(--green); }

.gap-list { display: grid; gap: 12px; margin-top: 16px; }
.gap-item {
  display: flex; gap: 13px;
  background: var(--surface); border: 1px solid var(--line);
  border-left: 4px solid var(--line-2);
  border-radius: var(--r); padding: 16px 18px;
}
.gap-item.sev-red   { border-left-color: var(--red); }
.gap-item.sev-amber { border-left-color: var(--amber); }
.gap-item.sev-green { border-left-color: var(--green); }
.gap-icon { width: 20px; height: 20px; flex: none; margin-top: 2px; color: var(--text-mute); }
.sev-red   .gap-icon { color: var(--red); }
.sev-amber .gap-icon { color: var(--amber); }
.sev-green .gap-icon { color: var(--green); }
.gap-name { font-size: 16px; font-weight: 700; }
.gap-risk { margin-top: 4px; font-size: 14.5px; color: var(--text-mute); }
.gap-score {
  margin-top: 7px; font-size: 12px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--text-mute);
}

/* Statutory strip — reads as a citation, not a scare banner.
   Neutral greys carry the law; only the amount takes an accent. */
.gap-statute {
  margin-top: 13px; padding-top: 13px;
  border-top: 1px dashed var(--line);
  display: grid; gap: 9px;
}
.statute-law { font-size: 13.5px; line-height: 1.5; color: var(--text-mute); }
.statute-tag {
  display: inline-block; margin-right: 7px;
  padding: 2px 7px; border-radius: 5px;
  background: var(--bg); border: 1px solid var(--line);
  font-size: 11.5px; font-weight: 700; letter-spacing: .01em;
  color: var(--text); white-space: nowrap;
}
.statute-penalty { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.penalty-amount {
  font-size: 14.5px; font-weight: 800; letter-spacing: -.01em;
  color: var(--text);
}
.sev-red   .penalty-amount { color: var(--red); }
.sev-amber .penalty-amount { color: var(--amber); }
.penalty-basis { font-size: 12.5px; color: #64748B; line-height: 1.45; }

.penalty-note {
  margin-top: 16px; padding: 13px 15px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r);
  font-size: 12.5px; line-height: 1.55; color: var(--text-mute);
}
.penalty-note[hidden] { display: none; }

.cta {
  margin-top: 32px;
  background: var(--navy);
  border-color: var(--navy-700);
  color: #fff; text-align: center;
}
.cta h2 { font-size: 21px; font-weight: 700; }
.cta p { margin-top: 10px; font-size: 15px; color: #C6D9F0; }
.cta .btn { margin-top: 20px; }

.disclaimer {
  margin-top: 22px; font-size: 13px; color: var(--text-mute);
  text-align: center; font-style: italic;
}
#btn-restart { margin-top: 18px; }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  margin-top: 40px; padding-block: 26px;
  border-top: 1px solid var(--line);
  font-size: 13.5px; color: var(--text-mute); text-align: center;
}
.footer-note { margin-top: 5px; font-size: 12.5px; color: #64748B; }

/* ── Tablet / desktop ────────────────────────────────────── */
@media (min-width: 768px) {
  :root { --wrap: 680px; }
  .screen { padding-block: 56px 72px; }
  .options { grid-template-columns: 1fr 1fr; }
  .option--na { grid-column: 1 / -1; }
  .nav-row .btn { flex: 0 1 auto; min-width: 140px; }
  .nav-row { justify-content: space-between; }
  .gate-form { grid-template-columns: 1fr 1fr; }
  .gate-form .btn { grid-column: 1 / -1; }
}

/* ── Reduced motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
