/**
 * VSA Sales Readiness Assessment — presentation layer.
 *
 * Design tokens are inherited from the existing storefront (Space Grotesk +
 * Instrument Serif, the #08101d ground and #2d7ff9 accent) so the diagnostic
 * reads as part of the site rather than a bolted-on quiz.
 *
 * Rules this file holds itself to:
 *   - mobile-first; validated at 320 / 375 / 390 / 430 / tablet / desktop
 *   - no horizontal overflow at any width
 *   - every interactive target at least 44px on its short axis
 *   - visible focus on everything focusable, never removed
 *   - all motion behind prefers-reduced-motion
 */

:root {
  --bg: #08101d;
  --surface: rgba(18, 28, 46, .72);
  --surface-2: rgba(24, 36, 58, .6);
  --surface-3: rgba(255, 255, 255, .02);
  --text: #f5f7fb;
  --muted: #9aa6bc;
  --muted-strong: #c2ccde;
  --line: rgba(255, 255, 255, .12);
  --line-strong: rgba(255, 255, 255, .2);
  --accent: #2d7ff9;
  --accent-strong: #5b9dff;
  --accent-deep: #1b56c9;
  --good: #4ade80;
  --warn: #ffcc66;
  --bad: #ff9d9d;
  --radius: 18px;
  --radius-lg: 22px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
  color: var(--text);
  line-height: 1.65;
  background:
    radial-gradient(900px 500px at 78% -8%, rgba(45, 127, 249, .2), transparent 60%),
    linear-gradient(180deg, #0a1322, #08101d 55%, #050b14);
  background-attachment: fixed;
  overflow-x: hidden;
}

.wrap { max-width: 860px; margin: 0 auto; padding: 40px 20px 80px; }
@media (min-width: 700px) { .wrap { padding: 56px 24px 80px; } }

.topnav {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap; margin-bottom: 32px;
}
.topnav a {
  color: var(--accent-strong); text-decoration: none; font-weight: 600;
  font-size: .92rem; padding: 10px 0; min-height: 44px; display: inline-flex; align-items: center;
}
.topnav a:hover { text-decoration: underline; }

.eyebrow {
  text-transform: uppercase; letter-spacing: .22em; font-size: .72rem;
  font-weight: 700; color: var(--accent-strong); margin: 0;
}
h1 { font-size: clamp(1.9rem, 5.5vw, 3rem); letter-spacing: -.04em; line-height: 1.06; margin: 10px 0 14px; }
.serif { font-family: "Instrument Serif", Georgia, serif; font-style: italic; }
.lead { color: var(--muted-strong); font-size: 1.05rem; margin: 0 0 8px; }
.tip { color: var(--muted); font-size: .88rem; }

/* ---------------- buttons ---------------- */

/* The storefront's shared button runs #5b9dff -> #1b56c9 behind #0a1020 text.
   That deep end measures 2.91:1, under the 4.5:1 WCAG AA floor for body text.
   Ending the gradient on --accent (#2d7ff9) instead keeps the same two brand
   blues and holds 4.98:1 at the darkest point, 6.96:1 at the lightest.
   Scoped to the assessment so no other page's styling changes. */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 14px 28px; border: 0; border-radius: 999px;
  font-weight: 700; font-size: 1rem; font-family: inherit; color: #0a1020;
  text-decoration: none; cursor: pointer;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  box-shadow: 0 14px 34px -16px rgba(45, 127, 249, .9);
  transition: transform .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-ghost {
  background: none; color: var(--accent-strong);
  border: 1px solid var(--line-strong); box-shadow: none;
}
.btn:focus-visible, .opt:focus-visible, a:focus-visible, input:focus-visible, .conf-opt:focus-visible {
  outline: 3px solid var(--accent-strong); outline-offset: 3px;
}
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------------- card shell ---------------- */

.card {
  margin-top: 28px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 24px 20px 28px;
  backdrop-filter: blur(14px);
}
@media (min-width: 700px) { .card { padding: 30px 30px 34px; } }

/* ---------------- question screen ---------------- */

.q-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.cat-tag {
  display: inline-block; padding: 6px 13px; border-radius: 999px;
  background: rgba(45, 127, 249, .13); border: 1px solid rgba(45, 127, 249, .4);
  color: var(--accent-strong); font-size: .7rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
}
.step-count { color: var(--muted-strong); font-size: .85rem; font-variant-numeric: tabular-nums; }

.bar-track {
  height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .09);
  margin-top: 14px; overflow: hidden;
}
.bar-fill {
  display: block; height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent-strong));
  transition: width .35s ease;
}

.scenario {
  margin: 22px 0 0; font-size: 1.05rem; color: var(--muted-strong);
  padding: 14px 16px; border-radius: var(--radius);
  background: var(--surface-2); border-left: 3px solid var(--accent);
}
.q-prompt { font-size: 1.16rem; letter-spacing: -.02em; line-height: 1.4; margin: 18px 0 0; font-weight: 600; }
@media (min-width: 700px) { .q-prompt { font-size: 1.28rem; } }

.opts { display: grid; gap: 10px; margin: 20px 0 0; padding: 0; list-style: none; }
.opt {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; min-height: 56px;
  text-align: left; font-family: inherit; font-size: .95rem; line-height: 1.55;
  color: var(--muted-strong); background: var(--surface-3);
  border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
  cursor: pointer; transition: border-color .15s, background .15s, color .15s, transform .15s;
}
.opt:hover:not(:disabled) { border-color: rgba(91, 157, 255, .55); color: var(--text); }
.opt:disabled { cursor: default; }
.opt .key {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line);
  font-size: .72rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; margin-top: 1px;
}
/* Selection is acknowledged, never graded. No correct/incorrect styling
   exists in this file by design — Stage 1 must not teach its own key. */
.opt.picked {
  color: var(--text); border-color: var(--accent-strong);
  background: rgba(45, 127, 249, .14); transform: translateX(2px);
}
.opt.picked .key { background: var(--accent-strong); color: #0a1020; border-color: transparent; }
.opts.locked .opt:not(.picked) { opacity: .45; }

/* ---------------- confidence check ---------------- */

.conf {
  margin: 18px 0 0; padding: 16px 16px 18px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--line);
  border-left: 3px solid var(--warn);
}
.conf-q { margin: 0 0 12px; font-size: .98rem; font-weight: 600; }
.conf-opts { display: flex; gap: 8px; flex-wrap: wrap; padding: 0; margin: 0; list-style: none; }
.conf-opt {
  flex: 1 1 auto; min-width: 96px; min-height: 46px; padding: 11px 14px;
  font-family: inherit; font-size: .9rem; font-weight: 600;
  color: var(--muted-strong); background: var(--surface-3);
  border: 1px solid var(--line); border-radius: 12px; cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.conf-opt:hover { border-color: rgba(255, 204, 102, .6); color: var(--text); }
.conf-opt.picked { border-color: var(--warn); background: rgba(255, 204, 102, .14); color: var(--text); }
.conf-note { margin: 12px 0 0; font-size: .8rem; color: var(--muted); }
/* A report link is one unbroken 500-character token with no spaces in it, so
   nothing in normal wrapping can break it and it runs off the side of a
   phone. "anywhere" is what allows a break mid-token; min-width:0 stops a
   flex or grid parent sizing itself to the unbroken string instead. */
.report-link { min-width: 0; overflow-wrap: anywhere; word-wrap: break-word; word-break: break-word; }

/* ---------------- milestone interstitial ---------------- */

.milestone { text-align: center; padding: 36px 20px 34px; }
.milestone .ring {
  width: 74px; height: 74px; margin: 0 auto 18px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 1.1rem;
  color: var(--accent-strong); border: 3px solid rgba(45, 127, 249, .35);
  background: rgba(45, 127, 249, .1);
}
.milestone h2 { margin: 0 0 10px; font-size: 1.35rem; letter-spacing: -.03em; }
.milestone p { color: var(--muted-strong); max-width: 46ch; margin: 0 auto 22px; }

/* ---------------- results ---------------- */

.score-hero { text-align: center; padding: 8px 0 4px; }
.badge {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  background: rgba(74, 222, 128, .12); border: 1px solid rgba(74, 222, 128, .4);
  color: var(--good); font-size: .7rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
}
.score-dial { margin: 22px auto 6px; width: 176px; height: 176px; position: relative; }
.score-dial svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-dial .track { fill: none; stroke: rgba(255, 255, 255, .09); stroke-width: 12; }
.score-dial .value {
  fill: none; stroke: url(#scoreGrad); stroke-width: 12; stroke-linecap: round;
  transition: stroke-dashoffset 1s cubic-bezier(.22, 1, .36, 1);
}
.score-dial .readout {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
}
.score-dial .num { font-size: 3rem; font-weight: 700; letter-spacing: -.05em; line-height: 1; }
.score-dial .den { color: var(--muted); font-size: .82rem; margin-top: 4px; }
.level-name {
  font-family: "Instrument Serif", Georgia, serif; font-style: italic;
  font-size: clamp(1.6rem, 5vw, 2.1rem); color: var(--accent-strong);
  line-height: 1.2; margin: 10px 0 0;
}
.level-interp { color: var(--muted); font-size: .9rem; margin: 6px 0 0; }
.level-summary { color: var(--muted-strong); margin: 16px auto 0; max-width: 54ch; }

.pair { display: grid; gap: 12px; margin-top: 26px; }
@media (min-width: 620px) { .pair { grid-template-columns: 1fr 1fr; } }
.pair-item { padding: 16px 18px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); }
.pair-item .label {
  font-size: .7rem; letter-spacing: .12em; text-transform: uppercase;
  font-weight: 700; color: var(--muted); margin: 0;
}
.pair-item .name { margin: 6px 0 0; font-size: 1.05rem; font-weight: 700; letter-spacing: -.02em; }
.pair-item .pct { font-variant-numeric: tabular-nums; color: var(--accent-strong); }
.pair-item.strong { border-left: 3px solid var(--good); }
.pair-item.strong .pct { color: var(--good); }
.pair-item.dev { border-left: 3px solid var(--warn); }
.pair-item.dev .pct { color: var(--warn); }

.section { margin-top: 32px; padding-top: 26px; border-top: 1px solid var(--line); }
.section h2 { margin: 0 0 4px; font-size: 1.15rem; letter-spacing: -.025em; }
.section .sub { color: var(--muted); font-size: .88rem; margin: 0 0 18px; }

.skill { margin-top: 16px; }
.skill-head { display: flex; justify-content: space-between; gap: 12px; font-size: .93rem; align-items: baseline; }
.skill-head .nm { font-weight: 600; }
.skill-head .val { color: var(--muted-strong); font-variant-numeric: tabular-nums; font-weight: 700; }
.skill .bar-track { margin-top: 7px; }
.skill.lo .bar-fill { background: linear-gradient(90deg, #8a3a3a, var(--bad)); }
.skill.lo .val { color: var(--bad); }
.skill.mid .bar-fill { background: linear-gradient(90deg, #8a6a2a, var(--warn)); }
.skill.mid .val { color: var(--warn); }
.skill.hi .bar-fill { background: linear-gradient(90deg, #2a7a4a, var(--good)); }
.skill.hi .val { color: var(--good); }

.coach {
  margin-top: 18px; padding: 18px 18px 20px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--accent);
}
.coach h3 { margin: 0; font-size: 1.02rem; letter-spacing: -.02em; }
.coach .band {
  display: inline-block; margin-left: 8px; padding: 3px 9px; border-radius: 999px;
  font-size: .64rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  vertical-align: middle; background: rgba(255, 255, 255, .07); color: var(--muted);
}
.coach dl { margin: 14px 0 0; display: grid; gap: 12px; }
.coach dt {
  font-size: .7rem; letter-spacing: .12em; text-transform: uppercase;
  font-weight: 700; color: var(--accent-strong); margin: 0;
}
.coach dd { margin: 4px 0 0; color: var(--muted-strong); font-size: .94rem; }
.coach.dev { border-left-color: var(--warn); }
.coach.dev dt { color: var(--warn); }
.coach.hi { border-left-color: var(--good); }
.coach.hi dt { color: var(--good); }

.train { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.train li { padding-left: 22px; position: relative; color: var(--muted-strong); font-size: .92rem; }
.train li::before { content: "\2192"; position: absolute; left: 0; color: var(--accent-strong); font-weight: 700; }
.train a { color: var(--accent-strong); text-decoration: none; font-weight: 600; }
.train a:hover { text-decoration: underline; }
.train .note { display: block; color: var(--muted); font-size: .84rem; }

/* Practice drills: a name, the cadence it runs at, then what to actually do. */
.train .drill-name { font-weight: 700; color: var(--text); }
.train .drill-cadence {
  display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, .07); color: var(--muted);
  font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  vertical-align: middle;
}
.train .drill-name + .drill-cadence + .note { margin-top: 4px; }

/* The optional existing resource — deliberately quieter than the drills. */
.resource {
  margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: .9rem; color: var(--muted-strong);
}
.resource-label {
  display: inline-block; margin-right: 8px; padding: 2px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, .05); color: var(--muted);
  font-size: .64rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
}
.resource a { color: var(--accent-strong); text-decoration: none; font-weight: 600; }
.resource a:hover { text-decoration: underline; }
.resource .note { display: block; margin-top: 4px; color: var(--muted); font-size: .84rem; }

.calib { margin-top: 18px; padding: 18px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); }
.calib .nums { display: flex; gap: 22px; flex-wrap: wrap; margin: 0 0 14px; }
.calib .nums div { min-width: 92px; }
.calib .nums .k { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.calib .nums .v { font-size: 1.7rem; font-weight: 700; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.calib h3 { margin: 0 0 8px; font-size: 1.02rem; }
.calib p { margin: 0 0 10px; color: var(--muted-strong); font-size: .94rem; }
.calib p:last-child { margin-bottom: 0; }

/* ---------------- Stage 2 gate ---------------- */

.gate {
  margin-top: 30px; background: var(--surface); border: 1px solid var(--accent);
  border-radius: var(--radius-lg); padding: 26px 20px 30px;
  box-shadow: 0 0 60px -20px rgba(45, 127, 249, .45);
}
@media (min-width: 700px) { .gate { padding: 32px 30px 36px; } }
.gate h2 { margin: 10px 0 8px; font-size: 1.3rem; letter-spacing: -.03em; }
.gate > p { color: var(--muted-strong); margin: 0; max-width: 56ch; }
.gate ul { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 9px; }
.gate li { padding-left: 26px; position: relative; color: var(--muted-strong); font-size: .94rem; }
.gate li::before { content: "\2713"; position: absolute; left: 0; color: var(--accent-strong); font-weight: 700; }

.gate form { margin-top: 22px; display: grid; gap: 14px; }
@media (min-width: 620px) { .gate .fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } }
.gate label { display: block; font-size: .84rem; color: var(--muted-strong); font-weight: 600; }
.gate input[type="text"], .gate input[type="email"] {
  width: 100%; margin-top: 6px; min-height: 48px; padding: 13px 15px;
  border-radius: 12px; font-family: inherit; font-size: 1rem; color: var(--text);
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line);
}
.gate input::placeholder { color: rgba(154, 166, 188, .7); }
.gate input[aria-invalid="true"] { border-color: var(--bad); }
/* The checkbox itself clears the 24px WCAG 2.2 (2.5.8) floor; the label is
   associated with `for` so the full row is also an activation target. */
.consent { display: flex; gap: 12px; align-items: flex-start; }
.consent input[type="checkbox"] { width: 24px; height: 24px; margin: 11px 0 0; flex: 0 0 auto; accent-color: var(--accent); }
.consent label { font-size: .9rem; line-height: 1.5; color: var(--muted-strong); font-weight: 400; padding: 10px 0; cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.field-error { color: var(--bad); font-size: .84rem; margin: 6px 0 0; min-height: 1.1em; }
.gate .fine { color: var(--muted); font-size: .8rem; margin: 4px 0 0; }
.gate .fine a { color: var(--accent-strong); }
.gate .status { margin: 4px 0 0; font-size: .92rem; min-height: 1.2em; }
.gate .status.err { color: var(--bad); }
.gate .status.ok { color: var(--good); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.sent { text-align: center; padding: 12px 0 4px; }
.sent .tick { font-size: 2.4rem; line-height: 1; color: var(--good); }
.sent h2 { margin: 12px 0 8px; }
.sent p { color: var(--muted-strong); max-width: 48ch; margin: 0 auto 10px; }

/* ---------------- footer ---------------- */

.foot-attrib { margin-top: 48px; color: var(--muted); font-size: .78rem; line-height: 1.6; text-align: center; }
.foot-attrib a { color: var(--accent-strong); text-decoration: none; }
.foot-legal {
  margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: .85rem; text-align: center;
}
.foot-legal a { color: var(--accent-strong); text-decoration: none; }

.noscript { border: 1px solid var(--warn); border-radius: 14px; padding: 16px 18px; color: var(--muted-strong); margin-top: 24px; }
.noscript a { color: var(--accent-strong); }

/* Visible only to assistive technology. */
.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: -9999px; top: 0; z-index: 10;
  background: var(--accent-strong); color: #0a1020; padding: 12px 18px;
  border-radius: 0 0 12px 0; font-weight: 700; text-decoration: none;
}
.skip-link:focus { left: 0; }

.actions { margin-top: 22px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
  .bar-fill, .score-dial .value, .opt, .btn { transition: none !important; }
  .btn:hover, .opt.picked { transform: none; }
}
