:root {
  color-scheme: dark;
  --bg: #07131f;
  --bg-soft: #0d1b2a;
  --bg-card: rgba(15, 23, 42, 0.82);
  --panel: rgba(2, 8, 23, 0.58);
  --border: rgba(148, 163, 184, 0.18);
  --text: #e5eefb;
  --muted: #9fb0c6;
  --primary: #38bdf8;
  --primary-2: #22c55e;
  --warning: #f59e0b;
  --danger: #fb7185;
  --success: #34d399;
  --shadow: 0 20px 70px rgba(0, 0, 0, .35);
  --radius: 22px;
  --radius-sm: 14px;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, .22), transparent 34rem),
    radial-gradient(circle at top right, rgba(34, 197, 94, .16), transparent 38rem),
    linear-gradient(180deg, #07131f 0%, #0a1220 54%, #050914 100%);
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
img, video { max-width: 100%; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max);
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
  padding: 14px 20px;
  backdrop-filter: blur(16px);
}
.site-header::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 70px;
  background: rgba(7, 19, 31, .74);
  border-bottom: 1px solid var(--border);
  z-index: -1;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.3rem; font-weight: 900; letter-spacing: -.04em; }
.brand img { border-radius: 14px; box-shadow: 0 12px 34px rgba(56, 189, 248, .18); }
.top-nav { display: flex; align-items: center; gap: 8px; }
.top-nav a {
  color: var(--muted);
  padding: 10px 13px;
  border-radius: 999px;
  transition: .18s ease;
}
.top-nav a:hover, .top-nav a.active { color: var(--text); background: rgba(148, 163, 184, .12); }
.nav-cta {
  color: #02131d !important;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)) !important;
  font-weight: 800;
}
.menu-button {
  display: none;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, .8);
  color: var(--text);
  width: 44px;
  height: 44px;
  border-radius: 14px;
}

main { flex: 1; }
.screen { display: none; width: min(calc(100% - 32px), var(--max)); margin: 0 auto; padding: 28px 0 56px; }
.screen.active { display: block; animation: fadeUp .28s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
  gap: 28px;
  align-items: center;
  padding: 44px 0 30px;
}
.eyebrow { color: var(--primary); font-weight: 800; letter-spacing: .02em; text-transform: uppercase; font-size: .82rem; }
.hero h1, .section-title h1 { font-size: clamp(2.3rem, 6vw, 5.2rem); line-height: 1.08; letter-spacing: -.05em; margin: 12px 0 18px; }
.gradient-text { background: linear-gradient(135deg, #f8fafc 0%, #7dd3fc 42%, #86efac 100%); -webkit-background-clip: text; background-clip: text; color: transparent; display: inline; line-height: inherit; }
.hero p, .section-title p { color: var(--muted); font-size: 1.08rem; line-height: 1.7; max-width: 680px; }
.hero-actions, .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  min-height: 46px;
  padding: 12px 18px;
  background: rgba(15, 23, 42, .75);
  color: var(--text);
  font-weight: 800;
  box-shadow: none;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.btn:hover { transform: translateY(-1px); border-color: rgba(125, 211, 252, .45); background: rgba(15, 23, 42, .95); }
.btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #03111c; border: none; }
.btn.danger { background: rgba(251, 113, 133, .15); border-color: rgba(251, 113, 133, .3); color: #fecdd3; }
.btn.success { background: rgba(52, 211, 153, .15); border-color: rgba(52, 211, 153, .3); color: #bbf7d0; }
.btn.small { min-height: 36px; padding: 8px 12px; font-size: .9rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.glass-card, .card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}
.hero-card { position: relative; padding: 22px; overflow: hidden; }
.hero-card::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(56, 189, 248, .35), transparent 70%);
}
.phone-mock {
  position: relative;
  margin: 0 auto;
  width: min(100%, 360px);
  border-radius: 38px;
  padding: 16px;
  background: linear-gradient(145deg, rgba(226, 232, 240, .22), rgba(15, 23, 42, .78));
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 34px 90px rgba(0,0,0,.48);
}
.phone-screen { background: #06111f; border-radius: 28px; padding: 18px; border: 1px solid rgba(148,163,184,.16); }
.mock-status { display: flex; justify-content: space-between; color: var(--muted); font-size: .75rem; margin-bottom: 16px; }
.mock-banner { border-radius: 22px; padding: 18px; background: linear-gradient(135deg, rgba(14, 165, 233, .28), rgba(34, 197, 94, .18)); }
.mock-banner h3 { margin: 0 0 8px; font-size: 1.25rem; }
.mock-banner p { margin: 0; color: #cbd5e1; font-size: .92rem; }
.mock-progress { height: 10px; background: rgba(148,163,184,.18); border-radius: 999px; overflow: hidden; margin: 16px 0; }
.mock-progress span { display: block; height: 100%; width: 72%; background: linear-gradient(90deg, var(--primary), var(--primary-2)); border-radius: inherit; }
.mock-list { display: grid; gap: 10px; margin-top: 16px; }
.mock-item { display: flex; justify-content: space-between; align-items: center; padding: 13px; background: rgba(15,23,42,.9); border: 1px solid var(--border); border-radius: 16px; color: #dbeafe; }

.stats-grid, .feature-grid, .cards-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 26px 0; }
.stat, .feature, .mini-card { padding: 18px; border-radius: var(--radius); background: rgba(15, 23, 42, .65); border: 1px solid var(--border); }
.stat strong { display: block; font-size: 2rem; letter-spacing: -.05em; }
.stat span, .feature p, .mini-card p { color: var(--muted); line-height: 1.6; }
.feature h3, .mini-card h3 { margin: 6px 0 8px; }
.icon-bubble { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 15px; background: rgba(56,189,248,.14); border: 1px solid rgba(56,189,248,.24); }

.section-title { margin: 26px 0 20px; }
.section-title h1 { font-size: clamp(2rem, 5vw, 4.1rem); }
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 14px;
  margin: 18px 0;
  background: rgba(15, 23, 42, .68);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.input, .select {
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(2, 8, 23, .66);
  color: var(--text);
  outline: none;
}
.input { min-width: min(100%, 280px); flex: 1; }
.select { min-width: 145px; }
.pill-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.pill-tabs button { border: 1px solid var(--border); border-radius: 999px; padding: 9px 13px; color: var(--muted); background: transparent; }
.pill-tabs button.active { background: rgba(56,189,248,.16); color: #bae6fd; border-color: rgba(56,189,248,.38); }

.exam-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; align-items: start; }
.exam-card, .question-card, .result-card, .side-panel { padding: 18px; }
.side-panel { position: sticky; top: 88px; }
.question-card { margin-bottom: 14px; }
.question-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.question-title { margin: 0; font-size: 1.02rem; line-height: 1.55; }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 10px; font-size: .78rem; font-weight: 800; white-space: nowrap; }
.badge.critical { background: rgba(251, 113, 133, .16); color: #fecdd3; border: 1px solid rgba(251, 113, 133, .28); }
.badge.info { background: rgba(56, 189, 248, .14); color: #bae6fd; border: 1px solid rgba(56, 189, 248, .26); }
.badge.success { background: rgba(52, 211, 153, .14); color: #bbf7d0; border: 1px solid rgba(52, 211, 153, .26); }
.choices { display: grid; gap: 10px; }
.choice {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  width: 100%;
  text-align: left;
  padding: 13px;
  border-radius: 16px;
  background: rgba(2, 8, 23, .48);
  border: 1px solid var(--border);
  color: var(--text);
}
.choice:hover { border-color: rgba(56,189,248,.34); }
.choice.selected { border-color: rgba(56,189,248,.64); background: rgba(56,189,248,.12); }
.choice.correct { border-color: rgba(52,211,153,.55); background: rgba(52,211,153,.12); }
.choice.wrong { border-color: rgba(251,113,133,.55); background: rgba(251,113,133,.12); }
.choice-index { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: rgba(148,163,184,.14); font-weight: 900; }
.hint { margin-top: 12px; padding: 13px; border-radius: 16px; color: #dbeafe; background: rgba(14, 165, 233, .1); border: 1px dashed rgba(125, 211, 252, .28); line-height: 1.6; }
.hint a { text-decoration: underline; }
.progress-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; margin: 12px 0; }
.progress { height: 12px; background: rgba(148,163,184,.15); border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary), var(--primary-2)); transition: width .2s ease; }
.timer { font-size: 1.9rem; font-weight: 900; letter-spacing: -.05em; }
.number-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 12px; }
.number-grid button { border: 1px solid var(--border); border-radius: 12px; min-height: 38px; background: rgba(2,8,23,.45); color: var(--muted); font-weight: 800; }
.number-grid button.done { background: rgba(56,189,248,.15); color: #bae6fd; border-color: rgba(56,189,248,.35); }
.result-score { font-size: clamp(2.5rem, 7vw, 5rem); font-weight: 950; letter-spacing: -.08em; margin: 0; }
.result-pass { color: var(--success); }
.result-fail { color: var(--danger); }
.history-list { display: grid; gap: 8px; margin-top: 12px; }
.history-item { display: flex; justify-content: space-between; gap: 10px; padding: 10px; background: rgba(2,8,23,.35); border: 1px solid var(--border); border-radius: 12px; color: var(--muted); }

.practice-list { display: grid; gap: 14px; }
.practice-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }

.sim-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 18px; align-items: start; }
.situation-list { max-height: 720px; overflow: auto; display: grid; gap: 10px; padding-right: 4px; }
.situation-item { width: 100%; text-align: left; padding: 13px; border-radius: 16px; border: 1px solid var(--border); background: rgba(15,23,42,.62); color: var(--text); }
.situation-item.active { border-color: rgba(56,189,248,.58); background: rgba(56,189,248,.12); }
.situation-item strong { display: block; line-height: 1.35; }
.situation-item span { color: var(--muted); font-size: .9rem; }
.video-frame { overflow: hidden; border-radius: var(--radius); background: #000; border: 1px solid var(--border); }
.video-frame video { width: 100%; display: block; aspect-ratio: 16/9; background: #000; }
.score-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.score-tile { padding: 14px; background: rgba(2,8,23,.4); border: 1px solid var(--border); border-radius: 16px; }
.score-tile strong { display: block; font-size: 1.6rem; }
.timeline { position: relative; min-height: 16px; height: 16px; border-radius: 999px; background: rgba(148,163,184,.16); margin: 16px 0 6px; overflow: hidden; }
.timeline-window { position: absolute; top: 0; bottom: 0; background: linear-gradient(90deg, rgba(52,211,153,.5), rgba(245,158,11,.5)); }
.timeline-hit { position: absolute; top: -5px; width: 4px; height: 26px; border-radius: 999px; background: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,.18); }
.kbd { font-weight: 950; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); border-bottom-width: 3px; border-radius: 8px; padding: 2px 8px; }

.fines-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.fine-card { padding: 18px; }
.fine-card h3 { margin: 0 0 8px; line-height: 1.4; }
.fine-card .amount { color: #fde68a; font-weight: 900; }
.fine-card p, .law-card p { color: var(--muted); line-height: 1.65; }
.law-timeline { display: grid; gap: 14px; }
.law-card { display: grid; grid-template-columns: 110px minmax(0,1fr); gap: 14px; padding: 18px; }
.law-date { font-weight: 950; color: var(--primary); }

.app-section { display: grid; grid-template-columns: minmax(0, .95fr) minmax(320px, 1.05fr); gap: 24px; align-items: center; }
.store-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.store-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 205px;
  padding: 14px 16px;
  border-radius: 18px;
  background: #f8fafc;
  color: #020617;
  font-weight: 900;
  box-shadow: 0 18px 38px rgba(0,0,0,.25);
}
.store-btn small { display: block; font-size: .72rem; font-weight: 700; color: #334155; }
.qr-card { padding: 24px; text-align: center; }
.qr-placeholder { width: 220px; height: 220px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 24px; background: repeating-linear-gradient(45deg, #0f172a 0 10px, #111827 10px 20px); border: 1px solid var(--border); font-size: 3rem; }

.empty-state { padding: 36px; text-align: center; color: var(--muted); }
.toast {
  position: fixed;
  left: 50%; bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
  max-width: calc(100% - 32px);
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(15,23,42,.92);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: .22s ease;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%); }

.site-footer {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
  padding: 26px 0 34px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 22px;
}
.site-footer p { margin: 8px 0 0; max-width: 680px; line-height: 1.6; }
.footer-links { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.footer-links a { color: #bfdbfe; }

@media (max-width: 920px) {
  .hero, .exam-layout, .sim-layout, .app-section { grid-template-columns: 1fr; }
  .side-panel { position: static; }
  .stats-grid, .feature-grid { grid-template-columns: 1fr; }
  .fines-grid { grid-template-columns: 1fr; }
  .site-footer { flex-direction: column; }
}
@media (max-width: 720px) {
  .menu-button { display: inline-grid; place-items: center; }
  .top-nav {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(7, 19, 31, .96);
    box-shadow: var(--shadow);
  }
  .top-nav.open { display: flex; }
  .top-nav a { border-radius: 14px; }
  .score-board, .cards-grid { grid-template-columns: 1fr 1fr; }
  .law-card { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .screen, .site-header, .site-footer { width: min(calc(100% - 20px), var(--max)); }
  .hero h1, .section-title h1 { letter-spacing: -.06em; }
  .toolbar { align-items: stretch; }
  .input, .select, .toolbar .btn { width: 100%; }
  .number-grid { grid-template-columns: repeat(5, 1fr); }
  .score-board { grid-template-columns: 1fr; }
}


.question-image{margin:1rem 0;border:1px solid var(--line);border-radius:18px;padding:.75rem;background:#fff;display:inline-flex;align-items:center;justify-content:center;max-width:100%;}
.question-image img{max-width:min(100%,520px);max-height:320px;object-fit:contain;border-radius:12px;}
.question-image figcaption,.missing-img{color:var(--muted);font-size:.9rem;text-align:center;line-height:1.4;}
.question-image.missing{display:block;background:#fff7ed;border-color:#fed7aa;}
.result-count{color:var(--muted);font-weight:700;margin:-.4rem 0 1rem;}
.stacked-mobile{align-items:stretch;}
.extra-penalty{margin-top:.75rem;padding:.8rem;border-radius:14px;background:#fff7ed;border:1px solid #fed7aa;color:#9a3412;font-weight:700;}
.signs-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1rem;}
.sign-card{display:flex;flex-direction:column;gap:.75rem;padding:18px;}
.sign-image-wrap{height:150px;border-radius:20px;background:linear-gradient(180deg,#f8fafc,#fff);border:1px solid var(--line);display:flex;align-items:center;justify-content:center;padding:.8rem;}
.sign-image-wrap img{max-width:100%;max-height:100%;object-fit:contain;}
.sign-card h3{margin:.1rem 0;font-size:1.02rem;padding:0 .25rem;}
.sign-card p{color:var(--muted);line-height:1.55;margin:0;padding:0 .25rem .15rem;}
@media (max-width: 980px){.signs-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media (max-width: 640px){.signs-grid{grid-template-columns:1fr}.stacked-mobile{flex-direction:column}.sign-image-wrap{height:130px}.app-hero-visual{min-height:360px}.app-hero-visual img{max-height:520px}.hero h1,.section-title h1{line-height:1.12;letter-spacing:-.04em;}}

.app-hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 420px;
  overflow: hidden;
}
.app-hero-visual img {
  width: auto;
  max-width: min(100%, 430px);
  max-height: min(70vh, 660px);
  height: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 34px 90px rgba(0,0,0,.45));
}
.feature-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
