/* =============================================================
   Quran Exam — Stylesheet
   Theme: Deep Forest Green #1B4332 | Warm Gold #C9A84C
   Font: Vazirmatn | Direction: RTL
============================================================= */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');

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

:root {
  --green:      #1B4332;
  --green-2:    #2D6A4F;
  --green-3:    #40916C;
  --green-4:    #52B788;
  --gold:       #C9A84C;
  --gold-2:     #E8C97A;
  --gold-3:     #F5E09A;
  --gold-dim:   rgba(201,168,76,.15);
  --bg:         #F4F6F3;
  --bg-2:       #ECEEE9;
  --white:      #FFFFFF;
  --gray:       #F0F2EE;
  --gray-2:     #DDE0D9;
  --gray-3:     #B5B9B2;
  --text:       #1A1E18;
  --text-2:     #3D4239;
  --text-3:     #727870;
  --red:        #C62828;
  --red-bg:     #FFF0F0;
  --green-bg:   #EDF7F2;
  --radius:     14px;
  --radius-sm:  8px;
  --shadow:     0 2px 14px rgba(27,67,50,.09);
  --shadow-md:  0 4px 24px rgba(27,67,50,.13);
  --shadow-lg:  0 8px 40px rgba(27,67,50,.18);
  --border:     1px solid rgba(27,67,50,.10);
  --tr:         .22s cubic-bezier(.4,0,.2,1);
}

html { scroll-behavior: smooth; font-size: 15px; }
body {
  font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
  direction: rtl;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--green-2); text-decoration: none; transition: color var(--tr); }
a:hover { color: var(--green); }
img { max-width: 100%; display: block; }
svg { flex-shrink: 0; }

/* ── Geo border ────────────────────────────────────────────── */
.geo-border-bottom {
  height: 3px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-2) 30%, var(--gold) 70%, var(--green-3) 100%);
  opacity: .8;
}
.geo-border-top {
  height: 4px;
  background: linear-gradient(90deg, var(--green) 0%, var(--gold) 25%, var(--gold-2) 50%, var(--gold) 75%, var(--green) 100%);
}

/* ── Header ────────────────────────────────────────────────── */
.site-header {
  background: linear-gradient(160deg, #132f25 0%, var(--green) 45%, #1e5040 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 4px 24px rgba(0,0,0,.28);
}
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 50%, rgba(201,168,76,.07) 0%, transparent 50%),
                    radial-gradient(circle at 80% 50%, rgba(201,168,76,.05) 0%, transparent 50%);
  pointer-events: none;
}
.hdr-top {
  position: relative;
  padding: 12px 20px 10px;
  text-align: center;
}
.hdr-icon {
  width: 48px; height: 48px;
  margin: 0 auto 6px;
  display: block;
}
.hdr-sub    { color: rgba(255,255,255,.65); font-size: 11px; font-weight: 400; }
.hdr-main   { color: var(--gold); font-size: 16px; font-weight: 700; line-height: 1.4; margin: 2px 0; }
.hdr-lesson { color: rgba(255,255,255,.55); font-size: 12px; }

.hdr-bar {
  background: rgba(0,0,0,.18);
  display: flex;
  align-items: center;
  padding: 0 20px;
  min-height: 40px;
}
.hdr-links { display: flex; align-items: center; gap: 6px; margin-right: auto; }
.hdr-link {
  color: rgba(255,255,255,.8);
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 5px;
  transition: background var(--tr), color var(--tr);
  white-space: nowrap;
}
.hdr-link:hover, .hdr-link.active { color: var(--gold); background: rgba(201,168,76,.13); }
.hdr-logout { color: #f87171 !important; }
.hdr-user-chip {
  display: flex; align-items: center; gap: 5px;
  color: var(--gold-2); font-size: 13px; padding: 4px 10px;
  background: rgba(201,168,76,.12); border-radius: 20px;
}

/* ── Flash ─────────────────────────────────────────────────── */
.flash-wrap { padding: 8px 16px 0; }
.flash {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-radius: var(--radius-sm);
  margin-bottom: 6px; font-size: 14px; font-weight: 500;
}
.flash-info    { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.flash-warning { background: var(--gold-3); color: #78350f; border: 1px solid var(--gold-2); }
.flash-danger  { background: var(--red-bg); color: var(--red); border: 1px solid #fca5a5; }
.flash-x { background: none; border: none; cursor: pointer; font-size: 18px; opacity: .5; }

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

/* ── Footer ────────────────────────────────────────────────── */
.site-footer {
  background: var(--green);
  color: rgba(255,255,255,.55);
  text-align: center;
  padding: 20px;
  font-size: 12px;
  margin-top: auto;
}
.footer-sub { margin-top: 4px; opacity: .7; }

/* ════════════════════════════════════════════════════════════
   LOGIN PAGE
════════════════════════════════════════════════════════════ */
.login-body { background: linear-gradient(145deg, #0d2b1f 0%, #1B4332 40%, #2D6A4F 100%); }
.login-body .main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px 40px; }

.login-page {
  width: 100%; max-width: 480px;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  position: relative;
}

.login-bg-pattern {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(circle at 15% 25%, rgba(201,168,76,.06) 0%, transparent 40%),
    radial-gradient(circle at 85% 75%, rgba(201,168,76,.04) 0%, transparent 40%),
    repeating-linear-gradient(45deg, transparent, transparent 40px, rgba(255,255,255,.01) 40px, rgba(255,255,255,.01) 41px);
}

.login-card {
  background: rgba(255,255,255,.97);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35), 0 0 0 1px rgba(201,168,76,.3);
  padding: 32px 28px 24px;
  width: 100%;
  position: relative; z-index: 1;
}

.login-card-header { text-align: center; margin-bottom: 20px; }
.login-emblem { width: 80px; height: 80px; margin: 0 auto 12px; }
.login-emblem svg { width: 100%; height: 100%; }
.login-title { font-size: 20px; font-weight: 700; color: var(--green); margin-bottom: 4px; }
.login-subtitle { color: var(--text-3); font-size: 13px; }

.login-info-strip {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; background: var(--green-bg); border-radius: 10px;
  padding: 10px 14px; margin-bottom: 16px;
  font-size: 13px; color: var(--text-2);
}
.lis-item { display: flex; align-items: center; gap: 6px; }
.lis-item svg { width: 14px; height: 14px; color: var(--green-2); }
.lis-sep { width: 1px; height: 18px; background: var(--gray-2); }

.login-countdown {
  background: var(--green); border-radius: 12px;
  padding: 14px 18px; margin-bottom: 16px; text-align: center;
}
.lcd-label {
  color: rgba(255,255,255,.7); font-size: 12px; margin-bottom: 10px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.lcd-label svg { width: 13px; height: 13px; }
.lcd-boxes { display: flex; align-items: center; justify-content: center; gap: 4px; }
.lcd-box {
  background: rgba(0,0,0,.25); border-radius: 8px;
  padding: 8px 12px; text-align: center; min-width: 54px;
}
.lcd-box span { display: block; font-size: 24px; font-weight: 700; color: var(--gold); line-height: 1; }
.lcd-box small { font-size: 10px; color: rgba(255,255,255,.5); }
.lcd-colon { color: var(--gold); font-size: 20px; font-weight: 700; padding-bottom: 10px; }

.login-live-badge {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: #dcfce7; color: #15803d;
  border: 1.5px solid #86efac; border-radius: 10px;
  padding: 10px 18px; font-weight: 600; font-size: 14px; margin-bottom: 16px;
}

.login-error {
  display: flex; align-items: center; gap: 8px;
  background: var(--red-bg); color: var(--red);
  border: 1px solid #fca5a5; border-radius: 8px;
  padding: 10px 14px; font-size: 13px; margin-bottom: 14px;
}
.login-error svg { width: 16px; height: 16px; flex-shrink: 0; }

.login-form { display: flex; flex-direction: column; gap: 14px; }

.lf-group { display: flex; flex-direction: column; gap: 6px; }
.lf-group label {
  font-size: 13px; font-weight: 600; color: var(--text-2);
  display: flex; align-items: center; gap: 6px;
}
.lf-group label svg { width: 14px; height: 14px; color: var(--green-2); }
.lf-group input {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--gray-2);
  border-radius: var(--radius-sm); font-family: inherit; font-size: 14px;
  background: var(--gray); color: var(--text); transition: border var(--tr), box-shadow var(--tr);
  text-align: right;
}
.lf-group input:focus {
  outline: none; border-color: var(--green-3);
  box-shadow: 0 0 0 3px rgba(64,145,108,.15);
}
.lf-group input[dir="ltr"] { text-align: left; }

.btn-login {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-2) 100%);
  color: #fff; font-family: inherit; font-size: 15px; font-weight: 600;
  padding: 13px; border: none; border-radius: var(--radius-sm);
  cursor: pointer; width: 100%; margin-top: 4px;
  transition: opacity var(--tr), transform var(--tr), box-shadow var(--tr);
  box-shadow: 0 4px 15px rgba(27,67,50,.35);
}
.btn-login svg { width: 18px; height: 18px; }
.btn-login:hover { opacity: .92; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(27,67,50,.4); }
.btn-login:active { transform: translateY(0); }

.login-note { font-size: 12px; color: var(--text-3); text-align: center; margin-top: 12px; }
.login-note a { color: var(--green-2); }

.login-meta {
  display: flex; gap: 16px; justify-content: center;
  position: relative; z-index: 1;
}
.lm-item {
  display: flex; align-items: center; gap: 6px;
  color: rgba(255,255,255,.6); font-size: 13px;
}
.lm-item svg { width: 14px; height: 14px; }

/* ════════════════════════════════════════════════════════════
   LIVE DOT
════════════════════════════════════════════════════════════ */
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #22c55e; display: inline-block;
  animation: livepulse 1.2s ease infinite;
}
@keyframes livepulse {
  0%,100%{ box-shadow: 0 0 0 0 rgba(34,197,94,.5); }
  50%    { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
}

/* ════════════════════════════════════════════════════════════
   DASHBOARD
════════════════════════════════════════════════════════════ */
.dash-page { max-width: 900px; margin: 0 auto; padding: 24px 16px 40px; }

.dash-welcome {
  display: flex; align-items: center; gap: 16px;
  background: var(--white); border-radius: var(--radius); padding: 18px 22px;
  box-shadow: var(--shadow); margin-bottom: 22px; border: var(--border);
}
.dash-avatar svg { width: 50px; height: 50px; flex-shrink: 0; }
.dash-name { font-size: 18px; font-weight: 700; color: var(--green); }
.dash-sid { font-size: 13px; color: var(--text-3); margin-top: 2px; }

.dash-countdown {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-2) 100%);
  border-radius: var(--radius); padding: 24px; margin-bottom: 22px;
  text-align: center; box-shadow: var(--shadow-md);
}
.dcd-label {
  color: rgba(255,255,255,.75); font-size: 13px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.dcd-label svg { width: 14px; height: 14px; }
.dcd-boxes { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 14px; }
.dcd-box {
  background: rgba(0,0,0,.22); border-radius: 12px;
  padding: 12px 20px; min-width: 72px; text-align: center;
}
.dcd-box span { display: block; font-size: 32px; font-weight: 800; color: var(--gold); line-height: 1; }
.dcd-box small { font-size: 11px; color: rgba(255,255,255,.5); }
.dcd-sep { color: var(--gold); font-size: 28px; font-weight: 700; padding-bottom: 14px; }
.dcd-date { color: rgba(255,255,255,.55); font-size: 13px; }

.dash-live-banner {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(90deg, #166534, #15803d);
  color: #fff; border-radius: var(--radius); padding: 16px 24px;
  font-size: 15px; font-weight: 600; margin-bottom: 22px;
  box-shadow: 0 4px 16px rgba(21,128,61,.4);
  animation: bannerPulse 2s ease infinite;
}
@keyframes bannerPulse {
  0%,100% { box-shadow: 0 4px 16px rgba(21,128,61,.4); }
  50%      { box-shadow: 0 4px 24px rgba(21,128,61,.65); }
}

.dash-ended-banner {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--red-bg); color: var(--red);
  border: 1.5px solid #fca5a5; border-radius: var(--radius);
  padding: 14px 24px; font-weight: 600; margin-bottom: 22px;
}
.dash-ended-banner svg { width: 18px; height: 18px; }

.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 24px; }
@media(max-width:640px){ .dash-grid { grid-template-columns: 1fr; } }

.dash-card {
  background: var(--white); border-radius: var(--radius);
  border: var(--border); box-shadow: var(--shadow); padding: 20px;
}
.dash-card-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 700; color: var(--green);
  border-bottom: 1.5px solid var(--gray-2); padding-bottom: 12px; margin-bottom: 14px;
}
.dash-card-title svg { width: 16px; height: 16px; }

.dash-info-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.dash-info-list li { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.dil-label {
  display: flex; align-items: center; gap: 6px;
  color: var(--text-3); font-size: 12px; white-space: nowrap; flex-shrink: 0;
}
.dil-label svg { width: 13px; height: 13px; }
.dil-val { font-size: 13px; font-weight: 500; color: var(--text); text-align: left; }

.rules-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.rules-list li {
  font-size: 13px; color: var(--text-2); padding-right: 18px;
  position: relative; line-height: 1.6;
}
.rules-list li::before {
  content: '•'; color: var(--gold); position: absolute; right: 0; font-size: 16px; top: -1px;
}

.dash-cta { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }

.btn-dash-start {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-2) 100%);
  color: #fff; font-family: inherit; font-size: 17px; font-weight: 700;
  padding: 16px 40px; border: none; border-radius: 50px;
  cursor: pointer; box-shadow: 0 6px 24px rgba(27,67,50,.4);
  transition: all var(--tr); text-decoration: none;
}
.btn-dash-start svg { width: 20px; height: 20px; }
.btn-dash-start:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(27,67,50,.5); color: #fff; }
.btn-dash-start:active:not(:disabled) { transform: translateY(0); }
.btn-disabled { background: var(--gray-2) !important; color: var(--text-3) !important; cursor: not-allowed !important; box-shadow: none !important; }
.btn-ended { background: #e5e7eb !important; }
.btn-dash-resume { background: linear-gradient(135deg, #b45309, #d97706) !important; }
.btn-dash-test   { background: linear-gradient(135deg, #6d28d9, #7c3aed) !important; box-shadow: 0 6px 24px rgba(109,40,217,.4) !important; }

.dash-submitted-badge {
  display: flex; align-items: center; gap: 8px;
  background: #dcfce7; color: #15803d;
  border: 1.5px solid #86efac; border-radius: 10px;
  padding: 12px 20px; font-weight: 600; font-size: 15px;
}
.dash-submitted-badge svg { width: 18px; height: 18px; }
.btn-dash-result {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--green-bg); color: var(--green-2);
  border: 1.5px solid var(--green-4); border-radius: 50px;
  padding: 10px 24px; font-weight: 600; font-size: 14px;
  transition: all var(--tr);
}
.btn-dash-result:hover { background: var(--green-2); color: #fff; }

.dash-cta-note { font-size: 12px; color: var(--text-3); }
.dash-resume-note { font-size: 13px; color: #b45309; font-weight: 500; }

/* ════════════════════════════════════════════════════════════
   EXAM PAGE  —  fully scrollable, sticky topbar + sticky bottom nav
════════════════════════════════════════════════════════════ */
body.exam-body { background: #f0f4f1; }

.exam-shell {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 12px 80px;   /* bottom padding keeps content above sticky bar */
}

/* ── Sticky top bar ── */
.exam-topbar {
  position: sticky; top: 0; z-index: 90;
  display: flex; align-items: center; gap: 12px;
  background: var(--white);
  border-bottom: 2px solid var(--gray-2);
  padding: 10px 16px; margin: 0 -12px 12px;
  box-shadow: 0 2px 12px rgba(27,67,50,.12);
}
.etb-timer {
  display: flex; align-items: center; gap: 8px;
  background: var(--green-bg); border: 1.5px solid var(--green-4);
  border-radius: 8px; padding: 7px 14px; white-space: nowrap;
  transition: background var(--tr), border-color var(--tr);
}
.etb-timer svg { width: 16px; height: 16px; color: var(--green-3); }
#timer-display { font-size: 20px; font-weight: 800; color: var(--green); font-variant-numeric: tabular-nums; }
.etb-timer.timer-warning { background: #fff8e1; border-color: #f59e0b; }
.etb-timer.timer-warning svg,
.etb-timer.timer-warning #timer-display { color: #b45309; }
.etb-timer.timer-danger { background: var(--red-bg); border-color: #f87171; animation: timerPulse .7s ease infinite; }
.etb-timer.timer-danger svg,
.etb-timer.timer-danger #timer-display { color: var(--red); }
@keyframes timerPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(198,40,40,.3); }
  50%      { box-shadow: 0 0 0 6px rgba(198,40,40,0); }
}
.etb-progress-wrap { flex: 1; min-width: 0; }
.etb-progress-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); margin-bottom: 5px; }
#q-num { font-weight: 600; color: var(--green); }
.etb-progress-bar { height: 6px; background: var(--gray-2); border-radius: 3px; overflow: hidden; }
.etb-progress-fill { height: 100%; background: linear-gradient(90deg, var(--green-3), var(--green-4)); border-radius: 3px; transition: width .4s ease; }
.etb-score-info { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.etb-score-info svg { width: 13px; height: 13px; color: var(--gold); }

/* ── Question navigator dots ── */
.exam-nav-wrap {
  background: var(--white); border-radius: var(--radius);
  padding: 10px 14px; margin-bottom: 12px;
  box-shadow: var(--shadow); overflow-x: auto;
}
.exam-nav { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.enav-dot {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--gray-2); background: var(--gray);
  color: var(--text-3); font-size: 11px; font-weight: 600;
  cursor: pointer; transition: all var(--tr);
  display: flex; align-items: center; justify-content: center;
  font-family: inherit; flex-shrink: 0;
}
.enav-dot.dot-current   { background: var(--gold); border-color: var(--gold); color: #fff; transform: scale(1.12); }
.enav-dot.dot-answered  { background: var(--green-bg); border-color: var(--green-4); color: var(--green-2); }
.enav-dot.dot-unanswered{ background: var(--gray); border-color: var(--gray-2); color: var(--text-3); }
.enav-dot:hover:not(.dot-current) { border-color: var(--green-3); color: var(--green-2); }

/* ── Question card ── */
.exam-body-area { display: flex; flex-direction: column; }

.exam-question {
  background: var(--white); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-md);
}
.eq-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.eq-num { font-size: 13px; font-weight: 700; color: var(--green-2); background: var(--green-bg); border-radius: 6px; padding: 3px 10px; }
.eq-pts { font-size: 12px; color: var(--text-3); background: var(--gray); border-radius: 6px; padding: 3px 10px; }
.eq-text { font-size: 17px; font-weight: 600; color: var(--text); line-height: 1.8; margin-bottom: 20px; }
.eq-options { display: flex; flex-direction: column; gap: 10px; }

.eq-opt {
  display: flex; align-items: center;
  border: 2px solid var(--gray-2); border-radius: 10px;
  cursor: pointer; overflow: hidden;
  transition: border-color var(--tr), background var(--tr), box-shadow var(--tr);
}
.eq-opt input[type="radio"] { display: none; }
.eq-opt-letter {
  background: var(--gray); color: var(--text-3);
  font-size: 13px; font-weight: 700; padding: 13px 15px;
  border-left: 2px solid var(--gray-2); transition: all var(--tr);
  min-width: 44px; text-align: center; flex-shrink: 0;
}
.eq-opt-text { padding: 13px 16px; font-size: 15px; color: var(--text); flex: 1; line-height: 1.5; }
.eq-opt:hover { border-color: var(--green-3); background: #f0f7f4; box-shadow: 0 2px 8px rgba(64,145,108,.12); }
.eq-opt:hover .eq-opt-letter { background: var(--green-bg); color: var(--green-2); border-left-color: var(--green-4); }
.eq-opt-selected { border-color: var(--green-3) !important; background: var(--green-bg) !important; box-shadow: 0 0 0 3px rgba(64,145,108,.15) !important; }
.eq-opt-selected .eq-opt-letter { background: var(--green-3) !important; color: #fff !important; border-left-color: var(--green-2) !important; }

/* ── Per-question inline nav (inside card, below options) ── */
.eq-nav-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 22px; padding-top: 18px;
  border-top: 1.5px solid var(--gray-2); gap: 10px;
}
.btn-eq-nav {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: 10px;
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all var(--tr); white-space: nowrap;
}
.btn-eq-nav svg { width: 17px; height: 17px; flex-shrink: 0; }
.btn-eq-prev { background: var(--gray); color: var(--text-2); border: 1.5px solid var(--gray-2); }
.btn-eq-prev:hover { background: var(--bg-2); border-color: var(--gray-3); }
.btn-eq-next { background: linear-gradient(135deg, var(--green), var(--green-2)); color: #fff; border: none; box-shadow: 0 3px 12px rgba(27,67,50,.3); }
.btn-eq-next:hover { opacity: .9; transform: translateY(-1px); }
.btn-eq-submit { background: linear-gradient(135deg, #1B4332, #b45309); color: #fff; border: none; box-shadow: 0 3px 12px rgba(27,67,50,.3); font-size: 15px; }
.btn-eq-submit:hover { opacity: .9; transform: translateY(-1px); }

/* ── Sticky bottom navigation bar (always visible) ── */
.exam-footer-sticky {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 95;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--white);
  border-top: 2px solid var(--gray-2);
  padding: 10px 16px 12px;
  box-shadow: 0 -4px 20px rgba(27,67,50,.13);
}
.btn-exam-nav {
  display: flex; align-items: center; gap: 6px;
  background: var(--gray); color: var(--text-2);
  border: 1.5px solid var(--gray-2); border-radius: 8px;
  padding: 10px 16px; font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all var(--tr); white-space: nowrap;
}
.btn-exam-nav svg { width: 16px; height: 16px; }
.btn-exam-nav:hover:not(:disabled) { background: var(--green-bg); border-color: var(--green-4); color: var(--green-2); }
.btn-exam-nav:disabled { opacity: .35; cursor: not-allowed; }

.btn-exam-submit-main {
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-2) 100%);
  color: #fff; border: none; border-radius: 10px;
  padding: 11px 22px; font-family: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer; box-shadow: 0 4px 14px rgba(27,67,50,.35);
  transition: all var(--tr); white-space: nowrap;
}
.btn-exam-submit-main svg { width: 17px; height: 17px; }
.btn-exam-submit-main:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(27,67,50,.45); }

/* ── Confirm / alert modals (exam + admin) ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.55); backdrop-filter: blur(2px);
  display: none; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-box {
  background: var(--white); border-radius: 16px;
  padding: 32px 28px 24px; width: 100%; max-width: 460px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  text-align: center; animation: modalIn .22s ease;
}
@keyframes modalIn {
  from { opacity:0; transform: scale(.92) translateY(10px); }
  to   { opacity:1; transform: scale(1)  translateY(0); }
}
.modal-icon { width: 52px; height: 52px; margin: 0 auto 14px; color: var(--gold); }
.modal-icon svg { width: 52px; height: 52px; }
.modal-box h3 { font-size: 18px; font-weight: 700; color: var(--green); margin-bottom: 10px; }
.modal-box p  { color: var(--text-2); font-size: 14px; line-height: 1.7; margin-bottom: 10px; }
.modal-stats  { font-size: 13px; color: var(--text-3); background: var(--gray); border-radius: 8px; padding: 8px 14px; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }
.modal-btn {
  padding: 11px 26px; border-radius: 10px; font-family: inherit;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all var(--tr); border: none;
}
.modal-btn-cancel  { background: var(--gray); color: var(--text-2); border: var(--border); }
.modal-btn-cancel:hover  { background: var(--bg-2); }
.modal-btn-confirm { background: linear-gradient(135deg, var(--green), var(--green-2)); color: #fff; box-shadow: 0 3px 12px rgba(27,67,50,.3); }
.modal-btn-confirm:hover { opacity: .9; transform: translateY(-1px); }

/* ── Time warning toast ── */
.time-toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: #1c1c1e; color: #fff; border-radius: 12px;
  padding: 12px 20px; display: none; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 500; z-index: 400;
  box-shadow: 0 6px 24px rgba(0,0,0,.35); white-space: nowrap;
  opacity: 0; transition: opacity .4s ease;
}
.time-toast.toast-show { opacity: 1; }
.time-toast svg { width: 18px; height: 18px; color: var(--gold); flex-shrink: 0; }

/* ════════════════════════════════════════════════════════════
   RESULT PAGE
════════════════════════════════════════════════════════════ */
.result-page { max-width: 800px; margin: 0 auto; padding: 24px 16px 40px; }

.result-hero {
  background: linear-gradient(145deg, var(--green) 0%, var(--green-2) 100%);
  border-radius: 20px; padding: 32px 24px 28px;
  text-align: center; margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
}
.rh-circle-wrap {
  position: relative; display: inline-flex;
  align-items: center; justify-content: center; margin-bottom: 16px;
}
.rh-ring { width: 140px; height: 140px; transform: rotate(-90deg); }
.rh-ring-bg { stroke: rgba(255,255,255,.15); }
.rh-ring-fill { stroke: var(--gold); stroke-linecap: round; }
.rh-score-inner {
  position: absolute; display: flex; flex-direction: column; align-items: center;
}
.rh-score-num { font-size: 34px; font-weight: 800; color: var(--gold); line-height: 1; }
.rh-score-of  { font-size: 12px; color: rgba(255,255,255,.6); margin-top: 2px; }

.rh-grade {
  display: inline-block; border-radius: 20px; padding: 5px 18px;
  font-size: 14px; font-weight: 700; margin-bottom: 12px;
}
.rh-grade-excellent { background: var(--gold); color: var(--green); }
.rh-grade-good      { background: #86efac; color: #166534; }
.rh-grade-pass      { background: #fde68a; color: #92400e; }
.rh-grade-fail      { background: #fca5a5; color: #991b1b; }

.rh-name { font-size: 20px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.rh-subtitle { font-size: 13px; color: rgba(255,255,255,.6); }

.result-stats {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 16px;
}
@media(max-width:580px){ .result-stats { grid-template-columns: 1fr 1fr; } }

.rs-card {
  background: var(--white); border-radius: var(--radius);
  padding: 16px; text-align: center; box-shadow: var(--shadow); border: var(--border);
}
.rs-num { font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.rs-label {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  font-size: 12px; color: var(--text-3);
}
.rs-label svg { width: 13px; height: 13px; }
.rs-correct .rs-num { color: var(--green-3); }
.rs-correct .rs-label svg { color: var(--green-3); }
.rs-wrong .rs-num { color: var(--red); }
.rs-wrong .rs-label svg { color: var(--red); }
.rs-skip .rs-num { color: var(--text-3); }
.rs-time .rs-num { color: var(--green-2); font-size: 22px; }

.result-meta {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  font-size: 13px; color: var(--text-3); margin-bottom: 24px;
}
.result-meta svg { width: 14px; height: 14px; }

.result-breakdown { margin-bottom: 24px; }
.rb-title {
  font-size: 16px; font-weight: 700; color: var(--green);
  margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.rb-title::before {
  content: ''; display: block; width: 4px; height: 18px;
  background: var(--gold); border-radius: 2px;
}
.rb-list { display: flex; flex-direction: column; gap: 10px; }
.rb-item {
  display: flex; gap: 12px; background: var(--white);
  border-radius: var(--radius-sm); padding: 14px; border: var(--border);
  box-shadow: var(--shadow-xs);
}
.rb-ok   { border-right: 4px solid var(--green-4); }
.rb-wrong{ border-right: 4px solid var(--red); }
.rb-skip { border-right: 4px solid var(--gray-3); }
.rb-q-num {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.rb-ok   .rb-q-num { background: var(--green-bg); color: var(--green-3); }
.rb-ok   .rb-q-num svg { width: 14px; height: 14px; color: var(--green-3); }
.rb-wrong.rb-q-num { background: var(--red-bg); color: var(--red); }
.rb-wrong .rb-q-num { background: var(--red-bg); color: var(--red); }
.rb-wrong .rb-q-num svg { width: 14px; height: 14px; color: var(--red); }
.rb-skip .rb-q-num { background: var(--gray); color: var(--text-3); }
.rb-skip .rb-q-num svg { width: 14px; height: 14px; color: var(--text-3); }

.rb-q-body { flex: 1; }
.rb-q-text { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 6px; line-height: 1.5; }
.rb-ans-row { display: flex; flex-wrap: wrap; gap: 8px; }
.rb-your-ans, .rb-correct-ans { font-size: 12px; border-radius: 5px; padding: 2px 8px; }
.rb-ans-ok   { background: var(--green-bg); color: var(--green-2); }
.rb-ans-bad  { background: var(--red-bg); color: var(--red); }
.rb-ans-skip { background: var(--gray); color: var(--text-3); }
.rb-correct-ans { background: var(--green-bg); color: var(--green-2); }

.result-actions { text-align: center; }
.btn-result-back {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--white); color: var(--green-2);
  border: 2px solid var(--green-4); border-radius: 50px;
  padding: 11px 26px; font-size: 14px; font-weight: 600;
  transition: all var(--tr);
}
.btn-result-back svg { width: 16px; height: 16px; }
.btn-result-back:hover { background: var(--green-2); color: #fff; border-color: var(--green-2); }

/* ════════════════════════════════════════════════════════════
   ADMIN PANEL
════════════════════════════════════════════════════════════ */
.admin-page { max-width: 1100px; margin: 0 auto; padding: 24px 16px 40px; }

.admin-page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 22px; gap: 12px;
}
.admin-page-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 20px; font-weight: 700; color: var(--green); margin-bottom: 4px;
}
.admin-page-title svg { width: 20px; height: 20px; }
.admin-page-sub { font-size: 13px; color: var(--text-3); }
.btn-admin-logout {
  background: var(--red-bg); color: var(--red);
  border: 1.5px solid #fca5a5; border-radius: 8px;
  padding: 8px 16px; font-size: 13px; font-weight: 600;
  white-space: nowrap; transition: all var(--tr);
}
.btn-admin-logout:hover { background: var(--red); color: #fff; }

.admin-stats {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 22px;
}
@media(max-width:640px){ .admin-stats { grid-template-columns: 1fr 1fr; } }

.ast-card {
  background: var(--white); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); border: var(--border);
  display: flex; align-items: center; gap: 14px;
}
.ast-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ast-icon svg { width: 20px; height: 20px; }
.ast-total .ast-icon { background: var(--green-bg); color: var(--green-3); }
.ast-avg   .ast-icon { background: #fef9c3; color: #a16207; }
.ast-max   .ast-icon { background: #ede9fe; color: #7c3aed; }
.ast-pass  .ast-icon { background: var(--green-bg); color: var(--green-2); }
.ast-num  { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1; }
.ast-label{ font-size: 12px; color: var(--text-3); margin-top: 3px; }

.admin-toolbar {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
}
.atb-search-wrap {
  flex: 1; display: flex; align-items: center; gap: 8px;
  background: var(--white); border: var(--border); border-radius: 9px; padding: 0 14px;
}
.atb-search-wrap svg { width: 15px; height: 15px; color: var(--text-3); flex-shrink: 0; }
.atb-search-wrap input {
  flex: 1; border: none; background: none; padding: 10px 0;
  font-family: inherit; font-size: 14px; color: var(--text);
}
.atb-search-wrap input:focus { outline: none; }

.btn-export {
  display: flex; align-items: center; gap: 6px;
  background: var(--white); border: var(--border); border-radius: 8px;
  padding: 9px 16px; font-family: inherit; font-size: 13px; font-weight: 600;
  color: var(--text-2); cursor: pointer; white-space: nowrap;
  transition: all var(--tr);
}
.btn-export svg { width: 14px; height: 14px; }
.btn-export:hover { background: var(--green-bg); border-color: var(--green-4); color: var(--green-2); }

.admin-table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
.admin-table {
  width: 100%; border-collapse: collapse; background: var(--white);
  font-size: 13px;
}
.admin-table th {
  background: var(--green); color: rgba(255,255,255,.9);
  padding: 11px 14px; text-align: right; font-weight: 600; white-space: nowrap;
}
.admin-table th.sortable { cursor: pointer; user-select: none; }
.admin-table th.sortable:hover { background: var(--green-2); }
.sort-icon { opacity: .5; font-size: 11px; }
.admin-table td {
  padding: 10px 14px; border-bottom: 1px solid var(--gray);
  color: var(--text); vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--green-bg); }
.row-pass td { }
.row-fail td { }
.td-num { color: var(--text-3); font-size: 12px; text-align: center; }
.td-sid { font-family: monospace; font-size: 13px; }
.td-date { font-size: 12px; color: var(--text-3); }

.score-badge {
  display: inline-block; border-radius: 6px; padding: 3px 10px;
  font-weight: 700; font-size: 12px;
}
.sb-pass { background: #dcfce7; color: #15803d; }
.sb-fail { background: var(--red-bg); color: var(--red); }

.btn-detail {
  background: var(--gray); border: var(--border); border-radius: 6px;
  padding: 5px 12px; font-family: inherit; font-size: 12px;
  cursor: pointer; transition: all var(--tr); color: var(--text-2);
}
.btn-detail:hover { background: var(--green-bg); border-color: var(--green-4); color: var(--green-2); }

.btn-reset {
  background: #fff0f0; border: 1.5px solid #fca5a5; border-radius: 6px;
  padding: 5px 12px; font-family: inherit; font-size: 12px;
  cursor: pointer; transition: all var(--tr); color: #dc2626;
}
.btn-reset:hover { background: #fef2f2; border-color: #dc2626; }

.admin-empty {
  background: var(--white); border-radius: var(--radius);
  padding: 48px; text-align: center; color: var(--text-3);
  border: var(--border); box-shadow: var(--shadow);
}
.admin-empty svg { width: 56px; height: 56px; margin: 0 auto 14px; opacity: .35; }

/* Detail modal (wide) */
.modal-wide {
  max-width: 680px; text-align: right;
  max-height: 80vh; overflow: hidden; display: flex; flex-direction: column;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; flex-shrink: 0;
}
.modal-header h3 { font-size: 16px; font-weight: 700; color: var(--green); }
.modal-close-btn {
  background: none; border: none; font-size: 22px; cursor: pointer;
  color: var(--text-3); line-height: 1;
}
.detail-body { overflow-y: auto; flex: 1; }
.detail-student {
  background: var(--green-bg); border-radius: 8px; padding: 10px 14px;
  font-size: 13px; margin-bottom: 14px; color: var(--green-2);
}
.detail-qs { display: flex; flex-direction: column; gap: 10px; }
.dq-row {
  display: flex; gap: 10px; padding: 10px;
  border-radius: 8px; border: 1px solid var(--gray-2);
}
.dq-ok   { border-color: var(--green-4); background: #f0faf5; }
.dq-bad  { border-color: #fca5a5; background: var(--red-bg); }
.dq-skip { background: var(--gray); }
.dq-icon {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; margin-top: 2px;
}
.dq-ok   .dq-icon { background: var(--green-3); color: #fff; }
.dq-bad  .dq-icon { background: var(--red); color: #fff; }
.dq-skip .dq-icon { background: var(--gray-2); color: var(--text-3); }
.dq-text { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.dq-your { font-size: 12px; color: var(--text-3); }
.dq-skip-text { color: var(--gray-3); }
.dq-correct { font-size: 12px; color: var(--green-2); font-weight: 500; margin-top: 2px; }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════════════ */
@media(max-width:500px){
  .exam-shell { padding: 0 6px; }
  .eq-text { font-size: 15px; }
  .eq-opt-text { font-size: 13px; }
  .dcd-box span { font-size: 26px; }
  .dcd-box { padding: 10px 14px; min-width: 60px; }
}
