/* ============================================================
   /crossing-readiness-score/start — Quiz interface styles
   Inherits site-wide tokens, fonts, header structure from
   /briefings/_assets/briefing.css and Tailwind config.
   This file contains ONLY quiz-page-specific styles.
   ============================================================ */

/* ---- Body adjustments for quiz pages ---- */
.quiz-body {
  background: var(--bone, #FAF7F2);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.quiz-body main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   HEADER — minimal version for quiz pages
   ============================================================ */

.quiz-header {
  padding: 24px 0;
  border-bottom: 1px solid var(--soft-divider, #E5E1D5);
}

/* Wordmark in quiz header — explicit colours to match site */
.quiz-header .wm-north {
  color: var(--ink, #15171B);
}

.quiz-header .wm-arc {
  color: var(--arc, #5B6CF2);
}

.quiz-header .wm-dot {
  color: var(--arc, #5B6CF2);
}

.quiz-exit-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: rgba(21,23,27,0.55);
  text-transform: uppercase;
  text-decoration: none;
  transition: color 150ms ease;
}
.quiz-exit-link:hover {
  color: var(--arc, #5B6CF2);
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */

.quiz-progress-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px 0;
  width: 100%;
}
@media (min-width: 1024px) {
  .quiz-progress-wrap { padding: 32px 40px 0; }
}

.quiz-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}

.quiz-progress-label,
.quiz-progress-stage {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.quiz-progress-label {
  color: rgba(21,23,27,0.6);
}

.quiz-progress-stage {
  color: var(--arc, #5B6CF2);
}

.quiz-progress-track {
  width: 100%;
  height: 3px;
  background: rgba(21,23,27,0.08);
  border-radius: 2px;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: var(--arc, #5B6CF2);
  border-radius: 2px;
  transition: width 300ms ease;
}

/* ============================================================
   QUIZ CONTAINER + SCREEN VISIBILITY
   ============================================================ */

.quiz-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
  padding: 64px 24px 32px;
}

/* All screens hidden by default; only is-active shows */
.quiz-screen {
  display: none;
}

.quiz-screen.is-active {
  display: block;
  animation: quizFadeIn 280ms ease;
}

@keyframes quizFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.quiz-screen__inner {
  width: 100%;
}

/* ============================================================
   INTRO SCREEN
   ============================================================ */

.quiz-eyebrow {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--arc, #5B6CF2);
  text-transform: uppercase;
  margin: 0 0 28px;
}

.quiz-intro__title {
  font-family: 'Geist', ui-sans-serif, system-ui, sans-serif;
  font-size: 56px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--ink, #15171B);
  margin: 0 0 32px;
}

.crs-arc-dot { color: var(--arc, #5B6CF2); }

.quiz-intro__body {
  font-family: 'Geist', ui-sans-serif, system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color: rgba(21,23,27,0.78);
  margin: 0 0 48px;
}

.quiz-intro__body p {
  margin: 0 0 20px;
}
.quiz-intro__body p:last-child {
  margin-bottom: 0;
}

/* ============================================================
   QUESTION SCREENS
   ============================================================ */

.quiz-q__title {
  font-family: 'Geist', ui-sans-serif, system-ui, sans-serif;
  font-size: 36px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink, #15171B);
  margin: 0 0 16px;
}

.quiz-q__helper {
  font-family: 'Geist', ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: rgba(21,23,27,0.6);
  margin: 0 0 40px;
}

/* ============================================================
   OPTIONS — radio and checkbox
   ============================================================ */

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
}

.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  background: #ffffff;
  border: 1px solid #E5E1D5;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
  position: relative;
}

.quiz-option:hover {
  border-color: rgba(91,108,242,0.5);
  background: #FDFCF9;
  transform: translateY(-1px);
}

.quiz-option input[type="radio"],
.quiz-option input[type="checkbox"] {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  cursor: pointer;
  accent-color: var(--arc, #5B6CF2);
}

.quiz-option__label {
  font-family: 'Geist', ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink, #15171B);
  font-weight: 400;
}

/* Selected state */
.quiz-option:has(input:checked) {
  border-color: var(--arc, #5B6CF2);
  background: rgba(91,108,242,0.04);
}

.quiz-option:has(input:checked) .quiz-option__label {
  font-weight: 500;
}

/* Focus state for keyboard navigation */
.quiz-option:focus-within {
  outline: none;
  box-shadow: 0 0 0 3px rgba(91,108,242,0.18);
  border-color: var(--arc, #5B6CF2);
}

/* ============================================================
   BUTTONS
   ============================================================ */

.quiz-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ink, #15171B);
  color: #ffffff;
  font: 500 15px/1 'Geist', ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.01em;
  padding: 16px 28px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background 150ms ease, transform 150ms ease, opacity 150ms ease;
}

.quiz-btn-primary:hover:not(:disabled) {
  background: var(--arc, #5B6CF2);
  transform: translateY(-1px);
}

.quiz-btn-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.quiz-btn-primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(91,108,242,0.4);
}

.quiz-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--ink, #15171B);
  font: 500 15px/1 'Geist', ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.01em;
  padding: 16px 24px;
  border: 1px solid #E5E1D5;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 150ms ease, background 150ms ease;
}

.quiz-btn-secondary:hover:not(:disabled) {
  border-color: var(--ink, #15171B);
  background: rgba(21,23,27,0.02);
}

.quiz-btn-secondary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.quiz-btn-secondary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(91,108,242,0.4);
}

/* Loading state for primary button */
.quiz-btn-primary[aria-busy="true"] .btn-label { display: none; }
.quiz-btn-primary[aria-busy="true"] .btn-loading { display: inline-flex; align-items: center; gap: 8px; }
.quiz-btn-primary .btn-loading { display: none; }
.quiz-btn-primary .btn-loading::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: quizSpin 0.7s linear infinite;
}
@keyframes quizSpin { to { transform: rotate(360deg); } }

/* ============================================================
   NAVIGATION FOOTER
   ============================================================ */

.quiz-nav {
  border-top: 1px solid var(--soft-divider, #E5E1D5);
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

/* Hide nav on intro and success screens (handled by JS) */
.quiz-nav.is-hidden {
  display: none;
}

/* ============================================================
   LEAD CAPTURE FORM
   ============================================================ */

.lead-form {
  margin: 0;
}

.lead-field {
  margin-bottom: 24px;
}

.lead-field label {
  display: block;
  font: 500 14px/1.4 'Geist', ui-sans-serif, system-ui, sans-serif;
  color: var(--ink, #15171B);
  margin-bottom: 8px;
}

.lead-field .req {
  color: #DC2626;
  margin-left: 2px;
}

.lead-field input[type="text"],
.lead-field input[type="email"] {
  width: 100%;
  background: #ffffff;
  border: 1px solid #E5E1D5;
  border-radius: 8px;
  padding: 14px 16px;
  font: 400 16px/1.4 'Geist', ui-sans-serif, system-ui, sans-serif;
  color: var(--ink, #15171B);
  transition: border-color 150ms ease, box-shadow 150ms ease;
  box-sizing: border-box;
}

.lead-field input:focus-visible {
  outline: none;
  border-color: var(--arc, #5B6CF2);
  box-shadow: 0 0 0 3px rgba(91,108,242,0.18);
}

.lead-field.has-error input {
  border-color: #DC2626;
}
.lead-field.has-error input:focus-visible {
  box-shadow: 0 0 0 3px rgba(220,38,38,0.15);
}

/* Consent checkbox */
.lead-consent {
  margin: 24px 0 32px;
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.consent-row input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  cursor: pointer;
  accent-color: var(--arc, #5B6CF2);
}

.consent-row span {
  font-family: 'Geist', ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(21,23,27,0.72);
}

/* Honeypot field — hidden visually and to keyboard */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Form-level error */
.lead-form-error {
  font-family: 'Geist', ui-sans-serif, system-ui, sans-serif;
  color: #DC2626;
  font-size: 14px;
  line-height: 1.5;
  padding: 12px 16px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 8px;
  margin: 0 0 20px;
}

.lead-privacy-note {
  font-family: 'Geist', ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(21,23,27,0.55);
  margin: 16px 0 0;
}

.lead-privacy-note a {
  color: var(--arc, #5B6CF2);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.lead-privacy-note a:hover {
  text-decoration-thickness: 2px;
}

/* ============================================================
   SUCCESS SCREEN
   ============================================================ */

.success-body {
  font-family: 'Geist', ui-sans-serif, system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color: rgba(21,23,27,0.78);
  margin: 0 0 48px;
}

.success-body p {
  margin: 0 0 20px;
}
.success-body p:last-child {
  margin-bottom: 0;
}

.success-body strong {
  color: var(--ink, #15171B);
  font-weight: 500;
}

/* ============================================================
   MINIMAL QUIZ FOOTER
   ============================================================ */

.quiz-footer {
  margin-top: 64px;
  padding: 24px 0;
  border-top: 1px solid var(--soft-divider, #E5E1D5);
}

.quiz-footer__inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
}

.quiz-footer__text {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: rgba(21,23,27,0.5);
  text-transform: uppercase;
  margin: 0;
}

.quiz-footer__text a {
  color: rgba(21,23,27,0.7);
  text-decoration: none;
  transition: color 150ms ease;
}

.quiz-footer__text a:hover {
  color: var(--arc, #5B6CF2);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 767px) {
  .quiz-container {
    padding: 40px 20px 24px;
  }

  .quiz-progress-wrap {
    padding: 24px 20px 0;
  }

  .quiz-intro__title {
    font-size: 40px;
  }

  .quiz-q__title {
    font-size: 26px;
  }

  .quiz-q__helper {
    font-size: 15px;
    margin-bottom: 32px;
  }

  .quiz-option {
    padding: 14px 16px;
  }

  .quiz-option__label {
    font-size: 15px;
  }

  .quiz-nav {
    padding: 16px 20px;
  }

  .quiz-btn-primary,
  .quiz-btn-secondary {
    padding: 14px 20px;
    font-size: 14px;
  }

  /* Keep input font ≥16px to avoid iOS auto-zoom */
  .lead-field input[type="text"],
  .lead-field input[type="email"] {
    font-size: 16px;
  }

  .quiz-footer {
    margin-top: 48px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .quiz-screen.is-active {
    animation: none;
  }
  .quiz-progress-fill {
    transition: none;
  }
  .quiz-option,
  .quiz-btn-primary,
  .quiz-btn-secondary,
  .lead-field input {
    transition: none;
  }
  .quiz-btn-primary:hover {
    transform: none;
  }
  .quiz-option:hover {
    transform: none;
  }
  .quiz-btn-primary .btn-loading::before {
    animation: none;
  }
}