/* ============================================
   Grammar School Prep - Main Stylesheet
   ============================================ */

:root {
  --primary: #6C63FF;
  --primary-light: #9C94FF;
  --primary-dark: #4A42CC;
  --english: #FF6B6B;
  --english-light: #FFB3B3;
  --maths: #4ECDC4;
  --maths-light: #A8F0EC;
  --verbal: #FFD93D;
  --verbal-light: #FFF0A0;
  --nonverbal: #6BCB77;
  --nonverbal-light: #B8EDC0;
  --bg: #F0F2FF;
  --card: #FFFFFF;
  --text: #2D3748;
  --text-light: #718096;
  --border: #E2E8F0;
  --success: #48BB78;
  --error: #FC8181;
  --shadow: 0 4px 20px rgba(108,99,255,0.12);
  --radius: 20px;
  --radius-sm: 12px;
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ---- Navigation ---- */
.nav {
  background: white;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.nav-logo .logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.nav-logo .logo-text {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
}

.nav-logo .logo-sub {
  font-size: 11px;
  color: var(--text-light);
  font-weight: 500;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-streak {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #FFF5E6;
  border: 2px solid #FFD93D;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 700;
  color: #B7791F;
}

.nav-points {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #F0F8FF;
  border: 2px solid var(--primary-light);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-dark);
}

/* ---- Page Sections ---- */
.page {
  display: none;
  padding: 32px 24px;
  max-width: 1100px;
  margin: 0 auto;
  animation: fadeIn 0.3s ease;
}

.page.active {
  display: block;
}

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

/* ---- Dashboard ---- */
.welcome-banner {
  background: linear-gradient(135deg, var(--primary) 0%, #9C94FF 100%);
  border-radius: var(--radius);
  padding: 32px 36px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.welcome-text h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
}

.welcome-text p {
  font-size: 16px;
  opacity: 0.9;
}

.welcome-emoji {
  font-size: 72px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.section-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---- Subject Cards ---- */
.subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 36px;
}

.subject-card {
  background: white;
  border-radius: var(--radius);
  padding: 28px 24px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow);
  border: 3px solid transparent;
  position: relative;
  overflow: hidden;
}

.subject-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(108,99,255,0.18);
}

.subject-card.english { border-color: var(--english); }
.subject-card.maths { border-color: var(--maths); }
.subject-card.verbal { border-color: var(--verbal); }
.subject-card.nonverbal { border-color: var(--nonverbal); }

.subject-card .subject-icon {
  font-size: 44px;
  margin-bottom: 14px;
  display: block;
}

.subject-card h3 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 6px;
}

.subject-card p {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 16px;
  line-height: 1.5;
}

.subject-progress {
  margin-bottom: 10px;
}

.progress-bar-bg {
  background: var(--border);
  border-radius: 10px;
  height: 10px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.6s ease;
}

.english .progress-bar-fill { background: var(--english); }
.maths .progress-bar-fill { background: var(--maths); }
.verbal .progress-bar-fill { background: var(--verbal); }
.nonverbal .progress-bar-fill { background: var(--nonverbal); }

.progress-label {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 6px;
  font-weight: 600;
}

.subject-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.english .subject-badge { background: var(--english-light); color: #C0392B; }
.maths .subject-badge { background: var(--maths-light); color: #0E7A74; }
.verbal .subject-badge { background: var(--verbal-light); color: #9A6800; }
.nonverbal .subject-badge { background: var(--nonverbal-light); color: #276B2F; }

/* ---- Stats Row ---- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 36px;
}

.stat-card {
  background: white;
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-card .stat-value {
  font-size: 32px;
  font-weight: 900;
  color: var(--primary);
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 4px;
  font-weight: 600;
}

/* ---- Topic Selection ---- */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 24px;
  transition: all 0.2s;
  color: var(--text);
}

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

.subject-header {
  border-radius: var(--radius);
  padding: 28px 32px;
  color: white;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.subject-header.english { background: linear-gradient(135deg, var(--english), #FF9A9A); }
.subject-header.maths { background: linear-gradient(135deg, var(--maths), #7EEAE4); }
.subject-header.verbal { background: linear-gradient(135deg, #F0C030, var(--verbal)); }
.subject-header.nonverbal { background: linear-gradient(135deg, var(--nonverbal), #9AE5A0); }

.subject-header .header-icon { font-size: 60px; }
.subject-header h2 { font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.subject-header p { font-size: 15px; opacity: 0.9; }

.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.topic-card {
  background: white;
  border-radius: var(--radius-sm);
  padding: 20px 22px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  gap: 16px;
  border: 2px solid transparent;
}

.topic-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.topic-card .topic-icon {
  font-size: 32px;
  width: 52px;
  height: 52px;
  background: var(--bg);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.topic-card .topic-info h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.topic-card .topic-info p {
  font-size: 12px;
  color: var(--text-light);
}

.topic-card .topic-score {
  margin-left: auto;
  text-align: right;
  font-size: 13px;
  font-weight: 700;
  color: var(--success);
  flex-shrink: 0;
}

/* ---- Quiz ---- */
.quiz-container {
  max-width: 720px;
  margin: 0 auto;
}

.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 16px 20px;
  background: white;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.quiz-info h3 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 2px;
}

.quiz-info p {
  font-size: 13px;
  color: var(--text-light);
}

.quiz-timer {
  font-size: 22px;
  font-weight: 900;
  color: var(--primary);
  background: var(--bg);
  padding: 8px 18px;
  border-radius: 12px;
  min-width: 80px;
  text-align: center;
}

.quiz-timer.warning { color: var(--error); }

.question-progress {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
}

.q-dot {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  transition: background 0.3s;
}

.q-dot.answered { background: var(--primary); }
.q-dot.current { background: var(--primary-light); }

.question-card {
  background: white;
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.question-number {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary);
  margin-bottom: 16px;
}

.question-text {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 28px;
  color: var(--text);
}

.question-image {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.options-grid.single-col {
  grid-template-columns: 1fr;
}

.option-btn {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: white;
  transform: translateY(-1px);
}

.option-btn .option-letter {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: white;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.option-btn.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}
.option-btn.selected .option-letter {
  background: rgba(255,255,255,0.25);
  color: white;
}

.option-btn.correct {
  border-color: var(--success);
  background: #F0FFF4;
  color: #276749;
}

.option-btn.correct .option-letter {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.option-btn.wrong {
  border-color: var(--error);
  background: #FFF5F5;
  color: #9B2335;
}

.option-btn.wrong .option-letter {
  background: var(--error);
  border-color: var(--error);
  color: white;
}

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

.feedback-box {
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  display: none;
  margin-top: 16px;
  animation: fadeIn 0.3s ease;
}

.feedback-box.show { display: block; }
.feedback-box.correct-fb { background: #F0FFF4; border: 2px solid var(--success); color: #276749; }
.feedback-box.wrong-fb { background: #FFF5F5; border: 2px solid var(--error); color: #9B2335; }

.quiz-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn {
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

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

.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); }
.btn-primary:disabled { opacity: 0.5; cursor: default; transform: none; }

.btn-outline {
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover { background: var(--bg); }

/* ---- Results ---- */
.results-container {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.results-card {
  background: white;
  border-radius: var(--radius);
  padding: 48px 40px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.results-emoji {
  font-size: 80px;
  margin-bottom: 20px;
  display: block;
}

.results-card h2 {
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 8px;
}

.results-card p {
  font-size: 16px;
  color: var(--text-light);
  margin-bottom: 28px;
}

.score-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 28px;
  border: 8px solid var(--primary);
}

.score-circle .score-num {
  font-size: 38px;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
}

.score-circle .score-denom {
  font-size: 16px;
  color: var(--text-light);
  font-weight: 600;
}

.results-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  text-align: left;
  margin-bottom: 28px;
}

.breakdown-item {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.breakdown-item .bi-label {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 600;
  margin-bottom: 4px;
}

.breakdown-item .bi-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

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

/* ---- Answer Review ---- */
.answers-review {
  text-align: left;
  margin-top: 8px;
}

.review-heading {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--text);
}

.review-card {
  background: white;
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border-left: 5px solid var(--text-light);
}

.review-card.review-correct { border-left-color: var(--success); }
.review-card.review-wrong   { border-left-color: var(--danger, #FC8181); }
.review-card.review-skipped { border-left-color: #ccc; opacity: 0.75; }

.review-q-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.review-q-num {
  font-size: 12px;
  font-weight: 800;
  background: var(--bg);
  padding: 3px 8px;
  border-radius: 20px;
  color: var(--text-light);
}

.review-status {
  font-size: 13px;
  font-weight: 700;
}

.review-q-text {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  line-height: 1.5;
}

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

.review-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 14px;
}

.review-option.review-opt-correct {
  background: #d4edda;
  color: #155724;
  font-weight: 700;
}

.review-option.review-opt-wrong {
  background: #fde8e8;
  color: #721c24;
  font-weight: 700;
}

.review-opt-letter {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

.review-explanation {
  font-size: 13px;
  color: var(--text-light);
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  line-height: 1.5;
}

/* ---- Mock Exam ---- */
.mock-hero {
  text-align: center;
  padding: 32px 20px 24px;
  background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 100%);
  border-radius: var(--radius);
  color: white;
  margin-bottom: 24px;
}

.mock-hero-icon { font-size: 56px; margin-bottom: 12px; }
.mock-hero h2   { font-size: 26px; font-weight: 900; margin-bottom: 8px; }
.mock-hero p    { font-size: 14px; opacity: 0.8; }

.mock-formats { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }

.mock-format-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: white;
  border-radius: var(--radius-sm);
  padding: 20px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  border: 2px solid transparent;
}

.mock-format-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(108,99,255,0.18);
  border-color: var(--primary);
}

.mf-icon { font-size: 32px; flex-shrink: 0; }

.mf-info { flex: 1; }
.mf-info h4 { font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.mf-info p  { font-size: 13px; color: var(--text-light); }

.mf-arrow { font-size: 20px; color: var(--primary); font-weight: 900; }

.mock-info-box {
  background: #F0F2FF;
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  font-size: 14px;
  line-height: 1.6;
}

.mock-info-box strong { display: block; margin-bottom: 10px; font-size: 15px; }
.mock-info-box ul     { padding-left: 18px; }
.mock-info-box li     { margin-bottom: 6px; color: var(--text-light); }

.mock-section-bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 16px;
  gap: 2px;
}

.mock-section-seg { border-radius: 3px; transition: width .4s; }

/* ---- Leaderboard / Progress ---- */
.progress-page .overall-card {
  background: white;
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
}

.overall-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.subject-progress-item {
  background: white;
  border-radius: var(--radius-sm);
  padding: 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  margin-bottom: 16px;
}

.subject-progress-item h4 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topic-scores-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.topic-score-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.topic-score-row .ts-name {
  flex: 1;
  font-weight: 600;
}

.topic-score-row .ts-bar {
  flex: 2;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.topic-score-row .ts-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.topic-score-row .ts-pct {
  font-size: 13px;
  font-weight: 700;
  min-width: 36px;
  text-align: right;
  color: var(--text-light);
}

/* ---- NVR Shapes ---- */
.nvr-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.nvr-cell {
  width: 80px;
  height: 80px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}

.nvr-cell.question-mark {
  font-size: 28px;
  font-weight: 900;
  color: var(--primary);
}

/* ---- Navbar bottom tabs ---- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  display: flex;
  justify-content: space-around;
  padding: 10px 0 env(safe-area-inset-bottom, 10px);
  box-shadow: 0 -2px 12px rgba(0,0,0,0.1);
  z-index: 100;
}

.bottom-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 6px 20px;
  border-radius: 12px;
  transition: all 0.2s;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 12px;
  font-weight: 600;
}

.bottom-nav-btn .nav-icon {
  font-size: 22px;
}

.bottom-nav-btn.active {
  color: var(--primary);
  background: var(--bg);
}

/* ---- Celebration Overlay ---- */
.confetti-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  animation: confetti-fall 2.5s ease-out forwards;
}

@keyframes confetti-fall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* ---- Tooltip / hint ---- */
.hint-btn {
  background: none;
  border: 2px dashed var(--verbal);
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  color: #9A6800;
  cursor: pointer;
  margin-bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.hint-btn:hover { background: var(--verbal-light); }

.hint-box {
  background: var(--verbal-light);
  border: 2px solid var(--verbal);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 14px;
  color: #9A6800;
  font-weight: 600;
  margin-bottom: 16px;
  display: none;
  animation: fadeIn 0.3s ease;
}

.hint-box.show { display: block; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 3px; }

/* ---- Auth button in nav ---- */
.nav-auth-btn {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.nav-auth-btn:hover { background: var(--primary-dark); }

.nav-user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 2px solid var(--primary-light);
  border-radius: 20px;
  padding: 5px 14px 5px 6px;
  cursor: pointer;
  transition: border-color 0.2s;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
}
.nav-user-chip:hover { border-color: var(--primary); }
.nav-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Auth / Profile modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-overlay.show { display: flex; animation: fadeIn 0.2s ease; }

.auth-modal {
  background: white;
  border-radius: 24px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  overflow: hidden;
  animation: slideUp 0.25s ease;
}

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

.auth-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 16px 20px 0;
  border-bottom: 1px solid var(--border);
}

.auth-tab {
  background: none;
  border: none;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-light);
  border-bottom: 3px solid transparent;
  transition: all 0.15s;
  margin-bottom: -1px;
}
.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.auth-close {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-light);
  padding: 4px 8px;
}
.auth-close:hover { color: var(--text); }

.auth-form { padding: 24px 28px; }

.auth-header { text-align: center; margin-bottom: 20px; }
.auth-header h2 { font-size: 22px; font-weight: 900; margin-bottom: 4px; }
.auth-header p  { font-size: 13px; color: var(--text-light); }

.auth-error {
  background: #FFF5F5;
  border: 1px solid var(--error);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #C53030;
  font-weight: 600;
  margin-bottom: 12px;
  display: none;
}
.auth-error.show { display: block; }

.btn-auth-submit {
  width: 100%;
  padding: 13px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  margin-top: 4px;
}
.btn-auth-submit:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-auth-submit:disabled { opacity: 0.6; cursor: default; transform: none; }

.auth-switch {
  text-align: center;
  font-size: 13px;
  color: var(--text-light);
  margin-top: 14px;
}
.auth-switch a { color: var(--primary); font-weight: 700; text-decoration: none; }

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
  margin-bottom: 5px;
}

.form-group input, .form-group select {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}
.form-group input:focus, .form-group select:focus { border-color: var(--primary); background: white; }

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .page { padding: 20px 16px 80px; }
  .welcome-banner { flex-direction: column; gap: 16px; text-align: center; }
  .welcome-emoji { font-size: 48px; }
  .options-grid { grid-template-columns: 1fr; }
  .results-breakdown { grid-template-columns: 1fr; }
  .overall-stats { grid-template-columns: 1fr; }
  .question-card { padding: 24px 20px; }
}

/* extra bottom padding for fixed nav */
.page { padding-bottom: 90px; }

/* ============================================
   Auth / Landing screen
   ============================================ */
#screen-auth {
  min-height: 100vh;
  background: linear-gradient(160deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.auth-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 440px;
  gap: 24px;
}

/* Branding above card */
.auth-branding {
  text-align: center;
  color: white;
}

.auth-brand-logo {
  font-size: 56px;
  margin-bottom: 10px;
  filter: drop-shadow(0 4px 12px rgba(108,99,255,0.5));
}

.auth-brand-name {
  font-size: 36px;
  font-weight: 900;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.auth-brand-sub {
  font-size: 14px;
  opacity: 0.7;
  font-weight: 500;
}

/* The white card */
.auth-card {
  background: white;
  border-radius: 20px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(0,0,0,0.4);
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

/* Features below card */
.auth-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.auth-feature-pill {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.field-hint {
  display: block;
  font-size: 11px;
  color: var(--text-light);
  margin-top: 4px;
}
