/* ============================================================
   MOCKERLY — Enterprise Design System
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

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

:root {
  /* Brand */
  --brand:        #6366f1;
  --brand-dark:   #4f46e5;
  --brand-deeper: #3730a3;
  --brand-light:  #e0e7ff;
  --brand-glow:   rgba(99,102,241,.15);

  /* Neutrals */
  --white:   #ffffff;
  --gray-50: #f8fafc;
  --gray-100:#f1f5f9;
  --gray-200:#e2e8f0;
  --gray-300:#cbd5e1;
  --gray-400:#94a3b8;
  --gray-500:#64748b;
  --gray-600:#475569;
  --gray-700:#334155;
  --gray-800:#1e293b;
  --gray-900:#0f172a;

  /* Semantic */
  --success:      #10b981;
  --success-bg:   #d1fae5;
  --danger:       #ef4444;
  --danger-bg:    #fee2e2;
  --warning:      #f59e0b;
  --warning-bg:   #fef3c7;
  --info:         #3b82f6;
  --info-bg:      #dbeafe;

  /* Layout */
  --sidebar-w:    240px;
  --topbar-h:     64px;
  --radius-sm:    6px;
  --radius:       10px;
  --radius-lg:    14px;
  --radius-xl:    20px;
  --radius-full:  9999px;

  /* Shadows */
  --shadow-xs:  0 1px 2px rgba(0,0,0,.05);
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08),0 1px 2px rgba(0,0,0,.04);
  --shadow:     0 4px 6px -1px rgba(0,0,0,.07),0 2px 4px -1px rgba(0,0,0,.05);
  --shadow-lg:  0 10px 25px -3px rgba(0,0,0,.08),0 4px 6px -2px rgba(0,0,0,.03);
  --shadow-xl:  0 20px 40px -8px rgba(0,0,0,.12),0 8px 16px -4px rgba(0,0,0,.06);

  /* Transition */
  --ease: cubic-bezier(.4,0,.2,1);
  --t:    150ms;
}

/* ── BASE ──────────────────────────────────────────── */
html { scroll-behavior: smooth; }
body { font-family: 'Inter', system-ui, -apple-system, sans-serif; background: var(--gray-50); color: var(--gray-900); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
img { max-width: 100%; }

/* ── LAYOUT MODES ──────────────────────────────────── */
/* Public layout: no sidebar */
body.layout-public  #sidebar { display: none; }
body.layout-public  #mainWrap { margin-left: 0; }
body.layout-public  #publicNav { display: flex; }

/* App layout: sidebar visible */
body.layout-app    #publicNav { display: none; }
body.layout-app    #sidebar { display: flex; }
body.layout-app    #mainWrap { margin-left: var(--sidebar-w); }

/* ── PUBLIC NAV ────────────────────────────────────── */
#publicNav {
  position: sticky; top: 0; z-index: 200;
  height: var(--topbar-h); background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--gray-200);
  align-items: center; justify-content: space-between;
  padding: 0 1.5rem; gap: 1rem; display: none;
}
.nav-brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.15rem; color: var(--gray-900); }
.brand-icon { width: 32px; height: 32px; background: linear-gradient(135deg,var(--brand),var(--brand-dark)); border-radius: 9px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 900; font-size: .9rem; box-shadow: 0 2px 8px var(--brand-glow); }
.pub-nav-links { display: flex; align-items: center; gap: .25rem; }
.pub-nav-links a { font-size: .875rem; font-weight: 500; color: var(--gray-600); padding: .4rem .75rem; border-radius: var(--radius-sm); transition: var(--t) var(--ease); }
.pub-nav-links a:hover { color: var(--brand); background: var(--brand-light); }

/* ── SIDEBAR ───────────────────────────────────────── */
#sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w); z-index: 300;
  background: var(--gray-900); flex-direction: column;
  display: none; overflow: hidden;
}
.sidebar-head {
  height: var(--topbar-h); display: flex; align-items: center;
  padding: 0 1.25rem; border-bottom: 1px solid rgba(255,255,255,.07); flex-shrink: 0;
}
.sidebar-brand { display: flex; align-items: center; gap: .6rem; color: #fff; font-weight: 800; font-size: 1.1rem; }
.sidebar-brand .brand-icon { background: linear-gradient(135deg,var(--brand),var(--brand-dark)); }
.sidebar-nav { flex: 1; padding: .75rem .75rem; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.sidebar-section { font-size: .68rem; font-weight: 700; color: var(--gray-500); text-transform: uppercase; letter-spacing: .08em; padding: .6rem .5rem .3rem; margin-top: .5rem; }
.sidebar-link {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem .75rem; border-radius: var(--radius-sm);
  color: var(--gray-400); font-size: .875rem; font-weight: 500;
  cursor: pointer; transition: var(--t) var(--ease); text-decoration: none;
}
.sidebar-link:hover { color: #fff; background: rgba(255,255,255,.07); }
.sidebar-link.active { color: #fff; background: var(--brand); box-shadow: 0 2px 8px var(--brand-glow); }
.sidebar-link .icon { width: 18px; height: 18px; flex-shrink: 0; opacity: .7; }
.sidebar-link.active .icon { opacity: 1; }
.sidebar-foot {
  padding: .75rem; border-top: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; gap: .75rem;
}
.user-avatar {
  width: 34px; height: 34px; border-radius: var(--radius-full);
  background: linear-gradient(135deg,var(--brand),var(--brand-dark));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: .85rem; flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-info .name { font-size: .825rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info .email { font-size: .73rem; color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-logout { color: var(--gray-500); cursor: pointer; padding: .25rem; border-radius: 4px; transition: var(--t); flex-shrink: 0; }
.sidebar-logout:hover { color: var(--danger); }

/* ── MAIN WRAP ─────────────────────────────────────── */
#mainWrap { min-height: 100vh; transition: margin-left var(--t) var(--ease); }

/* App topbar */
#appTopbar {
  height: var(--topbar-h); background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: none; align-items: center;
  padding: 0 1.75rem; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}
body.layout-app #appTopbar { display: flex; }
.topbar-title { font-size: 1rem; font-weight: 700; color: var(--gray-900); }
.topbar-right { display: flex; align-items: center; gap: 1rem; }

/* ── PAGES ─────────────────────────────────────────── */
.page { display: none; }
.page.active { display: block; }
.page-body { padding: 2rem 1.75rem 4rem; }

/* ── BUTTONS ───────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .55rem 1.2rem; border-radius: var(--radius); border: none;
  cursor: pointer; font-size: .875rem; font-weight: 600; line-height: 1.4;
  transition: var(--t) var(--ease); text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 3px var(--brand-glow); }
.btn-primary:hover { background: var(--brand-dark); box-shadow: 0 4px 12px var(--brand-glow); transform: translateY(-1px); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); }
.btn-ghost:hover { background: var(--brand-light); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: .35rem .85rem; font-size: .8rem; }
.btn-lg { padding: .75rem 1.75rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }
.btn-icon { padding: .5rem; border-radius: var(--radius-sm); }

/* ── CARDS ─────────────────────────────────────────── */
.card {
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-xs);
}
.card-body { padding: 1.5rem; }
.card-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--gray-100); display: flex; align-items: center; justify-content: space-between; }
.card-header h3 { font-size: .95rem; font-weight: 700; color: var(--gray-800); }
.card-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--gray-100); background: var(--gray-50); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* ── STAT CARDS ────────────────────────────────────── */
.stat-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow-xs); position: relative; overflow: hidden; }
.stat-card::after { content: ''; position: absolute; top: 0; right: 0; width: 80px; height: 80px; border-radius: 0 0 0 80px; opacity: .06; }
.stat-card.indigo::after { background: var(--brand); }
.stat-card.green::after  { background: var(--success); }
.stat-card.amber::after  { background: var(--warning); }
.stat-card.blue::after   { background: var(--info); }
.stat-icon { width: 44px; height: 44px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; margin-bottom: 1rem; }
.stat-icon.indigo { background: var(--brand-light); }
.stat-icon.green  { background: var(--success-bg); }
.stat-icon.amber  { background: var(--warning-bg); }
.stat-icon.blue   { background: var(--info-bg); }
.stat-value { font-size: 2rem; font-weight: 800; color: var(--gray-900); line-height: 1.1; }
.stat-label { font-size: .78rem; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: .05em; margin-top: .35rem; }
.stat-trend { font-size: .8rem; font-weight: 600; margin-top: .5rem; }
.stat-trend.up   { color: var(--success); }
.stat-trend.down { color: var(--danger); }

/* ── FORMS ─────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-label { display: block; font-size: .8rem; font-weight: 600; color: var(--gray-700); margin-bottom: .4rem; letter-spacing: .01em; }
.form-control {
  width: 100%; padding: .6rem .9rem;
  border: 1.5px solid var(--gray-200); border-radius: var(--radius);
  font-size: .9rem; color: var(--gray-900); background: var(--white);
  transition: var(--t) var(--ease); outline: none;
  font-family: inherit;
}
.form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(99,102,241,.1); }
.form-control::placeholder { color: var(--gray-400); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.input-icon { position: relative; }
.input-icon .form-control { padding-left: 2.5rem; }
.input-icon svg { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--gray-400); pointer-events: none; }

/* ── BADGES ────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .65rem; border-radius: var(--radius-full); font-size: .72rem; font-weight: 700; letter-spacing: .02em; }
.badge-success { background: var(--success-bg); color: #065f46; }
.badge-danger  { background: var(--danger-bg);  color: #991b1b; }
.badge-info    { background: var(--info-bg);    color: #1e40af; }
.badge-warning { background: var(--warning-bg); color: #92400e; }
.badge-neutral { background: var(--gray-100);   color: var(--gray-600); }
.badge-brand   { background: var(--brand-light); color: var(--brand-dark); }
.badge-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ── ALERTS ────────────────────────────────────────── */
.alert { padding: .85rem 1.1rem; border-radius: var(--radius); font-size: .875rem; display: flex; align-items: flex-start; gap: .6rem; }
.alert-error   { background: var(--danger-bg);  color: #991b1b; border: 1px solid #fca5a5; }
.alert-success { background: var(--success-bg); color: #065f46; border: 1px solid #6ee7b7; }
.alert-warning { background: var(--warning-bg); color: #92400e; border: 1px solid #fcd34d; }
.alert-info    { background: var(--info-bg);    color: #1e40af; border: 1px solid #93c5fd; }

/* ── TABLE ─────────────────────────────────────────── */
.table-wrap { overflow: hidden; border-radius: var(--radius-lg); border: 1px solid var(--gray-200); }
.data-table { width: 100%; border-collapse: collapse; background: var(--white); }
.data-table thead { background: var(--gray-50); }
.data-table th { padding: .85rem 1.25rem; text-align: left; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-500); border-bottom: 1px solid var(--gray-200); white-space: nowrap; }
.data-table td { padding: 1rem 1.25rem; border-bottom: 1px solid var(--gray-100); font-size: .875rem; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: var(--t) var(--ease); }
.data-table tbody tr:hover td { background: var(--gray-50); }

/* ── GRID ──────────────────────────────────────────── */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2,1fr); }
.grid-3 { grid-template-columns: repeat(3,1fr); }
.grid-4 { grid-template-columns: repeat(4,1fr); }
@media(max-width:1100px){ .grid-4 { grid-template-columns: repeat(2,1fr); } }
@media(max-width:780px){  .grid-3 { grid-template-columns: repeat(2,1fr); } }
@media(max-width:560px){  .grid-4,.grid-3,.grid-2 { grid-template-columns: 1fr; } }

/* ── HERO ──────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg,var(--brand-deeper) 0%,var(--brand-dark) 40%,var(--brand) 100%);
  color: #fff; padding: 5rem 1.5rem 4rem; text-align: center; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-inner { max-width: 700px; margin: 0 auto; position: relative; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: .5rem; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); border-radius: var(--radius-full); padding: .3rem 1rem; font-size: .78rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 1.5rem; }
.hero h1 { font-size: 3.2rem; font-weight: 900; line-height: 1.1; margin-bottom: 1.25rem; letter-spacing: -.02em; }
.hero h1 span { background: linear-gradient(90deg,#c7d2fe,#a5b4fc); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero p { font-size: 1.15rem; opacity: .8; max-width: 520px; margin: 0 auto 2.5rem; line-height: 1.7; }
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.btn-hero { background: #fff; color: var(--brand-dark); font-size: 1rem; font-weight: 700; padding: .8rem 2rem; box-shadow: 0 4px 20px rgba(0,0,0,.2); }
.btn-hero:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,.25); }
.btn-hero-outline { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.4); font-size: 1rem; padding: .8rem 2rem; }
.btn-hero-outline:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.7); }
@media(max-width:640px){ .hero h1 { font-size: 2.1rem; } }

/* ── SECTION ───────────────────────────────────────── */
.section { padding: 3.5rem 1.5rem; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; }
.section-title { font-size: 1.4rem; font-weight: 800; color: var(--gray-900); }
.section-sub { font-size: .875rem; color: var(--gray-500); margin-top: .25rem; }

/* ── EXAM CARD ─────────────────────────────────────── */
.exam-card {
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg); padding: 1.5rem;
  display: flex; flex-direction: column; gap: .75rem;
  transition: all var(--t) var(--ease); cursor: pointer; position: relative; overflow: hidden;
}
.exam-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg,var(--brand),var(--brand-dark)); transform: scaleX(0); transition: transform var(--t) var(--ease); transform-origin: left; }
.exam-card:hover { border-color: var(--brand); box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.exam-card:hover::before { transform: scaleX(1); }
.exam-card-cat { font-size: .72rem; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .06em; }
.exam-card-title { font-weight: 700; font-size: .95rem; line-height: 1.45; color: var(--gray-900); flex: 1; }
.exam-card-meta { display: flex; gap: 1rem; flex-wrap: wrap; }
.exam-card-meta span { font-size: .78rem; color: var(--gray-500); display: flex; align-items: center; gap: .3rem; font-weight: 500; }
.exam-card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: .75rem; border-top: 1px solid var(--gray-100); }

/* ── CATEGORY TAB ──────────────────────────────────── */
.cat-tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.cat-tab { padding: .4rem 1rem; border-radius: var(--radius-full); border: 1.5px solid var(--gray-200); background: var(--white); font-size: .8rem; font-weight: 600; cursor: pointer; transition: var(--t) var(--ease); color: var(--gray-600); white-space: nowrap; }
.cat-tab:hover { border-color: var(--brand); color: var(--brand); }
.cat-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 2px 8px var(--brand-glow); }

/* ── SEARCH BAR ────────────────────────────────────── */
.search-bar { position: relative; max-width: 340px; }
.search-bar svg { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--gray-400); pointer-events: none; }
.search-bar input { padding-left: 2.6rem; border-radius: var(--radius-full); }

/* ── EXAM SESSION ──────────────────────────────────── */
#page-take-exam { background: var(--gray-50); }
.exam-topbar {
  height: var(--topbar-h); background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.75rem; position: sticky; top: 0; z-index: 200;
  box-shadow: var(--shadow-xs);
}
.exam-topbar-left { display: flex; align-items: center; gap: 1rem; }
.exam-title-bar { font-weight: 700; font-size: .95rem; color: var(--gray-800); }
.exam-sub-bar { font-size: .78rem; color: var(--gray-500); }
.timer-pill {
  display: flex; align-items: center; gap: .5rem;
  background: var(--gray-100); border-radius: var(--radius-full);
  padding: .45rem 1.1rem; font-weight: 700; font-size: 1rem; color: var(--gray-800);
  transition: var(--t) var(--ease);
}
.timer-pill.warning { background: #fee2e2; color: var(--danger); }
.timer-pill svg { width: 16px; height: 16px; }
.exam-layout { display: grid; grid-template-columns: 1fr 280px; gap: 1.5rem; max-width: 1100px; margin: 0 auto; padding: 1.75rem; align-items: start; }
@media(max-width:860px){ .exam-layout { grid-template-columns: 1fr; } #qNavPanel { order: -1; } }

/* Question card */
.question-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 2rem; box-shadow: var(--shadow-xs); }
.question-badge { display: inline-flex; align-items: center; gap: .4rem; font-size: .72rem; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 1.25rem; }
.question-badge span { background: var(--brand-light); padding: .15rem .5rem; border-radius: var(--radius-sm); }
.question-text { font-size: 1.05rem; font-weight: 600; line-height: 1.65; color: var(--gray-900); margin-bottom: 1.75rem; }
.options-list { display: flex; flex-direction: column; gap: .6rem; }
.option-item {
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 1rem 1.1rem; border: 2px solid var(--gray-200);
  border-radius: var(--radius); cursor: pointer;
  transition: all var(--t) var(--ease); background: var(--white);
}
.option-item:hover { border-color: var(--brand); background: var(--brand-light); }
.option-item.selected { border-color: var(--brand); background: var(--brand-light); }
.option-item.correct  { border-color: var(--success); background: var(--success-bg); }
.option-item.wrong    { border-color: var(--danger);  background: var(--danger-bg);  }
.option-key {
  width: 32px; height: 32px; border-radius: var(--radius-full);
  border: 2px solid var(--gray-300); display: flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: .8rem; flex-shrink: 0;
  color: var(--gray-500); transition: var(--t) var(--ease);
}
.option-item.selected .option-key { background: var(--brand); border-color: var(--brand); color: #fff; }
.option-item.correct  .option-key { background: var(--success); border-color: var(--success); color: #fff; }
.option-item.wrong    .option-key { background: var(--danger);  border-color: var(--danger);  color: #fff; }
.option-text { font-size: .9rem; color: var(--gray-800); line-height: 1.5; padding-top: .35rem; }
.question-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--gray-100); }

/* Q Navigator panel */
.q-nav-panel { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 1.25rem; box-shadow: var(--shadow-xs); position: sticky; top: calc(var(--topbar-h) + 1.75rem); }
.q-nav-title { font-size: .8rem; font-weight: 700; color: var(--gray-500); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 1rem; }
.q-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: .4rem; margin-bottom: 1.25rem; }
.q-btn {
  aspect-ratio: 1; border-radius: var(--radius-sm); border: 1.5px solid var(--gray-200);
  background: var(--gray-50); font-size: .78rem; font-weight: 700; cursor: pointer;
  transition: var(--t) var(--ease); color: var(--gray-600); display: flex; align-items: center; justify-content: center;
}
.q-btn:hover    { border-color: var(--brand); color: var(--brand); }
.q-btn.current  { border-color: var(--brand); background: var(--brand); color: #fff; }
.q-btn.answered { border-color: var(--success); background: var(--success-bg); color: #065f46; }
.q-nav-legend { display: flex; flex-direction: column; gap: .4rem; font-size: .75rem; color: var(--gray-500); }
.q-nav-legend span { display: flex; align-items: center; gap: .5rem; }
.leg-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

/* ── PROGRESS BAR ──────────────────────────────────── */
.progress-bar { height: 6px; background: var(--gray-100); border-radius: var(--radius-full); overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg,var(--brand),var(--brand-dark)); border-radius: var(--radius-full); transition: width .5s var(--ease); }

/* ── CIRCULAR SCORE ────────────────────────────────── */
.score-ring { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring-text { position: absolute; text-align: center; }
.score-ring-num  { font-size: 2.2rem; font-weight: 900; line-height: 1; }
.score-ring-lbl  { font-size: .72rem; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: .05em; }

/* ── RESULT PAGE ───────────────────────────────────── */
.result-header { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 2.5rem; margin-bottom: 1.5rem; display: flex; align-items: center; gap: 2.5rem; box-shadow: var(--shadow-xs); }
.result-header.pass { border-top: 4px solid var(--success); }
.result-header.fail { border-top: 4px solid var(--danger); }
.result-meta { flex: 1; }
.result-exam-name { font-size: 1.3rem; font-weight: 800; margin-bottom: .5rem; }
.result-stats-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; margin-bottom: 1.5rem; }
.result-stat { text-align: center; padding: 1.25rem; background: var(--gray-50); border-radius: var(--radius); border: 1px solid var(--gray-200); }
.result-stat-val { font-size: 1.75rem; font-weight: 800; color: var(--gray-900); }
.result-stat-lbl { font-size: .75rem; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: .05em; margin-top: .25rem; }
@media(max-width:640px){ .result-header { flex-direction: column; text-align: center; } .result-stats-row { grid-template-columns: 1fr 1fr; } }

/* ── REVIEW CARD ───────────────────────────────────── */
.review-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); margin-bottom: 1rem; overflow: hidden; }
.review-card-head { padding: 1rem 1.25rem; display: flex; align-items: center; gap: .75rem; border-bottom: 1px solid var(--gray-100); }
.review-q-num { font-size: .72rem; font-weight: 700; color: var(--gray-500); text-transform: uppercase; letter-spacing: .05em; }
.review-card-body { padding: 1.25rem; }
.review-q-text { font-size: .9rem; font-weight: 600; color: var(--gray-800); margin-bottom: 1rem; line-height: 1.5; }
.explanation-box { margin-top: 1rem; padding: .85rem 1rem; background: #f0fdf4; border-left: 3px solid var(--success); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: .82rem; color: #065f46; line-height: 1.6; }
.explanation-box strong { display: block; margin-bottom: .2rem; }

/* ── AUTH PAGE ─────────────────────────────────────── */
#page-auth { background: linear-gradient(135deg,var(--gray-50) 0%,var(--brand-light) 100%); }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr 480px; }
@media(max-width:860px){ .auth-shell { grid-template-columns: 1fr; } .auth-promo { display: none; } }
.auth-promo { background: linear-gradient(135deg,var(--brand-deeper),var(--brand-dark),var(--brand)); padding: 3rem; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.auth-promo::before { content: ''; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); }
.auth-promo-content { position: relative; }
.auth-promo h2 { font-size: 2rem; font-weight: 900; color: #fff; margin-bottom: 1.25rem; line-height: 1.2; }
.auth-promo p { color: rgba(255,255,255,.75); font-size: .95rem; line-height: 1.7; margin-bottom: 2rem; }
.auth-feature { display: flex; align-items: center; gap: .75rem; margin-bottom: .85rem; }
.auth-feature-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); background: rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.auth-feature-text { color: rgba(255,255,255,.85); font-size: .875rem; font-weight: 500; }
.auth-right { background: var(--white); display: flex; align-items: center; justify-content: center; padding: 2.5rem 2rem; }
.auth-box { width: 100%; max-width: 380px; }
.auth-logo { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.2rem; color: var(--gray-900); margin-bottom: 2rem; }
.auth-title { font-size: 1.5rem; font-weight: 800; color: var(--gray-900); margin-bottom: .35rem; }
.auth-sub   { font-size: .875rem; color: var(--gray-500); margin-bottom: 1.75rem; }
.auth-tabs  { display: flex; background: var(--gray-100); border-radius: var(--radius); padding: .25rem; margin-bottom: 1.5rem; gap: .25rem; }
.auth-tab   { flex: 1; padding: .5rem; border: none; background: transparent; border-radius: var(--radius-sm); font-weight: 600; font-size: .875rem; color: var(--gray-500); cursor: pointer; transition: var(--t) var(--ease); }
.auth-tab.active { background: var(--white); color: var(--brand); box-shadow: var(--shadow-xs); }
.auth-divider { display: flex; align-items: center; gap: .75rem; margin: 1.25rem 0; font-size: .78rem; color: var(--gray-400); font-weight: 500; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--gray-200); }

/* ── TOAST ─────────────────────────────────────────── */
#toastContainer { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999; display: flex; flex-direction: column; gap: .5rem; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: .75rem;
  background: var(--gray-900); color: #fff;
  padding: .85rem 1.2rem; border-radius: var(--radius);
  font-size: .875rem; font-weight: 500; box-shadow: var(--shadow-xl);
  animation: toastIn .3s var(--ease) forwards;
  pointer-events: all; max-width: 360px;
}
.toast.success { background: #064e3b; border-left: 3px solid var(--success); }
.toast.error   { background: #7f1d1d; border-left: 3px solid var(--danger); }
.toast.warning { background: #78350f; border-left: 3px solid var(--warning); }
.toast.out { animation: toastOut .25s var(--ease) forwards; }
@keyframes toastIn  { from { opacity:0; transform: translateX(2rem); } to { opacity:1; transform: translateX(0); } }
@keyframes toastOut { from { opacity:1; transform: translateX(0); } to { opacity:0; transform: translateX(2rem); } }

/* ── SKELETON ──────────────────────────────────────── */
.skel { background: linear-gradient(90deg,var(--gray-100) 25%,var(--gray-200) 50%,var(--gray-100) 75%); background-size: 200% 100%; animation: skel 1.4s ease infinite; border-radius: var(--radius-sm); }
@keyframes skel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skel-text { height: 14px; border-radius: 4px; margin-bottom: .5rem; }
.skel-card { height: 180px; border-radius: var(--radius-lg); }

/* ── EMPTY STATE ───────────────────────────────────── */
.empty-state { text-align: center; padding: 4rem 2rem; }
.empty-state .icon { font-size: 3rem; margin-bottom: 1rem; opacity: .6; }
.empty-state h3 { font-size: 1.1rem; font-weight: 700; color: var(--gray-700); margin-bottom: .5rem; }
.empty-state p { font-size: .875rem; color: var(--gray-500); max-width: 300px; margin: 0 auto 1.5rem; }

/* ── MODAL ─────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(4px); z-index: 500; display: flex; align-items: center; justify-content: center; padding: 1rem; animation: fadeIn .15s var(--ease); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal { background: var(--white); border-radius: var(--radius-xl); padding: 2rem; max-width: 440px; width: 100%; box-shadow: var(--shadow-xl); animation: scaleIn .2s var(--ease); }
@keyframes scaleIn { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-title { font-size: 1.15rem; font-weight: 800; margin-bottom: .5rem; }
.modal-body  { font-size: .9rem; color: var(--gray-600); margin-bottom: 1.75rem; line-height: 1.6; }
.modal-actions { display: flex; gap: .75rem; justify-content: flex-end; }

/* ── MISC ──────────────────────────────────────────── */
.page-header { margin-bottom: 1.75rem; }
.page-header h2 { font-size: 1.5rem; font-weight: 800; color: var(--gray-900); }
.page-header p  { font-size: .875rem; color: var(--gray-500); margin-top: .25rem; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.divider { height: 1px; background: var(--gray-200); margin: 1.5rem 0; }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-muted   { color: var(--gray-500); }
.text-sm      { font-size: .85rem; }
.fw-bold      { font-weight: 700; }
.fw-semibold  { font-weight: 600; }
.mt-1{margin-top:.4rem}.mt-2{margin-top:.85rem}.mt-3{margin-top:1.5rem}.mt-4{margin-top:2rem}
.mb-1{margin-bottom:.4rem}.mb-2{margin-bottom:.85rem}.mb-3{margin-bottom:1.5rem}

/* ── GOOGLE SIGN-IN ────────────────────────────────── */
.auth-divider { display: flex; align-items: center; gap: .75rem; margin: 1rem 0; color: var(--gray-400); font-size: .8rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--gray-200); }
.google-signin-btn { display: flex; align-items: center; justify-content: center; gap: .6rem; width: 100%; padding: .7rem 1rem; border: 1.5px solid var(--gray-200); border-radius: var(--radius); background: var(--white); color: var(--gray-700); font-size: .875rem; font-weight: 600; cursor: pointer; transition: all .15s; user-select: none; }
.google-signin-btn:hover { border-color: var(--gray-300); background: var(--gray-50); box-shadow: var(--shadow-sm); }
.google-signin-btn:active { transform: scale(.985); }
.btn-success { background: var(--success); color: #fff; border: none; }
.btn-success:hover { background: #059669; transform: translateY(-1px); }
.btn-warning { background: #f59e0b; color: #fff; border: none; }
.btn-warning:hover { background: #d97706; }
