/* ═══════════════════════════════════════════════════════════
   MMKids Music Mastery – Rising Stars Certification
   Global Stylesheet
═══════════════════════════════════════════════════════════ */

:root {
  --primary: #6C63FF;
  --primary-dark: #5a52d5;
  --primary-light: #ede9ff;
  --gold: #C9A84C;
  --gold-light: #fff8e6;
  --success: #43D98F;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg: #f5f4ff;
  --surface: #ffffff;
  --surface2: #f8f7ff;
  --border: #e5e2ff;
  --text: #1a1a2e;
  --text-muted: #7b7b9b;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 2px 16px rgba(108,99,255,0.10);
  --shadow-lg: 0 8px 32px rgba(108,99,255,0.18);
  --font: 'Inter', system-ui, sans-serif;
}

*, *::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);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Navbar ──────────────────────────────────────────────── */
.navbar {
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 12px rgba(108,99,255,0.06);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--primary);
}
.brand-icon { font-size: 1.4rem; }
.brand-text span { color: var(--gold); }
.nav-links { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.nav-link { text-decoration: none; color: var(--text-muted); font-weight: 500; font-size: .9rem; transition: color .2s; }
.nav-link:hover { color: var(--primary); }
.nav-admin { color: var(--gold) !important; }
.nav-user { font-size: .88rem; color: var(--text-muted); padding: 0 .4rem; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem 1.3rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  text-decoration: none;
  border: 2px solid transparent;
  transition: all .2s ease;
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface2); color: var(--text); }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-danger:hover { background: #dc2626; }
.btn-cert { background: linear-gradient(135deg, #C9A84C, #f0c040); color: #1a1100; font-weight: 700; }
.btn-cert:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(201,168,76,.35); }
.btn-sm { padding: .35rem .8rem; font-size: .82rem; }
.btn-lg { padding: .8rem 1.8rem; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
  max-width: 900px;
  margin: 1rem auto 0;
  padding: .85rem 1.2rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: .9rem;
}
.alert-success { background: #d1fae5; color: #065f46; border-left: 4px solid var(--success); }
.alert-error   { background: #fee2e2; color: #991b1b; border-left: 4px solid var(--danger); }

/* ── Main content ────────────────────────────────────────── */
.main-content { flex: 1; }

/* ── Footer ──────────────────────────────────────────────── */
.footer { background: white; border-top: 1px solid var(--border); padding: 1.5rem; text-align: center; margin-top: auto; }
.footer-inner p { color: var(--text-muted); font-size: .87rem; }
.footer-sub { font-size: .8rem; margin-top: .2rem; }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .03em;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-active  { background: var(--primary-light); color: var(--primary-dark); }
.badge-locked  { background: #f1f5f9; color: #64748b; }

/* ═══════════════════════════════════════════════════════════
   HOME PAGE
═══════════════════════════════════════════════════════════ */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}
.hero-badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  padding: .3rem .9rem;
  border-radius: 99px;
  font-size: .8rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: .05em;
}
.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 1rem;
}
.hero-title span { color: var(--primary); }
.hero-sub { color: var(--text-muted); font-size: 1.05rem; line-height: 1.7; margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2.5rem; }
.hero-stats {
  display: flex;
  gap: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.stat { display: flex; flex-direction: column; }
.stat-num { font-size: 1.6rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: .78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.level-preview { display: flex; flex-direction: column; gap: .8rem; }
.lp-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: white;
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  border-left: 4px solid var(--accent);
  box-shadow: var(--shadow);
  transition: transform .2s;
}
.lp-card:hover { transform: translateX(4px); }
.lp-icon { font-size: 1.6rem; }
.lp-title { font-size: .75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.lp-name { font-weight: 600; color: var(--text); }

/* ═══════════════════════════════════════════════════════════
   AUTH PAGES
═══════════════════════════════════════════════════════════ */
.auth-page {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.auth-card {
  background: white;
  border-radius: var(--radius);
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.auth-logo { font-size: 2.5rem; text-align: center; margin-bottom: .8rem; }
.auth-title { font-size: 1.5rem; font-weight: 800; text-align: center; margin-bottom: .3rem; }
.auth-sub { text-align: center; color: var(--text-muted); font-size: .9rem; margin-bottom: 1.8rem; }
.auth-form { display: flex; flex-direction: column; gap: 1.1rem; margin-bottom: 1.2rem; }
.auth-switch { text-align: center; font-size: .88rem; color: var(--text-muted); }
.auth-switch a { color: var(--primary); font-weight: 600; text-decoration: none; }

/* ── Form Basics ─────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: .4rem; }
.form-group label { font-weight: 600; font-size: .88rem; color: var(--text); }
.form-group input,
.form-group textarea,
.form-group select {
  padding: .65rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: .93rem;
  background: white;
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108,99,255,.12);
}
.checkbox-label { display: flex; align-items: center; gap: .6rem; cursor: pointer; font-weight: 500; }

/* ═══════════════════════════════════════════════════════════
   PAGE HEADER
═══════════════════════════════════════════════════════════ */
.page-header {
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: white;
  padding: 2.5rem 1.5rem;
}
.page-header-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.page-header h1 { font-size: 1.8rem; font-weight: 800; margin-bottom: .3rem; }
.page-header p { opacity: .85; font-size: 1rem; }

/* ═══════════════════════════════════════════════════════════
   DASHBOARD
═══════════════════════════════════════════════════════════ */
.dashboard-grid {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem 3rem;
}
.progress-overview { display: flex; flex-direction: column; gap: 1.5rem; }

/* Level Cards */
.level-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 2px solid var(--border);
  transition: box-shadow .2s;
}
.level-card:hover { box-shadow: var(--shadow-lg); }
.level-done  { border-color: var(--success); }
.level-active { border-color: var(--lvl-color, var(--primary)); }
.level-card-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.2rem;
}
.level-icon { font-size: 2rem; }
.level-card-title h3 { font-size: 1.05rem; font-weight: 800; }
.level-card-title p { font-size: .85rem; color: var(--text-muted); }
.level-card-head .badge { margin-left: auto; }

/* Progress bar */
.progress-bar-wrap {
  background: var(--border);
  border-radius: 99px;
  height: 8px;
  margin-bottom: .4rem;
}
.progress-bar {
  background: linear-gradient(90deg, var(--lvl-color, var(--primary)), var(--primary));
  height: 100%;
  border-radius: 99px;
  transition: width .5s ease;
}
.progress-label { font-size: .8rem; color: var(--text-muted); margin-bottom: 1.2rem; }

/* Quiz slots grid */
.quiz-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.quiz-slot {
  border-radius: var(--radius-sm);
  padding: 1rem;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.slot-passed  { border-color: var(--success); background: #f0fdf4; }
.slot-open    { border-color: var(--primary); background: var(--primary-light); }
.slot-locked  { opacity: .65; }
.slot-empty   { opacity: .4; }
.slot-header  { display: flex; align-items: center; justify-content: space-between; }
.slot-num     { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.slot-icon    { font-size: 1rem; }
.slot-title   { font-weight: 600; font-size: .88rem; line-height: 1.3; }
.slot-score   { font-size: 1.1rem; font-weight: 800; color: var(--primary); }
.slot-btn     { margin-top: auto; text-align: center; justify-content: center; }
.slot-locked-msg { font-size: .75rem; color: var(--text-muted); margin-top: auto; }

/* Certificate row */
.cert-row { padding-top: 1rem; border-top: 1px solid var(--border); }

/* ═══════════════════════════════════════════════════════════
   QUIZ TAKE PAGE
═══════════════════════════════════════════════════════════ */
.quiz-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}
.quiz-header { margin-bottom: 2rem; }
.quiz-level-badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  padding: .25rem .8rem;
  border-radius: 99px;
  font-size: .78rem;
  font-weight: 700;
  margin-bottom: .6rem;
}
.quiz-title { font-size: 1.6rem; font-weight: 800; margin-bottom: .4rem; }
.quiz-desc  { color: var(--text-muted); }
.quiz-info-bar {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: .8rem;
  padding: .75rem 1rem;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  font-size: .87rem;
  font-weight: 500;
  color: var(--text-muted);
}
.questions-list { display: flex; flex-direction: column; gap: 1.5rem; margin-bottom: 2rem; }
.question-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1.5px solid var(--border);
}
.q-number { font-size: .78rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .07em; margin-bottom: .5rem; }
.q-text { font-size: 1.05rem; font-weight: 600; margin-bottom: 1.2rem; line-height: 1.5; }
.q-options { display: flex; flex-direction: column; gap: .6rem; }
.option-label {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all .15s;
}
.option-label:hover { border-color: var(--primary); background: var(--primary-light); }
.option-label input[type=radio] { display: none; }
.option-label:has(input:checked) { border-color: var(--primary); background: var(--primary-light); }
.option-letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
}
.option-label:has(input:checked) .option-letter { background: var(--primary); color: white; }
.option-text { font-size: .93rem; }

/* Quiz progress */
.quiz-progress-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  font-size: .88rem;
  color: var(--text-muted);
}
.quiz-progress-bar { flex: 1; background: var(--border); border-radius: 99px; height: 6px; }
.quiz-progress-fill { height: 100%; background: var(--primary); border-radius: 99px; transition: width .3s; }
.quiz-submit-row { display: flex; justify-content: space-between; align-items: center; }

/* ═══════════════════════════════════════════════════════════
   QUIZ RESULT PAGE
═══════════════════════════════════════════════════════════ */
.result-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}
.result-hero {
  border-radius: var(--radius);
  padding: 2.5rem;
  display: flex;
  gap: 2rem;
  align-items: center;
  margin-bottom: 1.5rem;
}
.result-pass { background: linear-gradient(135deg, #0d9488, #059669); color: white; }
.result-fail { background: linear-gradient(135deg, #dc2626, #b91c1c); color: white; }
.result-score-ring { position: relative; width: 140px; flex-shrink: 0; }
.score-ring-svg { width: 140px; height: 140px; }
.score-ring-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.score-pct { display: block; font-size: 1.8rem; font-weight: 800; }
.score-emoji { font-size: 1.2rem; }
.result-verdict { font-size: 1.4rem; font-weight: 800; margin-bottom: .4rem; }
.result-quiz-name { opacity: .85; font-size: .9rem; margin-bottom: 1rem; }
.result-stats { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.rstat { display: flex; flex-direction: column; }
.rstat-val { font-size: 1.4rem; font-weight: 800; }
.rstat-lab { font-size: .75rem; opacity: .8; text-transform: uppercase; letter-spacing: .06em; }
.result-retry-msg { margin-top: 1rem; font-size: .9rem; opacity: .9; }

/* Certificate banner */
.cert-banner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: linear-gradient(135deg, #1a1100, #2d1d00);
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  margin-bottom: 1.5rem;
  color: white;
}
.cert-banner-icon { font-size: 2.5rem; }
.cert-banner h3 { font-size: 1.1rem; font-weight: 800; color: var(--gold); margin-bottom: .2rem; }
.cert-banner p { font-size: .88rem; opacity: .8; }
.cert-banner .btn-cert { margin-left: auto; flex-shrink: 0; }

/* Answer review */
.answers-review { margin-bottom: 2rem; }
.review-title { font-size: 1.1rem; font-weight: 800; margin-bottom: 1rem; }
.answer-card {
  background: white;
  border-radius: var(--radius-sm);
  margin-bottom: .8rem;
  overflow: hidden;
  border: 1.5px solid var(--border);
}
.ans-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .6rem 1rem;
  font-size: .8rem;
  font-weight: 700;
}
.ans-correct .ans-header { background: #f0fdf4; color: #166534; }
.ans-wrong   .ans-header { background: #fef2f2; color: #991b1b; }
.ans-icon { font-size: 1rem; }
.ans-question { padding: .8rem 1rem; font-weight: 600; font-size: .93rem; border-bottom: 1px solid var(--border); }
.ans-choices { padding: .8rem 1rem; display: flex; flex-direction: column; gap: .4rem; }
.ans-choice {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .5rem .8rem;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  border: 1px solid transparent;
}
.choice-correct { background: #f0fdf4; border-color: var(--success); color: #166534; font-weight: 600; }
.choice-wrong   { background: #fef2f2; border-color: var(--danger); color: #991b1b; }
.choice-letter {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.choice-tag { margin-left: auto; font-size: .75rem; font-weight: 700; }
.wrong-tag { color: var(--danger); }
.ans-explanation { margin-top: .6rem; padding: .6rem .8rem; background: #fffbeb; border-radius: var(--radius-sm); font-size: .85rem; color: #92400e; }
.result-actions { display: flex; gap: 1rem; justify-content: center; }

/* ═══════════════════════════════════════════════════════════
   ADMIN LAYOUT
═══════════════════════════════════════════════════════════ */
.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 64px);
}
.admin-sidebar {
  background: #0D1B2A;
  color: white;
  padding: 1.5rem 0;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
}
.sidebar-brand {
  font-weight: 800;
  font-size: .95rem;
  padding: 0 1.2rem 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 1rem;
  color: var(--gold);
}
.sidebar-nav { display: flex; flex-direction: column; }
.sidebar-link {
  display: block;
  padding: .7rem 1.2rem;
  text-decoration: none;
  color: rgba(255,255,255,.7);
  font-size: .9rem;
  font-weight: 500;
  transition: all .15s;
}
.sidebar-link:hover, .sidebar-link.active { background: rgba(108,99,255,.3); color: white; }
.sidebar-divider { border: none; border-top: 1px solid rgba(255,255,255,.1); margin: .5rem 0; }

.admin-main { padding: 2rem; background: var(--bg); }
.admin-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.admin-page-header h1 { font-size: 1.5rem; font-weight: 800; }
.admin-page-header p { color: var(--text-muted); font-size: .9rem; }

/* Admin stat cards */
.admin-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow);
  border: 1.5px solid var(--border);
}
.stat-icon { font-size: 1.8rem; }
.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: .78rem; color: var(--text-muted); font-weight: 600; }

/* Admin table */
.admin-section { background: white; border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); margin-bottom: 1.5rem; border: 1.5px solid var(--border); }
.admin-section-title { font-size: 1rem; font-weight: 800; margin-bottom: 1.2rem; }
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.admin-table th {
  text-align: left;
  padding: .65rem 1rem;
  background: var(--surface2);
  font-weight: 700;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  border-bottom: 1.5px solid var(--border);
}
.admin-table td { padding: .85rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--surface2); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }

/* Admin quiz grid */
.admin-level-section { margin-bottom: 2rem; }
.admin-level-title { font-size: 1rem; font-weight: 800; margin-bottom: 1rem; color: var(--primary); }
.admin-quiz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.admin-quiz-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.2rem;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow);
}
.admin-quiz-empty { border-style: dashed; box-shadow: none; }
.aqc-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .7rem; }
.aqc-slot { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); }
.aqc-title { font-weight: 700; font-size: .93rem; margin-bottom: .4rem; line-height: 1.3; }
.aqc-meta { font-size: .8rem; color: var(--text-muted); margin-bottom: .8rem; }
.aqc-actions { display: flex; gap: .5rem; }
.aqc-empty-slot { text-align: center; padding: 1rem 0; }
.aqc-empty-slot span { font-size: .75rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); display: block; margin-bottom: .3rem; }
.aqc-empty-slot p { font-size: .83rem; color: var(--text-muted); margin-bottom: .7rem; }
.admin-quick-actions { display: flex; gap: 1rem; margin-top: 1rem; }

/* Student performance helpers */
.mini-progress { width: 100%; background: var(--border); border-radius: 99px; height: 5px; margin-top: .3rem; }
.mini-bar { height: 100%; background: var(--primary); border-radius: 99px; }
.mini-bar-fail { background: var(--danger); }
.score-pill { display: inline-block; padding: .15rem .55rem; border-radius: 99px; font-size: .82rem; font-weight: 700; }
.score-pass { background: #d1fae5; color: #065f46; }
.score-fail { background: #fee2e2; color: #991b1b; }
.cert-dot { display: inline-block; width: 26px; height: 26px; border-radius: 50%; font-size: .7rem; font-weight: 700; text-align: center; line-height: 26px; margin-right: .2rem; }
.cert-earned { background: var(--gold); color: #1a1100; }
.cert-empty  { background: var(--border); color: var(--text-muted); }

/* Student detail */
.cert-list { display: flex; flex-direction: column; gap: .6rem; }
.cert-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .7rem 1rem;
  background: var(--gold-light);
  border-radius: var(--radius-sm);
  border: 1px solid #e8d5a0;
  flex-wrap: wrap;
}
.cert-level { font-weight: 800; font-size: .88rem; }
.cert-code  { font-family: monospace; font-size: .82rem; color: var(--text-muted); }
.cert-date  { font-size: .82rem; color: var(--text-muted); margin-left: auto; }
.cert-score { font-weight: 700; color: var(--primary); font-size: .88rem; }

/* ── Quiz Builder Form ────────────────────────────────────── */
.quiz-builder-form { display: flex; flex-direction: column; gap: 1.5rem; }
.form-section {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow);
}
.form-section-title { font-size: 1rem; font-weight: 800; margin-bottom: 1.2rem; }
.form-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; }
.form-section-head .form-section-title { margin-bottom: 0; }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.form-row .form-group { flex: 1; min-width: 160px; }
.form-row .flex-2 { flex: 2; }
.form-actions { display: flex; justify-content: flex-end; gap: 1rem; }

/* Question builder */
.question-builder {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 1.2rem;
  border: 1.5px solid var(--border);
  margin-bottom: 1rem;
}
.qb-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.qb-num { font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--primary); }
.options-grid { display: flex; flex-direction: column; gap: .5rem; margin-top: .8rem; }
.option-builder { display: flex; align-items: center; gap: .7rem; }
.opt-letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-size: .8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.option-builder input[type=text] { flex: 1; }
.correct-radio { display: flex; align-items: center; gap: .35rem; font-size: .82rem; font-weight: 600; color: var(--success); cursor: pointer; white-space: nowrap; }
.empty-questions { text-align: center; padding: 2rem; color: var(--text-muted); background: var(--surface2); border-radius: var(--radius-sm); border: 2px dashed var(--border); }

/* ── Error page ───────────────────────────────────────────── */
.error-page { text-align: center; padding: 6rem 2rem; }
.error-icon { font-size: 4rem; margin-bottom: 1rem; }
.error-page h1 { font-size: 3rem; font-weight: 800; color: var(--primary); margin-bottom: .5rem; }
.error-page p { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 1.05rem; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 2rem; }
  .hero-visual { display: none; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; height: auto; display: flex; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .sidebar-nav { flex-direction: row; }
  .result-hero { flex-direction: column; text-align: center; }
  .cert-banner { flex-direction: column; text-align: center; }
  .cert-banner .btn-cert { margin-left: 0; }
}

@media (max-width: 600px) {
  .hero-title { font-size: 2rem; }
  .hero-stats { gap: 1rem; }
  .quiz-slots { grid-template-columns: 1fr 1fr; }
  .result-stats { gap: 1rem; }
  .quiz-submit-row { flex-direction: column; gap: .8rem; }
  .result-actions { flex-direction: column; }
}
