/* ═══════════════════════════════════════════════════
   CHIATECH JAMB CBT 2026 — Master Stylesheet
   ═══════════════════════════════════════════════════ */
:root {
  --primary:      #1b5e20;
  --primary-mid:  #2e7d32;
  --primary-lt:   #43a047;
  --primary-pale: #e8f5e9;
  --accent:       #ff6f00;
  --accent-lt:    #fff3e0;
  --danger:       #c62828;
  --danger-lt:    #ffebee;
  --info:         #0277bd;
  --info-lt:      #e1f5fe;
  --warning:      #f9a825;
  --success:      #2e7d32;
  --text-dark:    #1a1a2e;
  --text-mid:     #37474f;
  --text-light:   #78909c;
  --bg:           #f0f4f0;
  --card:         #ffffff;
  --border:       #c8e6c9;
  --shadow:       0 4px 24px rgba(0,0,0,0.10);
  --shadow-lg:    0 8px 40px rgba(0,0,0,0.15);
  --radius:       14px;
  --radius-sm:    8px;
  --font:         'Poppins', sans-serif;
  --font-brand:   'Orbitron', sans-serif;
  --transition:   0.25s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-dark);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

/* ─── SCREENS ─── */
.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }

/* ─── GATE / ACCESS SCREEN ─── */
.gate-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-mid) 40%, #1a237e 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 16px 16px;
}

.gate-card {
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  max-width: 780px;
  width: 100%;
  overflow: hidden;
  animation: slideUp 0.5s ease;
}

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

.gate-header {
  background: linear-gradient(135deg, var(--primary) 0%, #1a237e 100%);
  padding: 32px 32px 24px;
  text-align: center;
  color: white;
}

.logo-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.5);
  margin-bottom: 12px;
  object-fit: contain;
  background: white;
}

.brand-title {
  font-family: var(--font-brand);
  font-size: 2.2rem;
  letter-spacing: 4px;
  margin-bottom: 6px;
}

.brand-title .chia { color: #a5d6a7; }
.brand-title .tech { color: #ffffff; }

.exam-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.tagline {
  font-size: 0.85rem;
  color: #c8e6c9;
  opacity: 0.9;
}

.form-section { padding: 28px 32px 32px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 4px;
}

.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--primary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="password"] {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.92rem;
  color: var(--text-dark);
  background: #fafffe;
  transition: var(--transition);
  outline: none;
}

.form-group input:focus {
  border-color: var(--primary-lt);
  box-shadow: 0 0 0 3px rgba(67,160,71,0.15);
}

.req { color: var(--danger); }

.helper {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 10px;
}

.subject-section label:first-child {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--primary);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.subject-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.subject-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 2px solid var(--border);
  border-radius: 50px;
  cursor: pointer;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text-mid);
  background: white;
  transition: var(--transition);
  user-select: none;
}

.subject-pill:hover { border-color: var(--primary-lt); color: var(--primary); }

.subject-pill input { display: none; }

.subject-pill.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* ─── BUTTONS ─── */
.btn-primary {
  background: linear-gradient(135deg, var(--primary-lt), var(--primary));
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 50px;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(46,125,50,0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(46,125,50,0.45);
}

.btn-lg { width: 100%; justify-content: center; margin-top: 8px; }

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  padding: 10px 22px;
  border-radius: 50px;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-secondary:hover {
  background: var(--primary);
  color: white;
}

.btn-sm { padding: 7px 16px; font-size: 0.8rem; }

.btn-danger {
  background: var(--danger);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 50px;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-danger:hover { background: #b71c1c; transform: translateY(-1px); }

/* ─── ALERTS ─── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-top: 12px;
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-error { background: var(--danger-lt); color: var(--danger); border-left: 4px solid var(--danger); }
.alert-info  { background: var(--info-lt);   color: var(--info);   border-left: 4px solid var(--info); }

/* ─── FOOTER ─── */
.app-footer {
  color: rgba(255,255,255,0.65);
  font-size: 0.72rem;
  text-align: center;
  padding: 20px 0 10px;
  line-height: 1.8;
}

/* ─── INNER WRAPPER (shared pages) ─── */
.inner-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* ─── PAGE HEADER ─── */
.page-header {
  text-align: center;
  margin-bottom: 32px;
}

.page-header h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}

.subtitle { color: var(--text-mid); font-size: 0.95rem; }

.badge-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; }

.badge-green {
  background: var(--primary-pale);
  color: var(--primary);
  border: 1px solid var(--border);
  padding: 4px 14px;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
}

/* ─── TEST SELECTION GRID ─── */
#testSelectScreen { background: var(--bg); padding: 20px; }

.test-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.test-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 10px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.test-card:hover {
  border-color: var(--primary-lt);
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(46,125,50,0.18);
}

.test-card .test-num {
  font-family: var(--font-brand);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--primary);
}

.test-card .test-label { font-size: 0.75rem; color: var(--text-light); margin-top: 4px; font-weight: 500; }
.test-card .test-qs { font-size: 0.7rem; color: var(--text-light); margin-top: 2px; }

/* ─── INSTRUCTIONS ─── */
#instructionsScreen { background: var(--bg); }

.instr-card {
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 40px;
}

.instr-header {
  text-align: center;
  color: var(--primary);
  margin-bottom: 28px;
}

.instr-header h2 { font-size: 1.6rem; margin: 12px 0 6px; }

.instr-list {
  list-style: none;
  margin-bottom: 28px;
}

.instr-list li {
  padding: 12px 16px;
  border-left: 4px solid var(--primary-lt);
  background: var(--primary-pale);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 10px;
  font-size: 0.92rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.instr-list li i { color: var(--primary); margin-top: 3px; flex-shrink: 0; }

.instr-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ─── TOPBAR ─── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--primary);
  color: white;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-logo {
  font-family: var(--font-brand);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: #a5d6a7;
}

.topbar-student {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.12);
  padding: 3px 10px;
  border-radius: 50px;
}

.topbar-timer {
  font-family: var(--font-brand);
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 3px;
  color: #a5d6a7;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.5s;
}

.topbar-timer.danger { color: #ff5252; animation: pulse 1s infinite; }

@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.5; } }

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.tool-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  transition: var(--transition);
}

.tool-btn:hover { background: rgba(255,255,255,0.25); }

.btn-submit-top {
  background: var(--accent);
  color: white;
  border: none;
  padding: 8px 18px;
  border-radius: 50px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  letter-spacing: 1px;
}

.btn-submit-top:hover { background: #e65100; transform: scale(1.03); }

/* ─── SUBJECT TABS ─── */
.subject-tabs-bar {
  background: #1b5e20;
  padding: 0 16px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 3px solid var(--primary-lt);
}

.subject-tab {
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.65);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;
  transition: var(--transition);
  letter-spacing: 0.5px;
}

.subject-tab:hover { color: white; }
.subject-tab.active {
  color: white;
  border-bottom-color: #ffee58;
}

/* ─── EXAM BODY ─── */
.exam-body {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 0;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  align-items: start;
}

.passage-panel {
  grid-column: 1 / -1;
  background: #fff8e1;
  border: 2px solid #ffe082;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  max-height: 260px;
  overflow-y: auto;
}

.passage-header {
  font-weight: 700;
  color: #e65100;
  margin-bottom: 10px;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.passage-text { font-size: 0.9rem; line-height: 1.9; color: var(--text-dark); }

/* ─── QUESTION PANEL ─── */
.question-panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

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

.q-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-pale);
  padding: 4px 14px;
  border-radius: 50px;
  letter-spacing: 0.5px;
}

.flag-indicator {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.question-text {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-dark);
  line-height: 1.8;
  margin-bottom: 22px;
}

/* ─── OPTIONS ─── */
.options-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }

.option-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  background: white;
  user-select: none;
}

.option-item:hover {
  border-color: var(--primary-lt);
  background: var(--primary-pale);
}

.option-item.selected {
  border-color: var(--primary);
  background: var(--primary-pale);
  font-weight: 600;
}

.option-item.selected .opt-letter {
  background: var(--primary);
  color: white;
}

.opt-letter {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: var(--transition);
}

.opt-text { font-size: 0.92rem; line-height: 1.5; }

/* ─── NAV BUTTONS ─── */
.q-nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.btn-nav {
  background: var(--primary-pale);
  color: var(--primary);
  border: 2px solid var(--border);
  padding: 10px 20px;
  border-radius: 50px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-nav:hover { background: var(--primary); color: white; border-color: var(--primary); }

.btn-flag {
  background: var(--accent-lt);
  color: var(--accent);
  border: 2px solid #ffcc02;
  padding: 10px 18px;
  border-radius: 50px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

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

/* ─── PALETTE ─── */
.palette-panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-left: 16px;
  position: sticky;
  top: 80px;
}

.palette-header {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--primary);
  text-align: center;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.palette-legend {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
  font-size: 0.72rem;
}

.leg {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  color: var(--text-mid);
}

.leg::before {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: inline-block;
  flex-shrink: 0;
}

.leg.answered::before  { background: var(--primary); }
.leg.flagged::before   { background: var(--accent); }
.leg.unanswered::before { background: #e0e0e0; border: 1px solid #bbb; }

.palette-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  margin-bottom: 14px;
}

.palette-btn {
  width: 32px;
  height: 32px;
  border-radius: 5px;
  border: 1px solid #ccc;
  background: #f5f5f5;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  color: var(--text-mid);
}

.palette-btn.answered  { background: var(--primary); color: white; border-color: var(--primary); }
.palette-btn.flagged   { background: var(--accent);  color: white; border-color: var(--accent); }
.palette-btn.current   { box-shadow: 0 0 0 3px #ffee58; }

.progress-fill {
  height: 6px;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.4s ease;
  margin-bottom: 8px;
}

.progress-fill { background-color: #e0e0e0; height: 6px; border-radius: 3px; overflow: hidden; }

#progressBar {
  height: 100%;
  background: var(--primary);
  transition: width 0.4s;
}

.progress-text { font-size: 0.75rem; text-align: center; color: var(--text-light); font-weight: 600; }

/* ─── RESULTS SCREEN ─── */
#resultsScreen {
  background: linear-gradient(135deg, var(--primary) 0%, #1a237e 100%);
  min-height: 100vh;
}

.results-card {
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 40px 32px;
  text-align: center;
  animation: slideUp 0.5s ease;
}

.results-top { margin-bottom: 24px; }
.result-icon { font-size: 3.5rem; margin-bottom: 8px; }

.results-card h1 {
  font-family: var(--font-brand);
  font-size: 1.3rem;
  color: var(--primary);
  letter-spacing: 3px;
  margin-bottom: 6px;
}

.results-card h2 { font-size: 1.4rem; color: var(--text-dark); }

.total-score-ring {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: conic-gradient(var(--primary) 0%, var(--primary-lt) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px auto;
  box-shadow: 0 4px 20px rgba(46,125,50,0.3);
}

.score-ring-inner {
  width: 130px;
  height: 130px;
  background: white;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-big { font-family: var(--font-brand); font-size: 2.5rem; font-weight: 900; color: var(--primary); line-height: 1; }
.score-denom { font-size: 0.85rem; color: var(--text-light); font-weight: 600; }
.score-grade { font-size: 1.1rem; font-weight: 800; margin-top: 2px; }

.score-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.score-card {
  background: var(--primary-pale);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.score-card .sc-subject { font-size: 0.78rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.score-card .sc-score { font-size: 1.6rem; font-weight: 800; color: var(--text-dark); line-height: 1; }
.score-card .sc-scaled { font-size: 0.78rem; color: var(--text-light); margin-top: 4px; }
.score-card .sc-bar { height: 6px; background: #e0e0e0; border-radius: 3px; margin-top: 8px; overflow: hidden; }
.score-card .sc-fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width 0.8s ease; }

.performance-msg {
  background: var(--primary-pale);
  border-left: 4px solid var(--primary);
  padding: 14px 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.9rem;
  color: var(--text-dark);
  margin-bottom: 24px;
  text-align: left;
}

.result-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ─── REVIEW SCREEN ─── */
#reviewScreen { background: var(--bg); }

.review-topbar {
  background: #1a237e;
  color: white;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
}

.review-tabs { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }

.review-tab {
  padding: 6px 14px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50px;
  background: transparent;
  color: rgba(255,255,255,0.7);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.review-tab.active,
.review-tab:hover { background: white; color: #1a237e; }

.review-container { max-width: 860px; margin: 0 auto; padding: 24px 20px; }

.review-question {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 16px;
  border-left: 4px solid var(--border);
}

.review-question.correct { border-left-color: var(--success); }
.review-question.wrong   { border-left-color: var(--danger); }
.review-question.skipped { border-left-color: #bbb; }

.review-q-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.review-q-num { font-weight: 700; color: var(--text-mid); font-size: 0.82rem; }

.review-badge {
  padding: 3px 12px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
}

.review-badge.correct { background: #e8f5e9; color: var(--success); }
.review-badge.wrong   { background: var(--danger-lt); color: var(--danger); }
.review-badge.skipped { background: #f5f5f5; color: #757575; }

.review-q-text { font-size: 0.95rem; font-weight: 500; margin-bottom: 14px; line-height: 1.7; }

.review-options { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }

.review-opt {
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
}

.review-opt.correct-ans {
  background: #e8f5e9;
  border-color: #a5d6a7;
  color: var(--success);
  font-weight: 600;
}

.review-opt.wrong-ans {
  background: var(--danger-lt);
  border-color: #ef9a9a;
  color: var(--danger);
  font-weight: 600;
  text-decoration: line-through;
}

.review-opt.neutral-ans { background: #fafafa; border-color: #e0e0e0; color: var(--text-mid); }

.review-explanation {
  background: var(--info-lt);
  border-left: 4px solid var(--info);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.87rem;
  color: #01579b;
  line-height: 1.7;
}

.review-explanation strong { color: var(--info); }

/* ─── CALCULATOR MODAL ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  backdrop-filter: blur(4px);
}

.calc-modal {
  background: #1e1e2e;
  border-radius: 20px;
  padding: 20px;
  width: 300px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
  animation: slideUp 0.2s ease;
}

.calc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.calc-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 6px;
}

.calc-history {
  font-size: 0.75rem;
  color: #888;
  text-align: right;
  min-height: 20px;
  margin-bottom: 4px;
}

.calc-display {
  width: 100%;
  background: #16213e;
  border: 1px solid #333;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 1.6rem;
  font-family: var(--font-brand);
  text-align: right;
  padding: 12px 14px;
  margin-bottom: 12px;
  outline: none;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.calc-btn {
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  background: #2d2d44;
  color: white;
}

.calc-btn:hover { transform: scale(1.05); opacity: 0.9; }
.calc-btn.op { background: #0f3460; color: #58a6ff; }
.calc-btn.equals { background: var(--primary); color: white; grid-column: span 2; }
.calc-btn.clear { background: var(--danger); color: white; }
.calc-btn.zero { grid-column: span 2; }

/* ─── SUBMIT MODAL ─── */
.confirm-modal {
  background: white;
  border-radius: 20px;
  padding: 36px 30px;
  text-align: center;
  max-width: 440px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s ease;
}

.warning-icon { color: var(--accent); margin-bottom: 12px; }

.confirm-modal h2 { font-size: 1.4rem; color: var(--text-dark); margin-bottom: 16px; }

.submit-stats {
  background: var(--primary-pale);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 14px;
  text-align: left;
  font-size: 0.88rem;
  color: var(--text-mid);
}

.confirm-modal p { font-size: 0.88rem; color: var(--text-mid); margin-bottom: 22px; }

.confirm-actions { display: flex; gap: 12px; justify-content: center; }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .form-row { grid-template-columns: 1fr; }
  .exam-body { grid-template-columns: 1fr; padding: 12px; }
  .palette-panel { margin-left: 0; margin-top: 16px; position: relative; top: 0; }
  .palette-grid { grid-template-columns: repeat(8, 1fr); }
  .palette-btn { width: 30px; height: 30px; font-size: 0.68rem; }
  .topbar-logo { display: none; }
  .topbar-student { display: none; }
  .instr-card { padding: 24px 16px; }
  .form-section { padding: 20px 16px; }
  .gate-header { padding: 24px 16px; }
  .brand-title { font-size: 1.6rem; }
  .results-card { padding: 28px 16px; }
  .score-breakdown { grid-template-columns: 1fr 1fr; }
  .subject-tabs-bar { padding: 0 8px; }
  .subject-tab { padding: 9px 12px; font-size: 0.75rem; }
}

@media (max-width: 480px) {
  .test-grid { grid-template-columns: repeat(4, 1fr); }
  .score-breakdown { grid-template-columns: 1fr; }
  .instr-actions { flex-direction: column; }
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: var(--primary-lt); border-radius: 3px; }
/* The style for a selected subject button */
.subject-btn.selected {
    background-color: #1a4a1a !important; /* Dark Green */
    color: white !important;
    border-color: #1a4a1a;
}
/* Force all answer text visible */
[class*="option"],
[class*="choice"],
[class*="answer"] {
  color: #1a1a1a !important;
}

/* Ensure text inside is visible */
[class*="option"] *,
[class*="choice"] *,
[class*="answer"] * {
  color: #1a1a1a !important;
}
.cbt-passage {
  background: #f5f7f5;
  border-left: 4px solid #1b5e20;
  padding: 14px;
  margin-bottom: 12px;
  border-radius: 6px;
  line-height: 1.6;
}
/* Step 8: FIX passage visibility */
.cbt-passage {
  background: #f5f7f5 !important;
  border-left: 4px solid #1b5e20;
  padding: 14px;
  margin-bottom: 12px;
  border-radius: 6px;

  color: #1a1a1a !important;   /* 🔥 force dark text */
}

.cbt-passage * {
  color: #1a1a1a !important;   /* 🔥 override inherited white */
}
.cbt-passage {
  font-size: 0.95rem;
  line-height: 1.7;
  letter-spacing: 0.2px;
}