/* ---------------------------------------------------------------------------
   Analytica Academy — quiz page styles
   Loaded only by quiz.html, on top of style.css. Reuses the site's tokens
   (--accent, --primary, --muted, --radius…) so nothing is redefined here.
--------------------------------------------------------------------------- */

.quiz-main { padding: 8rem 0 5rem; min-height: 70vh; }
.quiz-container { max-width: 760px; }

/* This page's nav is logo + one back link, with no hamburger. Keep the wordmark
   on one line so it doesn't wrap on narrow phones. */
.nav .logo { white-space: nowrap; }

/* Screens: only one is visible at a time. */
.quiz-screen { display: none; }
.quiz-screen.is-active { display: block; animation: quizIn 0.3s ease both; }
@keyframes quizIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.quiz-main .section-head { margin-bottom: 2.5rem; max-width: 100%; }
.quiz-main h1 { font-size: clamp(2rem, 5vw, 2.75rem); line-height: 1.15; }

.quiz-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; margin-top: 2rem; }
.quiz-actions .btn[hidden] { display: none; }
.quiz-note { text-align: center; font-size: 0.82rem; color: var(--muted-foreground); margin-top: 1.25rem; }
.quiz-note kbd {
  font-family: inherit; font-size: 0.78rem; background: var(--muted);
  border: 1px solid var(--border); border-radius: 4px; padding: 0.05rem 0.35rem;
}
@media (max-width: 700px) { .quiz-hint { display: none; } }

/* ---- Topic picker ---- */
.quiz-topic-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem;
  margin-top: 2.5rem;
}
.quiz-topic-card {
  text-align: left; font: inherit; cursor: pointer;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; display: flex; flex-direction: column; gap: 0.5rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.quiz-topic-card:hover { border-color: var(--accent); box-shadow: var(--shadow-glow); }
.quiz-topic-card h3 { font-size: 1.05rem; }
.quiz-topic-card p { font-size: 0.88rem; color: var(--muted-foreground); line-height: 1.5; flex-grow: 1; }
.quiz-topic-count { font-size: 0.78rem; color: var(--accent); font-weight: 600; }

/* ---- Question screen ---- */
.quiz-head { margin-bottom: 2rem; }
.quiz-head-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.quiz-round-label { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.quiz-counter { font-size: 0.82rem; color: var(--muted-foreground); }
.quiz-progress { height: 4px; background: var(--muted); border-radius: 999px; overflow: hidden; }
.quiz-progress-bar {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  transition: width 0.3s ease;
}

.quiz-question { font-size: clamp(1.15rem, 2.6vw, 1.4rem); line-height: 1.4; margin-bottom: 1.75rem; }

.quiz-options { display: grid; gap: 0.75rem; }
.quiz-option {
  display: flex; align-items: flex-start; gap: 0.85rem; width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.15rem; font: inherit; font-size: 0.95rem; color: var(--foreground);
  cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.quiz-option:hover:not(:disabled) { border-color: var(--accent); box-shadow: var(--shadow-glow); }
.quiz-option:disabled { cursor: default; }
.quiz-option .key {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 6px; background: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: var(--muted-foreground); margin-top: 0.1rem;
}

/* Answered states. Colour is never the only signal — the key box also changes
   to a tick or a cross, so this still reads without colour vision. */
.quiz-option.is-correct { border-color: #1f8a72; background: rgba(41,163,153,0.08); }
.quiz-option.is-correct .key { background: #1f8a72; color: #fff; }
.quiz-option.is-wrong { border-color: #b4442f; background: rgba(180,68,47,0.07); }
.quiz-option.is-wrong .key { background: #b4442f; color: #fff; }
.quiz-option.is-dimmed { opacity: 0.5; }

.quiz-feedback {
  margin-top: 1.5rem; padding: 1.25rem 1.35rem;
  background: var(--muted); border-radius: var(--radius); border-left: 3px solid var(--accent);
}
.quiz-verdict { font-weight: 700; margin-bottom: 0.4rem; font-size: 0.95rem; }
.quiz-verdict.ok { color: #1f8a72; }
.quiz-verdict.no { color: #b4442f; }
.quiz-why { font-size: 0.92rem; color: var(--muted-foreground); line-height: 1.6; }

/* ---- Final result ---- */
.quiz-final-score { text-align: center; margin-bottom: 3rem; }
.quiz-final-score b {
  display: block; font-size: 4.5rem; line-height: 1; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.quiz-final-score span { font-size: 0.95rem; color: var(--muted-foreground); }

.quiz-cta { text-align: center; margin-top: 3rem; padding-top: 2.5rem; border-top: 1px solid var(--border); }
.quiz-cta p { color: var(--muted-foreground); font-size: 0.95rem; max-width: 520px; margin: 0 auto 1.5rem; }
.quiz-cta .btn { margin: 0 0.35rem 0.5rem; }

/* ---- Footer ---- */
.quiz-footer { border-top: 1px solid var(--border); padding: 2rem 0; text-align: center; }
.quiz-footer p { font-size: 0.85rem; color: var(--muted-foreground); }
.quiz-footer a { color: var(--accent); font-weight: 600; }
