/* ============================================================
   CBSE Economics MCQ Practice — shared styles
   (System font stack — no external requests, works fully offline)
   ============================================================ */

:root{
  --bg: #f4f5fb;
  --bg-soft: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef0f9;
  --ink: #171724;
  --ink-soft: #5c5d72;
  --line: #e2e3f0;
  --accent: #4b3fea;
  --accent-soft: #eeecfe;
  --good: #14a663;
  --good-soft: #e3f8ee;
  --bad: #e0435a;
  --bad-soft: #fde9ec;
  --shadow: 0 16px 40px -20px rgba(30, 24, 90, .28);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 9px;
  color-scheme: light;
}

html.dark{
  --bg: #0d0d17;
  --bg-soft: #14141f;
  --surface: #181826;
  --surface-2: #1f1f30;
  --ink: #edeef8;
  --ink-soft: #9b9cb5;
  --line: #2a2a3d;
  --accent: #8b7bff;
  --accent-soft: #232047;
  --good: #34caa1;
  --good-soft: #133227;
  --bad: #ff6b7f;
  --bad-soft: #33191f;
  --shadow: 0 16px 40px -18px rgba(0,0,0,.6);
  color-scheme: dark;
}

*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}
h1,h2,h3,.display{
  font-family: 'Segoe UI Semibold', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, system-ui, sans-serif;
  letter-spacing: -0.015em;
  font-weight: 750;
}
a{ color: inherit; }
button{ font-family: inherit; }

.icon-btn{
  display:inline-flex; align-items:center; justify-content:center;
  width:42px; height:42px; border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor:pointer;
  transition: transform .15s ease, background .2s ease, border-color .2s ease;
}
.icon-btn:hover{ border-color: var(--accent); }
.icon-btn:active{ transform: scale(.92); }
.icon-btn svg{ width:20px; height:20px; }

.sr-only{
  position:absolute; width:1px;height:1px; padding:0;margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}

::selection{ background: var(--accent); color:#fff; }

/* focus visibility */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------------- shared top bar ---------------- */
.topbar{
  position: sticky; top:0; z-index: 40;
  display:flex; align-items:center; justify-content:space-between;
  padding: 14px clamp(16px,4vw,40px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-left{ display:flex; align-items:center; gap:12px; min-width:0; }
.topbar-right{ display:flex; align-items:center; gap:10px; }
.brand{
  font-family:inherit; font-weight:700; font-size:1rem;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.brand small{ display:block; font-family:inherit; font-weight:500; font-size:.72rem; color:var(--ink-soft); }

/* ---------------- info modal (shared across all pages) ---------------- */
.modal-backdrop{
  position: fixed; inset: 0; z-index: 100;
  background: rgba(10,10,20,.55);
  backdrop-filter: blur(3px);
  display:flex; align-items:center; justify-content:center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}
.modal-backdrop.open{ opacity:1; pointer-events:auto; }
.modal-card{
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 34px 28px 28px;
  max-width: 340px; width: 100%;
  text-align: center;
  transform: translateY(10px);
  transition: transform .2s ease;
}
.modal-backdrop.open .modal-card{ transform: translateY(0); }
.modal-close{
  position:absolute; top:12px; right:12px;
  width:32px; height:32px; border-radius:10px;
  border:1px solid var(--line); background: var(--surface-2); color: var(--ink-soft);
  display:flex; align-items:center; justify-content:center; cursor:pointer;
}
.modal-close svg{ width:16px; height:16px; }
.modal-avatar{
  width:62px; height:62px; border-radius:50%; margin: 0 auto 16px;
  background: linear-gradient(135deg,#4b3fea,#ff6bb0);
  color:#fff; display:flex; align-items:center; justify-content:center;
  font-weight:800; font-size:1.25rem;
}
.modal-card h3{ margin: 0 0 6px; font-size: 1.15rem; }
.modal-email{
  display:inline-block; color: var(--accent); font-weight:600;
  text-decoration:none; font-size:.94rem;
}
.modal-email:hover{ text-decoration: underline; }
.modal-note{ margin: 14px 0 0; color: var(--ink-soft); font-size: .85rem; line-height:1.55; }
