/* ═══════════════════════════════════════════════════
   JAVIFINANCE — quiz.css
   Styles for the Financial Health Quiz page
   ═══════════════════════════════════════════════════ */

/* ── PAGE TITLE ICON ── */
.page-title__icon {
  display: inline-block;
  vertical-align: -0.2em;
  margin-left: 0.5rem;
  color: #8C7549;
}

/* ── WRAPPER ── */
.quiz-wrapper {
  max-width: 680px;
  margin: 0 auto 5rem;
  padding: 0 1.25rem;
}

/* ── PROGRESS BAR ── */
.quiz-progress {
  margin-bottom: 2rem;
}

.quiz-progress__track {
  height: 5px;
  background: var(--color-stone-200, #e5e0d8);
  border-radius: 99px;
  overflow: hidden;
}

.quiz-progress__fill {
  height: 100%;
  background: #8C7549;
  border-radius: 99px;
  transition: width 0.4s cubic-bezier(.4,0,.2,1);
}

.quiz-progress__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: #888;
  font-family: 'Montserrat', sans-serif;
  letter-spacing: 0.03em;
}

.quiz-progress__topic {
  font-weight: 600;
  color: #8C7549;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

/* ── QUESTION CARD ── */
.quiz-card {
  animation: quiz-fade-in 0.28s ease both;
}

@keyframes quiz-fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.quiz-card--exit {
  animation: quiz-fade-out 0.18s ease both;
}

@keyframes quiz-fade-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-8px); }
}

.quiz-question {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(1.15rem, 3vw, 1.4rem);
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.4;
  margin-bottom: 1.75rem;
}

/* ── OPTIONS GRID ── */
.quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem;
}

@media (max-width: 540px) {
  .quiz-options {
    grid-template-columns: 1fr;
  }
}

.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 1rem 1.1rem;
  background: #fff;
  border: 1.5px solid #e5e0d8;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.1s;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  color: #2a2a2a;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}

.quiz-option:hover {
  border-color: #8C7549;
  background: #faf8f4;
  box-shadow: 0 2px 12px rgba(140,117,73,0.1);
}

.quiz-option:active {
  transform: scale(0.98);
}

.quiz-option--selected {
  border-color: #8C7549;
  background: #f5f0e8;
  box-shadow: 0 2px 16px rgba(140,117,73,0.15);
}

.quiz-option__letter {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #f0ebe0;
  color: #8C7549;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.quiz-option--selected .quiz-option__letter {
  background: #8C7549;
  color: #fff;
}

/* ── BACK BUTTON ── */
.quiz-nav {
  margin-top: 1.75rem;
}

.quiz-btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: #888;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem 0;
  transition: color 0.15s;
  letter-spacing: 0.02em;
}

.quiz-btn-back:hover {
  color: #8C7549;
}

.quiz-btn-back svg {
  transition: transform 0.15s;
}

.quiz-btn-back:hover svg {
  transform: translateX(-3px);
}

/* ── EMAIL GATE ── */
.quiz-email-gate {
  animation: quiz-fade-in 0.3s ease both;
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: #fff;
  border: 1.5px solid #e5e0d8;
  border-radius: 16px;
}

.quiz-email-gate__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: #f5f0e8;
  color: #8C7549;
}

.quiz-email-gate__title {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 0.5rem;
}

.quiz-email-gate__subtitle {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 1.75rem;
  line-height: 1.5;
}

.quiz-email-gate__form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 360px;
  margin: 0 auto;
}

.quiz-email-gate__input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1.5px solid #ddd;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: #1a1a1a;
  background: #fafafa;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  box-sizing: border-box;
}

.quiz-email-gate__input:focus {
  border-color: #8C7549;
  box-shadow: 0 0 0 3px rgba(140,117,73,0.12);
  background: #fff;
}

.quiz-email-gate__input.is-invalid {
  border-color: #c0392b;
}

.quiz-email-gate__btn {
  width: 100%;
  padding: 0.9rem 1.5rem;
  background: #8C7549;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: background 0.15s, transform 0.1s;
}

.quiz-email-gate__btn:hover {
  background: #7A6040;
}

.quiz-email-gate__btn:active {
  transform: scale(0.98);
}

.quiz-email-gate__btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.quiz-email-gate__error {
  color: #c0392b;
  font-size: 0.82rem;
  text-align: left;
  min-height: 1.2em;
}

.quiz-email-gate__privacy {
  font-size: 0.75rem;
  color: #aaa;
  margin-top: 0.5rem;
  line-height: 1.4;
}

.quiz-email-gate__back {
  margin-top: 1.25rem;
}

/* ── RESULTS ── */
.quiz-results {
  animation: quiz-fade-in 0.4s ease both;
}

/* Score header */
.quiz-results__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2.5rem 1.5rem 2rem;
  background: #fff;
  border: 1.5px solid #e5e0d8;
  border-radius: 16px;
  margin-bottom: 1.25rem;
}

.quiz-score-ring {
  position: relative;
  width: 140px;
  height: 140px;
  margin-bottom: 1.25rem;
}

.quiz-score-ring svg {
  transform: rotate(-90deg);
}

.quiz-score-ring__track {
  fill: none;
  stroke: #f0ebe0;
  stroke-width: 10;
}

.quiz-score-ring__fill {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s cubic-bezier(.4,0,.2,1), stroke 0.4s;
}

.quiz-score-ring__label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
}

.quiz-score-ring__number {
  font-family: 'Montserrat', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
  color: #1a1a1a;
}

.quiz-score-ring__max {
  font-size: 0.7rem;
  color: #aaa;
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
}

.quiz-results__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.875rem;
  border-radius: 99px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.875rem;
}

.quiz-results__badge-dot {
  flex-shrink: 0;
}

.quiz-results__badge--low {
  background: #fdecea;
  color: #c0392b;
}

.quiz-results__badge--mid {
  background: #fff8e1;
  color: #b07d00;
}

.quiz-results__badge--high {
  background: #e8f5e9;
  color: #2e7d32;
}

.quiz-results__title {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(1.15rem, 3vw, 1.4rem);
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 0.5rem;
}

.quiz-results__desc {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.6;
  max-width: 480px;
}

/* Topic breakdown */
.quiz-breakdown {
  background: #fff;
  border: 1.5px solid #e5e0d8;
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.quiz-breakdown__title {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  margin-bottom: 1.25rem;
}

.quiz-breakdown__item {
  margin-bottom: 1rem;
}

.quiz-breakdown__item:last-child {
  margin-bottom: 0;
}

.quiz-breakdown__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.quiz-breakdown__label {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: #2a2a2a;
}

.quiz-breakdown__pct {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: #8C7549;
}

.quiz-breakdown__bar-track {
  height: 6px;
  background: #f0ebe0;
  border-radius: 99px;
  overflow: hidden;
}

.quiz-breakdown__bar-fill {
  height: 100%;
  border-radius: 99px;
  background: #8C7549;
  width: 0%;
  transition: width 1s cubic-bezier(.4,0,.2,1);
}

/* CTA card */
.quiz-cta-card {
  background: #1a1a1a;
  color: #fff;
  border-radius: 16px;
  padding: 2rem 1.75rem;
  text-align: center;
}

.quiz-cta-card__eyebrow {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8C7549;
  margin-bottom: 0.75rem;
}

.quiz-cta-card__title {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.35;
}

.quiz-cta-card__desc {
  font-size: 0.9rem;
  color: #ccc;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.quiz-cta-card__btn {
  display: inline-block;
  padding: 0.875rem 2rem;
  background: #8C7549;
  color: #fff;
  border-radius: 10px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}

.quiz-cta-card__btn:hover {
  background: #7A6040;
  transform: translateY(-1px);
}

.quiz-cta-card__sub {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: #888;
}

.quiz-results__restart {
  display: block;
  text-align: center;
  margin-top: 1.5rem;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: #aaa;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0.5rem;
  transition: color 0.15s;
}

.quiz-results__restart:hover {
  color: #8C7549;
}
