/* ── Quiz page styles ──────────────────────────────────────────────── */
/* Matches DSEBench landing page design tokens from theme.css         */

:root {
  --bg: #F4EFE6;
  --surface: #FFFFFF;
  --fg: #18181B;
  --fg-muted: #71717A;
  --accent: #1E3A5F;
  --accent-light: #E8F0F9;
  --highlight: #D97706;
  --highlight-light: #FEF3C7;
  --bio-color: #059669;
  --bio-light: #D1FAE5;
  --bio-dark: #065F46;
  --border: #E5E2DC;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── Nav ─────────────────────────────────────────────────────────── */
.q-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: var(--surface);
  border-bottom: 1.5px solid var(--border);
}

.q-nav-brand {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 18px;
  color: var(--accent);
  letter-spacing: -0.5px;
  text-decoration: none;
}

.q-nav-sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-muted);
  background: var(--accent-light);
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

/* ── Topic Selector ───────────────────────────────────────────────── */
.topic-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 70px);
  padding: 24px;
}

.selector-inner {
  background: var(--surface);
  border-radius: 24px;
  padding: 36px 28px;
  max-width: 600px;
  width: 100%;
  border: 1.5px solid var(--border);
  box-shadow: 0 4px 24px rgba(0,0,0,0.05);
}

.selector-badge {
  display: inline-block;
  background: var(--bio-light);
  color: var(--bio-color);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 16px;
}

.selector-title {
  font-family: 'Syne', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.selector-desc {
  font-size: 15px;
  color: var(--fg-muted);
  margin-bottom: 28px;
  line-height: 1.6;
}

.topic-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.topic-btn {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'DM Sans', sans-serif;
  display: flex;
  align-items: center;
  gap: 6px;
}

.topic-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.topic-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.topic-count {
  font-size: 11px;
  background: rgba(255,255,255,0.2);
  padding: 1px 6px;
  border-radius: 10px;
}

.topic-btn:not(.active) .topic-count {
  background: var(--border);
  color: var(--fg-muted);
}

.btn-start {
  width: 100%;
  background: var(--bio-color);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  letter-spacing: 0.2px;
  transition: background 0.15s;
}

.btn-start:hover { background: #047857; }

/* ── Quiz Screen ───────────────────────────────────────────────────── */
.quiz-screen {
  padding: 20px 20px 40px;
  max-width: 600px;
  margin: 0 auto;
}

.quiz-header {
  margin-bottom: 20px;
}

.quiz-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.q-counter {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--accent);
}

.q-topic {
  font-size: 12px;
  color: var(--bio-color);
  font-weight: 600;
  background: var(--bio-light);
  padding: 3px 8px;
  border-radius: 6px;
}

.progress-track {
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--bio-color);
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ── Question Card ─────────────────────────────────────────────────── */
.question-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 24px 20px;
  border: 1.5px solid var(--border);
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.q-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.55;
  margin-bottom: 20px;
}

.q-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.opt-btn {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
  cursor: pointer;
  text-align: left;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
  line-height: 1.45;
}

.opt-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

.opt-btn:disabled { cursor: default; }

.opt-btn.correct {
  border-color: var(--bio-color) !important;
  background: var(--bio-light) !important;
  color: var(--bio-dark) !important;
}

.opt-btn.wrong {
  border-color: var(--WRONG, #DC2626) !important;
  background: #FEE2E2 !important;
  color: #991B1B !important;
}

/* ── Feedback ──────────────────────────────────────────────────────── */
.q-feedback {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 16px;
}

.q-feedback.correct {
  background: var(--bio-light);
  color: var(--bio-dark);
  border: 1.5px solid #6EE7B7;
}

.q-feedback.wrong {
  background: #FEF2F2;
  color: #991B1B;
  border: 1.5px solid #FECACA;
}

.q-feedback strong { font-weight: 700; }

/* ── Next Button ──────────────────────────────────────────────────── */
.btn-next {
  width: 100%;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 13px 24px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.15s;
}

.btn-next:hover { background: #162d4a; }

/* ── Results Screen ───────────────────────────────────────────────── */
.results-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 70px);
  padding: 24px;
}

.results-inner {
  background: var(--surface);
  border-radius: 24px;
  padding: 40px 32px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  border: 1.5px solid var(--border);
  box-shadow: 0 4px 24px rgba(0,0,0,0.05);
}

.results-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.results-title {
  font-family: 'Syne', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 20px;
}

.results-score {
  font-family: 'Syne', sans-serif;
  font-size: 64px;
  font-weight: 800;
  color: var(--bio-color);
  margin-bottom: 4px;
}

.results-pct {
  font-size: 18px;
  color: var(--fg-muted);
  margin-bottom: 28px;
}

.results-breakdown {
  background: var(--bg);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 28px;
  font-size: 14px;
  color: var(--fg-muted);
  text-align: left;
}

.results-actions {
  display: flex;
  gap: 12px;
}

.btn-retry {
  flex: 1;
  background: var(--bio-color);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.15s;
}

.btn-retry:hover { background: #047857; }

.btn-home {
  flex: 1;
  background: var(--bg);
  color: var(--accent);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  transition: all 0.15s;
}

.btn-home:hover { border-color: var(--accent); }