/* ============================================
   QUIZ — quiz.css
   Path finder quiz page styles
   ============================================ */

/* HERO */
.quiz-hero {
  position: relative;
  padding: 140px 0 80px;
  background: var(--navy);
  color: var(--white);
  overflow: hidden;
}
.quiz-hero__bg { position: absolute; inset: 0; pointer-events: none; }
.quiz-hero__inner { max-width: 760px; margin: 0 auto; text-align: center; }
.quiz-hero__inner h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); line-height: 1.1; margin: 16px 0 20px; }
.quiz-hero__inner h1 em { color: var(--blue); font-style: italic; }
.quiz-hero__inner p { font-size: 1.125rem; line-height: 1.6; opacity: 0.85; margin: 0 0 32px; }

/* QUIZ */
.quiz-section {
  padding: 80px 0;
  background: var(--navy);
  scroll-margin-top: calc(var(--header-height) + 24px);
}
.quiz { max-width: 680px; margin: 0 auto; }
.quiz__progress {
  margin-top: 20px;
  margin-bottom: 32px;
}
.quiz__progress-bar {
  height: 4px; background: rgba(255, 255, 255, 0.2); border-radius: 2px; overflow: hidden; position: relative;
}
.quiz__progress-bar::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: var(--progress, 0%); background: var(--blue);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.quiz__progress-label { margin-top: 12px; font-size: 0.875rem; color: rgba(255, 255, 255, 0.7); text-align: center; }

.quiz__card {
  background: var(--white); border-radius: 16px; padding: 48px 40px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
}
.quiz__question { font-size: 1.5rem; line-height: 1.4; font-weight: 600; margin: 0 0 28px; color: var(--navy); }
.quiz__answers { display: flex; flex-direction: column; gap: 12px; }
.quiz__answer {
  display: block; width: 100%; padding: 18px 24px; min-height: 44px;
  background: var(--off-white, #f7f7f5); border: 2px solid transparent; border-radius: 10px;
  font-family: inherit; font-size: 1rem; font-weight: 500; color: var(--navy);
  text-align: left; cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.1s;
}
.quiz__answer:hover { border-color: var(--blue); background: var(--white); }
.quiz__answer:active { transform: scale(0.99); }
.quiz__answer-key {
  display: inline-block; width: 28px; height: 28px; margin-right: 16px;
  background: var(--white); border-radius: 6px; text-align: center; line-height: 28px;
  font-size: 0.875rem; font-weight: 600; color: var(--text-muted);
  border: 1px solid var(--border, #e5e5e0);
}
.quiz__answer:hover .quiz__answer-key { border-color: var(--blue); color: var(--blue); }

.quiz__nav { margin-top: 24px; text-align: center; }
.quiz__back {
  background: transparent; border: none; color: var(--text-muted); cursor: pointer;
  font-family: inherit; font-size: 0.9rem; padding: 8px 12px;
}
.quiz__back:hover { color: var(--navy); }

/* RESULT */
.quiz-result {
  padding: 160px 0 80px;
  background: var(--navy);
  scroll-margin-top: calc(var(--header-height) + 24px);
}
.result { max-width: 780px; margin: 0 auto; }
.result__header { text-align: center; margin-bottom: 28px; padding-top: 0; }
.result__header h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); margin: 10px 0 14px; color: var(--white); }
.result__header p { font-size: 1.05rem; line-height: 1.55; color: rgba(255, 255, 255, 0.72); max-width: 620px; margin: 0 auto; }

/* LOCKED STATE */
.result__locked { position: relative; }
.result__gate {
  background: var(--white); border-radius: 16px; padding: 32px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  position: relative; z-index: 2;
}
.result__gate h3 { font-size: 1.5rem; margin: 0 0 8px; color: var(--navy); }
.result__gate > p { margin: 0 0 24px; color: var(--text-muted); }
.result__gate .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.result__gate label { display: block; }
.result__gate label span { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 6px; color: var(--navy); }
.result__gate input:not([type="hidden"]) {
  width: 100%; padding: 12px 14px; border: 1px solid #000; border-radius: 8px;
  background: var(--white); font-family: inherit; font-size: 1rem;
}
.result__gate input:not([type="hidden"]):focus { outline: none; border-color: #000; }
.result__gate .cf-turnstile { margin: 16px 0; }
.result__gate button { margin-top: 8px; width: 100%; }
.result__gate-privacy { font-size: 0.8rem; color: var(--text-muted); text-align: center; margin: 16px 0 0; }
.result__gate-error {
  margin-top: 16px; padding: 12px 16px; background: #fef2f2; color: #991b1b; border-radius: 8px; font-size: 0.9rem;
}

/* UNLOCKED STATE */
.result__unlocked { background: var(--white); border-radius: 16px; padding: 48px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06); }
.result__plan p { line-height: 1.7; color: var(--navy); }
.result__plan h3 {
  font-size: 1.25rem; font-weight: 700; color: var(--navy);
  margin: 32px 0 12px; padding-top: 24px; border-top: 1px solid var(--border, #e5e5e0);
}
.result__plan h3:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.result__plan .plan-phase-focus { font-weight: 500; color: var(--text-muted); margin-bottom: 12px; }
.result__plan ol { padding-left: 20px; }
.result__plan ol li { margin-bottom: 10px; line-height: 1.6; }
.result__product { margin: 48px 0; text-align: center; }
.result__product img { max-width: 100%; height: auto; border-radius: 12px; }
.result__ctas { display: flex; gap: 16px; justify-content: center; margin-top: 40px; flex-wrap: wrap; }
.btn--secondary {
  background: var(--white);
  color: var(--navy);
  border-color: var(--navy);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.btn--secondary:hover { background: var(--navy); color: var(--white); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16); }
.result__retake {
  display: block; margin: 24px auto 0; background: transparent; border: 1.5px solid var(--white);
  border-radius: 6px; padding: 10px 24px; color: var(--white); font-family: inherit;
  font-size: 0.875rem; font-weight: 500; cursor: pointer; letter-spacing: 0.01em;
  transition: border-color 0.2s, color 0.2s;
}
.result__retake:hover { border-color: var(--blue); color: var(--blue); }

/* MOBILE */
@media (max-width: 640px) {
  .quiz-hero { padding: 100px 0 60px; }
  .quiz-section, .quiz-result { padding: 48px 0; }
  .quiz-section.quiz-section--active,
  .quiz-result.quiz-result--active {
    padding-top: calc(var(--header-height) + 20px);
  }
  .quiz__progress {
    margin-top: 0;
    margin-bottom: 18px;
  }
  .quiz__card, .result__gate, .result__unlocked { padding: 28px 20px; }
  .result__gate .form-row { grid-template-columns: 1fr; }
  .quiz__question {
    font-size: 1.25rem;
    margin-bottom: 20px;
  }
  .quiz__answers { gap: 10px; }
  .quiz__answer { padding: 15px 16px; }
  .quiz__answer-key { margin-right: 12px; }
  .quiz__nav { margin-top: 18px; }
  .result__ctas { gap: 12px; }
  .result__ctas .btn,
  .result__retake { width: 100%; }
}

/* FOCUS VISIBLE */
.quiz__answer:focus-visible,
.result__gate input:focus-visible,
.result__gate button:focus-visible,
.result__ctas .btn:focus-visible,
.result__retake:focus-visible,
#quizStart:focus-visible {
  outline: 2px solid var(--blue-light);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(22, 119, 190, 0.28);
}

/* REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
  .quiz__progress-bar::after,
  .quiz__answer {
    transition: none;
  }
}
