/* SuccessPath quiz + results dashboard — v3
 * Calm test-taking UI; minimalist, accessible data visualization. */

.quiz-shell { max-width: 40rem; margin: 0 auto; padding: var(--s10) var(--s6) var(--s16); }

/* ---------- Progress ---------- */
.progress {
  height: 0.5rem;
  background: var(--line-soft);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: var(--s2);
}
.progress > div {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-deep));
  border-radius: var(--radius-pill);
  transition: width 0.3s var(--ease);
}
.progress-meta {
  display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; row-gap: var(--s1);
  font-size: var(--text-sm); color: var(--muted);
  margin-bottom: var(--s8);
}
.progress-meta .tnum { font-weight: 700; color: var(--ink-soft); }

/* ---------- Question ---------- */
.quiz-intro { text-align: center; margin-bottom: var(--s8); }
.quiz-intro h1 { font-size: var(--text-2xl); margin-bottom: var(--s2); }

.q-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: var(--s10) var(--s8);
}
.q-kicker {
  font-family: var(--font-mono);
  font-size: var(--text-xs); font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  text-wrap: balance;
  color: var(--faint);
  margin-bottom: var(--s3);
}
.q-text {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: var(--leading-snug);
  margin: 0 0 var(--s8);
  text-wrap: balance;
}
.q-nav { display: flex; justify-content: flex-start; margin-top: var(--s8); }

/* Likert as an accessible radiogroup */
.likert { display: grid; gap: var(--s2); }
.likert .scale-hint {
  display: flex; justify-content: space-between;
  font-size: var(--text-xs); color: var(--faint); font-weight: 600;
  padding: 0 var(--s1); margin-bottom: var(--s1);
}
.likert [role="radio"] {
  appearance: none;
  display: flex; align-items: center; gap: var(--s4);
  min-height: 3.5rem;
  border: 1.5px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: var(--s3) var(--s4);
  font-family: var(--font); font-size: var(--text-base); font-weight: 600;
  color: var(--ink); cursor: pointer; text-align: left;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.likert [role="radio"]::before {
  content: "";
  flex: none;
  width: 1.25rem; height: 1.25rem;
  border-radius: 50%;
  border: 2px solid var(--line);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}
.likert [role="radio"]:hover { border-color: var(--brand); background: #fafcff; }
.likert [role="radio"]:hover::before { border-color: var(--brand); }
.likert [role="radio"][aria-checked="true"] {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px var(--brand);
}
.likert [role="radio"][aria-checked="true"]::before {
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: inset 0 0 0 3.5px #fff;
}

/* Carry-over notice */
.carry-note {
  display: inline-flex; align-items: center; gap: var(--s2);
  background: var(--brand-soft);
  border: 1px solid #c9d6f2;
  color: var(--brand-deep);
  border-radius: var(--radius-pill);
  padding: var(--s2) var(--s4);
  font-size: var(--text-sm); font-weight: 600;
  text-wrap: balance; text-align: center;
  margin: 0 0 var(--s4);
}
.carry-note .icon { width: 1rem; height: 1rem; }

/* ================= Results dashboard ================= */
.results-hero { text-align: center; padding: var(--s16) 0 var(--s10); }
.results-hero .eyebrow { margin-bottom: var(--s4); }
.results-hero h1 { margin-bottom: var(--s3); }
.results-hero .lead { max-width: 38rem; margin: 0 auto; }

/* Dimension panels */
.dim-panels { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); margin: var(--s10) 0; }
@media (max-width: 760px) { .dim-panels { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .results-hero { padding: var(--s12) 0 var(--s10); } }
.dim-panel { display: flex; flex-direction: column; }
.dim-panel-head { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s2); }
.dim-panel-head .icon { width: 1.4rem; height: 1.4rem; }
.dim-panel-head h3 { margin: 0; font-size: var(--text-lg); }
.dim-panel[data-dim="wiring"] .dim-panel-head .icon { color: var(--dim-wiring); }
.dim-panel[data-dim="interests"] .dim-panel-head .icon { color: var(--dim-interests); }
.dim-panel[data-dim="values"] .dim-panel-head .icon { color: var(--dim-values); }
.dim-panel[data-dim="needs"] .dim-panel-head .icon { color: var(--dim-needs); }
.dim-kicker {
  font-family: var(--font-mono);
  font-size: var(--text-xs); font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  text-wrap: balance;
  color: var(--faint); margin-bottom: var(--s1);
}
.dim-panel > p { color: var(--ink-soft); font-size: var(--text-base); }

/* Score bars — minimalist data viz with reference anchors */
.scorebars { display: grid; gap: var(--s3); margin-top: var(--s5); }
.scorebar-row { display: grid; gap: var(--s1); }
.scorebar-label { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); font-size: var(--text-sm); }
.scorebar-label .name { font-weight: 600; color: var(--ink-soft); min-width: 0; overflow-wrap: break-word; }
.scorebar-label .val { font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; flex: none; }
.scorebar-track {
  position: relative;
  height: 0.75rem;
  background: var(--line-soft);
  border-radius: var(--radius-pill);
}
.scorebar-typical {
  position: absolute; top: 0; bottom: 0;
  left: 35%; width: 30%;
  background: rgba(19, 28, 46, 0.08);
  border-radius: var(--radius-pill);
}
.scorebar-fill {
  position: absolute; top: 0; bottom: 0; left: 0;
  border-radius: var(--radius-pill);
  width: 0;
  background: var(--brand); /* default fill; dim panels override below */
  transition: width 0.9s var(--ease);
}
.dim-panel[data-dim="wiring"] .scorebar-fill { background: var(--dim-wiring); }
.dim-panel[data-dim="interests"] .scorebar-fill { background: var(--dim-interests); }
.dim-panel[data-dim="values"] .scorebar-fill { background: var(--dim-values); }
.dim-panel[data-dim="needs"] .scorebar-fill { background: var(--dim-needs); }
.scorebar-scale {
  display: flex; justify-content: space-between;
  font-size: var(--text-xs); color: var(--faint);
  font-variant-numeric: tabular-nums;
  margin-top: calc(var(--s1) * -1);
}
.scorebar-note { font-size: var(--text-xs); color: var(--faint); margin-top: var(--s3); }

/* Archetype banner */
.archetype-banner {
  background:
    radial-gradient(36rem 18rem at 50% -8rem, rgba(29, 78, 216, 0.5), transparent 70%),
    linear-gradient(180deg, #0b1730, var(--brand-ink));
  color: #fff;
  border-radius: var(--radius-xl);
  padding: var(--s12) var(--s8);
  margin: var(--s12) 0;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.archetype-banner .eyebrow { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.16); color: #dbe6ff; }
.archetype-banner h2 { color: #fff; margin-bottom: var(--s3); }
/* Locked overlay on the dark banner: keep overlay text light (issue #5). */
.archetype-banner .locked-overlay { color: #dbe6ff; }
.archetype-banner .locked-overlay .small { color: #a9bddb; }
.archetype-banner .locked-overlay .icon { color: #a9bddb; }
.archetype-banner .arch-blurb {
  font-size: var(--text-lg); line-height: var(--leading-snug);
  color: #dbe4f2; max-width: 40rem; margin: 0 auto var(--s6);
}
.arch-meta {
  display: flex; flex-wrap: wrap; gap: var(--s2); justify-content: center;
  margin-bottom: var(--s6);
}
.archetype-banner .arch-meta .chip { background: rgba(255,255,255,0.1); color: #fff; }
/* Dark treatment is banner-only (results pages): on the light report page
   the base .chip (brand-soft bg, brand-deep text) applies instead. The
   unscoped rule used to paint the report's chips white-on-white. */
.arch-watch {
  max-width: 40rem; margin: 0 auto;
  border-radius: var(--radius);
  padding: var(--s5) var(--s6);
  font-size: var(--text-base); text-align: left;
}
.archetype-banner .arch-watch {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: #c7d4ea;
}
.archetype-banner .arch-watch strong { color: #f0b45a; }
/* Light treatment on the report page: same box, readable on white. The
   unscoped rule used to paint the report's watch-outs pale blue on white. */
.report-page .arch-watch {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  color: var(--ink-soft);
}
.report-page .arch-watch strong { color: var(--ink); }
/* Left-align the report's archetype chips with the prose (the banner's
   centered layout belongs to the dark results banner, not the report). */
.report-page .arch-meta { justify-content: flex-start; }

/* Sample-results banner (demo mode) */
.demo-banner {
  background: var(--brand-soft);
  border: 1px solid #c9d6f2;
  color: var(--brand-deep);
  border-radius: var(--radius-lg);
  padding: var(--s4) var(--s6);
  font-weight: 600; text-align: center;
  text-wrap: balance;
  margin-bottom: var(--s6);
}

/* Sample detailed report (demo mode) — one page per dimension */
.report-cover { text-align: center; padding: var(--s10) 0 var(--s6); }
.report-cover h1 { margin-bottom: var(--s4); }
.report-cover .lead { max-width: 40rem; margin: 0 auto; }

/* Download PDF row on the rendered report (issue #14). Hidden in print. */
.report-actions { text-align: center; margin: var(--s6) 0 var(--s2); }
.report-actions .small { margin-top: var(--s2); }
.radar-wrap { max-width: 24rem; margin: var(--s8) auto 0; }
.radar-wrap svg { width: 100%; height: auto; display: block; }
.report-page { padding: var(--s12) 0; border-top: 1px solid var(--line-soft); }
.report-page .prose { max-width: 40rem; }
.report-page .prose p { color: var(--ink-soft); margin-bottom: var(--s4); }
.report-page .prose p strong { color: var(--ink); }
.report-page .scorebars { max-width: 40rem; }
.takeaway {
  display: flex; gap: var(--s4); align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-lg);
  padding: var(--s6);
  margin: var(--s8) 0 0;
  max-width: 40rem;
}
.takeaway .icon { flex: none; width: 1.5rem; height: 1.5rem; color: var(--brand); margin-top: 2px; }
.takeaway p { margin: 0; color: var(--ink-soft); }
.takeaway strong { color: var(--ink); }

/* Insight callout */
.insight {
  display: flex; gap: var(--s4); align-items: flex-start;
  background: var(--brand-soft);
  border: 1px solid #c9d6f2;
  border-radius: var(--radius-lg);
  padding: var(--s6);
  margin: var(--s8) 0;
}
.insight .icon { flex: none; width: 1.6rem; height: 1.6rem; color: var(--brand-deep); margin-top: 2px; }
.insight p { margin: 0; color: var(--ink-soft); }
.insight strong { color: var(--ink); }

/* Offers */
.offer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); margin: var(--s10) 0; }
@media (max-width: 760px) { .offer-grid { grid-template-columns: 1fr; } }
.offer-card { display: flex; flex-direction: column; }
.offer-card .btn { margin-top: auto; }
.offer-card > p { color: var(--ink-soft); }

@media (max-width: 560px) {
  .q-card { padding: var(--s8) var(--s5); }
  .q-text { font-size: var(--text-lg); }
  .archetype-banner { padding: var(--s10) var(--s5); }
}

/* ================= Print → PDF (issue #14) =================
   The "Download PDF" button calls window.print(): the PDF is the browser's
   print-to-PDF of this exact report page — same DOM, same payload — so the
   PDF's content matches the web report by construction. This block makes
   that print faithful: hide the site chrome and every button (nothing
   clickable in a PDF), freeze the entrance animations (they start at
   opacity 0 — a print caught mid-animation would come out blank), keep the
   score bars coloured, and keep atomic blocks from splitting across pages.
   Light tint backgrounds are kept with print-color-adjust so the PDF looks
   like the report even when the browser's "background graphics" is off.
   (@page lives at top level, not inside @media: nested @page is invalid
   CSS and browsers drop it.) */
@page { size: A4; margin: 16mm; }
@media print {
  /* Site chrome and anything interactive: gone from the PDF. */
  .nav, .footer, .nav-toggle, .btn, .report-actions, .report-back, .program-interest { display: none !important; }

  /* Entrance animations start at opacity 0 — freeze them at the end state. */
  .rise, .rise-1, .rise-2, .rise-3 { animation: none !important; opacity: 1 !important; transform: none !important; }
  .scorebar-fill { transition: none !important; }

  /* Keep the report's colours: bars, tracks, chips, callout tints. */
  .scorebar-fill, .scorebar-track, .scorebar-typical,
  .step-num, .chip, .demo-banner, .takeaway, .insight, .placeholder-notice,
  .report-page .arch-watch, .eyebrow {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  /* Page flow: tight top padding, no orphaned headings, atomic blocks
     never split across a page break. Sections flow continuously — no
     forced page-per-section, so short sections don't strand blank pages. */
  .section { padding: var(--s4) 0 !important; }
  .report-cover { padding-top: 0; }
  .report-page { padding: var(--s6) 0; }
  body { background: #fff; }
  h2, h3, .dim-kicker { break-after: avoid; }
  p { orphans: 3; widows: 3; }
  .card, .step, .takeaway, .scorebar-row, .arch-watch, .program-pick,
  .insight, .demo-banner, .placeholder-notice { break-inside: avoid; }
}
