/*
 * АВТОШКОЛА «ЗАЧЁТ» — ТЕМА ОФОРМЛЕНИЯ V1.0
 * Подготовка водителей · ПДД 2026 · Екатеринбург
 */

/* Шрифты вендорены локально (woff2, офлайн-first, без CDN):
 * Unbounded 800 — смелый дисплейный (заголовки), Oswald — HUD-цифры.
 * Кириллица + латиница, font-display:swap (мгновенный текст системным до загрузки). */
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 800; font-display: swap; src: url(../assets/fonts/unbounded-cyrillic-800-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 800; font-display: swap; src: url(../assets/fonts/unbounded-latin-800-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Oswald'; font-style: normal; font-weight: 600; font-display: swap; src: url(../assets/fonts/oswald-cyrillic-600-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Oswald'; font-style: normal; font-weight: 600; font-display: swap; src: url(../assets/fonts/oswald-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Oswald'; font-style: normal; font-weight: 700; font-display: swap; src: url(../assets/fonts/oswald-cyrillic-700-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Oswald'; font-style: normal; font-weight: 700; font-display: swap; src: url(../assets/fonts/oswald-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
  /* 1. Фирменная палитра автошколы «Зачёт» (zachet.su) */
  --accent: #F5A623;        /* оранжевый — основной бренд */
  --accent2: #E59400;       /* тёмно-оранжевый (градиент) */
  --accent-light: #FFE3A6;  /* светлый акцент (highlight на ярком фоне) */
  --accent-soft: #FFF3E0;   /* мягкий фон акцента */
  --secondary: #7ED321;     /* зелёный — вторичный */
  --secondary-dark: #6DB01C;
  --bg: #FFFFFF;
  --bg-secondary: #F9FAFB;
  --bg-tertiary: #F3F4F6;
  --text-primary: #111827;
  --text-secondary: #4B5563;   /* AA ~7:1 на белом */
  --text-muted: #6B7280;       /* AA ~4.6:1 на белом */
  --border: #E5E7EB;
  --accent-text: #B45309;      /* акцент как ТЕКСТ (контраст на светлом) */
  --success: #16A34A;
  --error: #EF4444;

  /* 2. Типографика (честно о реальном стеке):
   *  - дисплей: Unbounded 800 (вендорен, woff2) — заголовки/бренд;
   *  - HUD-цифры: Oswald 600/700 (вендорен) — спидометры/счётчики;
   *  - тело: системный гротеск (San Francisco/Segoe/Roboto) — сознательно НЕ
   *    вендорим, чтобы не грузить лишний шрифт; нативный гротеск платформы
   *    выглядит «родным» и рендерится мгновенно. Стек ниже — не «Inter любой
   *    ценой», а корректная эскалация к системному. */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Unbounded', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-hud: 'Oswald', 'Inter', -apple-system, sans-serif;
  --line-height: 1.6;

  /* — Дорожные сигналы (бренд как источник света, а не заливка) — */
  --headlight: #F5A623;        /* фары / активный путь */
  --headlight-hot: #FFB627;    /* дальний свет — ярче */
  --headlight-core: #FFD27A;   /* раскалённый центр фары */
  --headlight-glow: rgba(245,166,35,0.55);
  --go: #7ED321;               /* зелёный свет / верно */
  --go-glow: rgba(126,211,33,0.45);
  --stop: #FF3B30;             /* стоп-сигнал / ошибка */
  --stop-glow: rgba(255,59,48,0.40);
  --lane: #F2F4F7;             /* разметка / текст на асфальте */
  --lane-dim: rgba(242,244,247,0.55);
  --grad-headlight: linear-gradient(135deg, var(--headlight-hot) 0%, var(--accent) 45%, var(--accent2) 100%);
  --glow-headlight: 0 0 0 1px rgba(255,210,122,.35), 0 8px 30px var(--headlight-glow);
  --grad-go: linear-gradient(135deg, #9BE84A, var(--go));

  /* 3. Отступы — единая 8pt-сетка (шаг ×1.5): 4·8·12·16·24·40·64.
   *  Раньше --space-lg=26px выпадал из ритма — сеньорная дисциплина в том,
   *  чтобы КАЖДЫЙ отступ был точкой одной шкалы, а не «на глаз». */
  --space-unit: 1rem;
  --space-xs: 0.25rem;   /* 4  */
  --space-sm: 0.5rem;    /* 8  */
  --space-smd: 0.75rem;  /* 12 */
  --space-md: 1rem;      /* 16 */
  --space-lg: 1.5rem;    /* 24 (было 26 — вне сетки) */
  --space-xl: 2.5rem;    /* 40 */
  --space-2xl: 4rem;     /* 64 */
  --radius: 12px;       /* база zachet.su */
  --radius-lg: 16px;

  /* 4. Тени — двухслойные (контактная + мягкое зарево), как в дорогом UI:
   *  ближний плотный слой «прижимает» карточку к поверхности, дальний мягкий
   *  даёт объём. Плоская однослойная тень — типичный признак «слоп»-дизайна. */
  --shadow-sm: 0 1px 1px rgba(17, 24, 39, 0.04), 0 2px 4px rgba(17, 24, 39, 0.05);
  --shadow-md: 0 1px 2px rgba(17, 24, 39, 0.05), 0 6px 16px -4px rgba(17, 24, 39, 0.10);
  --shadow-lg: 0 2px 4px rgba(17, 24, 39, 0.06), 0 18px 40px -12px rgba(17, 24, 39, 0.16);
  --shadow-accent: 0 2px 6px rgba(245, 166, 35, 0.20), 0 12px 30px -8px rgba(245, 166, 35, 0.38);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* BASE & RESET */
*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--line-height);
  color: var(--text-primary);
  background-color: var(--bg-secondary);
}

/* SACRED GEOMETRY PATTERN */
.sacred-bg {
  position: relative;
  background-color: var(--bg-secondary);
}

.sacred-bg::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23F5A623' fill-opacity='0.04'%3E%3Cpath d='M30 30l15-15v30l-15-15zm-15 0l15 15v-30l-15 15z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* LAYOUT */
.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
}

/* COMPONENTS */

/* Buttons - Ethical CTA */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: #0A0E1C;            /* тёмный текст на оранжевом: WCAG AA ~9.5:1 (было 2.03:1) */
  font-weight: 700;
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px 0 rgba(245, 166, 35, 0.40);
}
.btn:active { transform: translateY(0); }

.btn-secondary {
  background-color: var(--bg);
  color: var(--text-primary);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Cards - Clear Hierarchy */
.card {
  background-color: var(--bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Forms - Simple & Clear */
.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.18);
}

/* Navbar */
.navbar {
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.navbar-brand {
  display: flex;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  /* Найдено реальным Lighthouse-прогоном: --accent (#F5A623) на светлом фоне
     давал контраст 2:1 (нужно ≥3:1 для крупного текста) — WCAG AA fail.
     --accent-text — тот же бренд-оттенок, но выверенный для текста (4.97:1). */
  color: var(--accent-text);
  text-decoration: none;
}

/* Prose - Readable Content */
.prose {
  font-size: 1.1rem;
  line-height: 1.7;
}
.prose h3 { font-size: 1.5rem; margin-top: 2rem; margin-bottom: 1rem; color: var(--text-primary); }
.prose p { margin-bottom: 1rem; color: var(--text-secondary); }
.prose ul, .prose ol { padding-left: 1.5rem; }
.prose li { margin-bottom: 0.5rem; }
.prose b, .prose strong { color: var(--text-primary); font-weight: 600; }
.prose table { width: 100%; border-collapse: collapse; margin: 2rem 0; }
.prose th, .prose td { border: 1px solid var(--border); padding: 0.75rem; text-align: left; }
.prose th { background-color: var(--bg-tertiary); }

/* Notifications - Clear Feedback */
.notification {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  border: 1px solid var(--border);
  border-left-width: 4px;
  background: var(--bg);
}
.notification-success { border-left-color: var(--success); }
.notification-error { border-left-color: var(--error); }

/* Loading Spinner - Visual Cue */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--bg-tertiary);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* UTILITY CLASSES */
.min-h-screen { min-height: 100vh; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.font-bold { font-weight: 700; }
.mb-4 { margin-bottom: var(--space-md); }
.py-8 { padding-top: var(--space-xl); padding-bottom: var(--space-xl); }

/* ANIMATIONS */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

/* ============================================================
 * АВТОШКОЛА «ЗАЧЁТ» — дополнение тем (семантика + компоненты)
 * Layout-утилиты подключаются через Tailwind CDN; здесь — только
 * фирменные классы, которых нет в Tailwind, на CSS-переменных.
 * ============================================================ */

/* Семантические цвета */
.bg-primary { background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%); color: #fff; }
.bg-secondary { background-color: var(--bg-secondary); }
.bg-tertiary { background-color: var(--bg-tertiary); }
.text-primary { color: var(--accent-text); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-accent-light { color: var(--accent-light); }
.text-white { color: #fff; }
.border-primary { border-color: var(--accent); }
.border-border { border-color: var(--border); }

/* Светлый «тинт» поверх бренда: bg-primary + bg-opacity-10 => мягкий фон с тёмным текстом */
.bg-primary.bg-opacity-10 { background: rgba(245, 166, 35, 0.10); color: var(--text-primary); }

/* Сетки */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* Навигация */
.navbar-nav { display: flex; align-items: center; gap: var(--space-md); }
.nav-link { background: none; border: none; cursor: pointer; font: inherit; color: var(--text-secondary); padding: var(--space-sm) var(--space-md); border-radius: var(--radius); transition: var(--transition); }
.nav-link:hover { color: var(--accent); background: var(--bg-secondary); }
/* Служебная ссылка (напр. «Админ» в демо) — тише основной навигации: мельче,
   приглушённый цвет, моноширинная подача. Не конкурирует с брендом и «Войти». */
.nav-link--muted { color: var(--text-muted); font-size: .82rem; letter-spacing: .04em; }
.nav-link--muted:hover { color: var(--text-secondary); background: var(--bg-secondary); }

/* Карточки */
.card-header { margin-bottom: var(--space-md); }
.card-title { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--text-primary); }
.card-description { color: var(--text-secondary); font-size: 0.95rem; }
.card.hover\:shadow:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

/* Бейджи */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge-primary { background: var(--accent-soft); color: var(--accent-text); }

/* Кнопки-дополнения */
.btn-ghost { background: none; color: var(--text-secondary); border: none; }
.btn-ghost:hover { color: var(--accent); }

/* Формы */
.form-label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: var(--space-xs); color: var(--text-primary); }

/* Раскладка экрана курса */
.course-sidebar { width: 320px; min-width: 320px; background: var(--bg); border-right: 1px solid var(--border); height: 100vh; overflow-y: auto; position: sticky; top: 0; }
.course-content { flex: 1; padding: var(--space-xl); overflow-y: auto; max-width: 880px; }
@media (max-width: 768px) { .course-sidebar { width: 100%; min-width: 0; height: auto; position: static; } .min-h-screen.flex { flex-direction: column; } }

/* Состояния квизов (на случай отсутствия в Tailwind) */
.bg-green-100 { background-color: #DCFCE7; }
.text-green-800 { color: #166534; }
.bg-red-100 { background-color: #FEE2E2; }
.text-red-800 { color: #991B1B; }

/* ============================================================
 * Юридические страницы, cookie-баннер, кросс-платформенность
 * ============================================================ */

/* Cookie-баннер */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9000;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; padding-bottom: calc(14px + env(safe-area-inset-bottom));
  background: #0F172A; color: #fff; box-shadow: 0 -4px 16px rgba(0,0,0,.2);
}
/* Обнаружено E2E-тестом (Playwright): фиксированный баннер перекрывал основную
   кнопку CTA внизу страницы (напр. «Узнать результат» на диагностике) для
   первых посетителей — ровно той аудитории, которая видит баннер. Резервируем
   место под контент, пока баннер на экране. */
body:has(.cookie-banner) { padding-bottom: 110px; }
.cookie-banner__text { font-size: .9rem; max-width: 760px; line-height: 1.5; }
.cookie-banner__actions { display: flex; gap: 10px; flex-shrink: 0; }
.link-inline { background: none; border: none; color: var(--accent-light); cursor: pointer; text-decoration: underline; font: inherit; padding: 0; }

/* Подвал — правовые ссылки */
.footer-legal { margin-top: 14px; }
.footer-legal__link { background: none; border: none; color: #fff; cursor: pointer; font: inherit; text-decoration: underline; opacity: .9; }
.footer-legal__link:hover { opacity: 1; }

/* Страница документов */
.legal-layout { display: grid; grid-template-columns: 280px 1fr; gap: 24px; align-items: start; }
.legal-nav { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 16px; }
.legal-nav__item { text-align: left; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg); cursor: pointer; font: inherit; color: var(--text-secondary); transition: var(--transition); }
.legal-nav__item:hover { border-color: var(--accent); color: var(--accent); }
.legal-nav__item.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }
.legal-doc { line-height: 1.6; }
.legal-doc h3 { margin-top: 1.2em; }
@media (max-width: 768px) { .legal-layout { grid-template-columns: 1fr; } .legal-nav { position: static; flex-direction: row; flex-wrap: wrap; } .legal-nav__item { flex: 1 1 45%; } }

/* ---- Кросс-платформенность: тач-таргеты и безопасные зоны ---- */
.btn, .nav-link, .legal-nav__item, .footer-legal__link, .cookie-banner__actions .btn { min-height: 44px; }
button { touch-action: manipulation; }
@supports (padding: max(0px)) {
  .navbar .container { padding-left: max(var(--space-md), env(safe-area-inset-left)); padding-right: max(var(--space-md), env(safe-area-inset-right)); }
}
/* Шапка на ноутбуке: в режиме открытого курса в строке восемь пунктов меню
   (Каталог, Курс, Тарифы, Экзамен, Интерактив, Кабинет, Документы, Выйти) плюс
   бренд, бейдж XP и переключатель темы. В контейнер шириной 1200 px это не
   помещалось: flex сжимал бренд, и он ломался на три строки, бейдж XP на две,
   а «Выйти» уезжал за правый край экрана. Найдено скриншотом реального
   прогона — на демонстрационном ноутбуке это первое, что видит заказчик.

   Лечим по приоритету содержимого:
   • бренд и бейдж XP не сжимаются и не переносятся — это опора шапки;
   • слоган — украшение, на ноутбучных ширинах уступает место навигации;
   • меню получает меньший шаг, а при совсем узком экране — горизонтальную
     прокрутку вместо обрезки, чтобы ни один пункт не исчезал молча.
   min-width: 0 обязателен: по умолчанию flex-элемент не сжимается меньше
   своего содержимого (min-width: auto), из-за чего строка и переполнялась. */
.navbar-brand { flex-shrink: 0; }
.navbar-brand .text-xl { white-space: nowrap; }
.xp-chip { white-space: nowrap; flex-shrink: 0; }
.navbar-nav {
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.navbar-nav::-webkit-scrollbar { display: none; }
.nav-link { white-space: nowrap; }

@media (max-width: 1400px) {
  .navbar-brand .text-xs { display: none; }
  .navbar-nav { gap: var(--space-sm); }
  .nav-link { padding: var(--space-sm) 10px; }
  /* Второстепенные пункты (юридический раздел продублирован в подвале)
     уступают место рабочим: «Выйти» должен оставаться видимым без прокрутки. */
  .nav-link--secondary { display: none; }
}
@media (max-width: 1100px) {
  .navbar-nav { gap: 4px; }
  .nav-link { padding: var(--space-sm) 8px; }
}

/* На узких экранах навигация переносится, а не обрезается */
@media (max-width: 640px) {
  .navbar .container { flex-wrap: wrap; gap: 8px; }
  .navbar-nav { flex-wrap: wrap; gap: 6px; }
  .nav-link { padding: 8px 10px; }
}

/* Крупный заголовок-герой не должен вылезать на узких экранах */
@media (max-width: 480px) {
  .text-4xl { font-size: 1.8rem !important; line-height: 1.18 !important; }
  .lg\:text-6xl { font-size: 1.8rem !important; line-height: 1.18 !important; }
  .text-3xl { font-size: 1.45rem !important; }
  .py-20 { padding-top: 2.5rem !important; padding-bottom: 2.5rem !important; }
}
h1, h2, h3 { overflow-wrap: break-word; }

/* ============================================================
 * Apple-grade полировка: типографика, фокус, микровзаимодействия
 * ============================================================ */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { font-feature-settings: 'cv05','cv11','ss01'; letter-spacing: -0.011em; text-rendering: optimizeLegibility; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.022em; line-height: 1.12; }
.btn { letter-spacing: -0.01em; font-weight: 600; }
.card-title { letter-spacing: -0.012em; }

/* Доступный фокус-ринг в фирменном цвете (клавиатура) */
:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.45); border-radius: 10px; }
::selection { background: rgba(245, 166, 35, 0.28); color: var(--text-primary); }

/* Навбар — «матовое стекло» как у Apple */
.navbar {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

/* Плавное появление основного контента */
@keyframes zachetFadeUp { from { opacity: .001; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.course-content > div { animation: zachetFadeUp 0.4s cubic-bezier(0.4, 0, 0.2, 1); }

/* Зелёный фирменный акцент для статусов «успех» */
.text-green-800 { color: var(--secondary-dark); }

/* Аккуратные таблицы в теории */
.prose table { border-collapse: collapse; width: 100%; margin: 1em 0; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.prose th { background: var(--bg-secondary); }

/* ============================================================
 * СЛОЙ 2026 — современный визуальный язык (эталон автошкол)
 * Тёмная тема, glass, mesh-герой, pill-фильтры, движение
 * ============================================================ */

/* ---- Тёмная тема ---- */
[data-theme="dark"] {
  /* Киноградиент «асфальт + сумерки» вместо плоского тёмно-синего */
  --bg: #0E1326;             /* кабина / карточки */
  --bg-secondary: #070A16;   /* асфальт — самый тёмный слой */
  --bg-tertiary: #161D33;    /* приподнятые поверхности */
  --text-primary: #EEF2FB;
  --text-secondary: #9FB0CC;
  --text-muted: #93A4C0;     /* ≈6:1 на тёмном — таб-бар/подписи проходят AA */
  --border: #33425E;         /* видимая граница карточек/инпутов (было ~1.2:1) */
  --accent-text: #FFC34D;    /* оранжевый-как-текст, читаемый на тёмном */
  --accent-soft: #221A0E;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 6px 18px rgba(0,0,0,0.45);
  --shadow-lg: 0 16px 40px rgba(0,0,0,0.55);
  --shadow-accent: 0 10px 40px var(--headlight-glow);
}
/* Кинематографичный фон-среда: индиго-сумерки → асфальт + зарево фар */
[data-theme="dark"] body {
  background-color: var(--bg-secondary);
  background-image:
    radial-gradient(120% 60% at 50% 120%, rgba(245,166,35,0.16), transparent 60%),
    radial-gradient(90% 70% at 80% -10%, rgba(58,80,160,0.32), transparent 55%),
    linear-gradient(180deg, #0B1024 0%, #070A16 55%, #04060E 100%);
  background-attachment: fixed;
}
/* Светлый режим — «день / открытая трасса», не офисно-белый */
body:not([data-theme="dark"]) {
  background-image:
    radial-gradient(100% 50% at 50% 115%, rgba(245,166,35,0.08), transparent 60%),
    linear-gradient(180deg, #EAF2FF 0%, #F4F7FC 60%, #FFFFFF 100%);
  background-attachment: fixed;
}
[data-theme="dark"] .navbar { background: rgba(15,23,42,0.72); border-bottom-color: var(--border); }
[data-theme="dark"] .card { background-color: var(--bg); border-color: var(--border); }
[data-theme="dark"] .btn-secondary { background-color: var(--bg-tertiary); color: var(--text-primary); border-color: var(--border); }
[data-theme="dark"] .form-input { background-color: var(--bg-tertiary); color: var(--text-primary); border-color: var(--border); }
[data-theme="dark"] .bg-secondary { background-color: var(--bg-secondary) !important; }
[data-theme="dark"] .bg-tertiary { background-color: var(--bg-tertiary) !important; }
[data-theme="dark"] .legal-nav__item { background: var(--bg); }
[data-theme="dark"] .prose th { background: var(--bg-tertiary); }
[data-theme="dark"] .course-sidebar { background: var(--bg); border-right-color: var(--border); }
[data-theme="dark"] .bg-green-100 { background:#14321F; } [data-theme="dark"] .text-green-800 { color:#86EFAC; }
[data-theme="dark"] .bg-red-100 { background:#3B1518; } [data-theme="dark"] .text-red-800 { color:#FCA5A5; }

/* плавный переход темы */
body, .card, .navbar, .btn, .form-input, .course-sidebar { transition: background-color .3s ease, color .3s ease, border-color .3s ease; }

/* ---- Hero: градиентный mesh + глубина ---- */
.bg-primary {
  position: relative;
  background:
    radial-gradient(1100px 500px at 12% -10%, rgba(255,255,255,0.28), transparent 60%),
    radial-gradient(800px 500px at 110% 10%, rgba(126,211,33,0.30), transparent 55%),
    linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
}
.bg-primary > * { position: relative; z-index: 1; }

/* ---- Стеклянные карточки 2026 ---- */
.card {
  border-radius: 18px;
  backdrop-filter: saturate(120%);
  position: relative;
  overflow: hidden;
}
.card::after { /* тонкая верхняя подсветка */
  content: ''; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent);
  opacity: .6; pointer-events: none;
}
[data-theme="dark"] .card::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.10), transparent); }
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }

/* ---- Кнопки: блик при наведении ---- */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::before {
  content: ''; position: absolute; top: 0; left: -120%; width: 60%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-20deg); transition: left .6s ease;
}
.btn-primary:hover::before { left: 140%; }

/* ---- Pill-фильтры категорий ---- */
.catfilter { border-radius: 999px !important; border: 1px solid var(--border); padding: 8px 18px !important; font-weight: 600; transition: var(--transition); }
.catfilter:hover { border-color: var(--accent); color: var(--accent); }
.catfilter.is-active { background: linear-gradient(135deg, var(--accent), var(--accent2)) !important; color: #fff !important; border-color: transparent; box-shadow: var(--shadow-accent); }

/* ---- Бейдж-категория, более «продуктовый» ---- */
.badge { letter-spacing: .01em; text-transform: none; }

/* ---- Переключатель темы ---- */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); color: var(--text-secondary); cursor: pointer; transition: var(--transition); }
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* ---- Inline SVG-иконки ---- */
.ic { display: inline-flex; vertical-align: middle; }
.ic svg { width: 1.25em; height: 1.25em; }
.icon-chip { display:inline-flex; align-items:center; justify-content:center; width:48px; height:48px; border-radius:14px; background: var(--accent-soft); color: var(--accent2); }
[data-theme="dark"] .icon-chip { color: #FCD34D; }
.icon-chip svg { width: 26px; height: 26px; }

/* ---- Прогресс-кольцо ---- */
.ring { transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 6; }
.ring .bg { stroke: var(--bg-tertiary); }
.ring .fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .5s ease; }

/* ---- Уважение к reduce-motion ---- */
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ============================================================
 * APP-SHELL — ощущение нативного приложения, а не сайта
 * Нижняя таб-навигация (мобайл) + режим приложения
 * ============================================================ */

/* Нижняя таб-панель (как в нативных приложениях) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
  display: none; /* показываем только на мобайле/планшете */
  align-items: stretch; justify-content: space-around;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
[data-theme="dark"] .tabbar { background: rgba(15,23,42,0.92); border-top-color: var(--border); }
.tabbar__item {
  flex: 1; border: none; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 8px 4px; min-height: 56px;
  color: var(--text-muted); font: inherit; font-size: 0.7rem; font-weight: 600;
  transition: color .2s ease;
}
.tabbar__item .ic svg { width: 22px; height: 22px; }
.tabbar__item.is-active { color: var(--accent); }
.tabbar__item.is-active .icon-dot { opacity: 1; }
.tabbar__item .icon-dot { width: 5px; height: 5px; border-radius: 999px; background: var(--accent); opacity: 0; transition: opacity .2s; }

/* В режиме приложения (любой экран кроме лендинга) на мобайле — место под таб-бар */
@media (max-width: 768px) {
  html[data-app="true"] .tabbar { display: flex; }
  html[data-app="true"] body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  /* верхнюю навигацию на мобайле делаем компактной — без длинного списка ссылок */
  html[data-app="true"] .navbar-nav .nav-link:not(.keep-mobile) { display: none; }
}

/* Десктоп: app-режим прячет «сайтовый» подвал на внутренних экранах */
html[data-app="true"] .app-only-hide { display: none; }

/* ============================================================
 * Интерактив: 3D-сцена, справочник знаков, геймификация
 * ============================================================ */
.xp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--accent-soft); color: var(--accent-text);
  font-weight: 700; font-size: .82rem; cursor: pointer; transition: var(--transition); }
.xp-chip:hover { border-color: var(--accent); }
.xp-chip .ic svg { width: 16px; height: 16px; }
.xp-chip__lvl { color: var(--text-muted); font-weight: 600; }

.scene-wrap { position: relative; }
.scene-canvas { width: 100%; height: 460px; }
@media (max-width: 640px) { .scene-canvas { height: 340px; } }
.scene-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--bg); }
.scene-controls { position: absolute; left: 16px; bottom: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.scene-ctrl { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: rgba(255,255,255,0.86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: var(--text-primary); font: inherit; font-weight: 600; font-size: .85rem; cursor: pointer; box-shadow: var(--shadow-md); transition: var(--transition); }
[data-theme="dark"] .scene-ctrl { background: rgba(15,23,42,0.8); color: var(--text-primary); }
.scene-ctrl:hover { transform: translateY(-1px); border-color: var(--accent); color: var(--accent); }
.scene-ctrl .ic svg { width: 18px; height: 18px; }

.signs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.sign-card { text-align: center; cursor: pointer; padding: 16px; }
.sign-card__img { width: 84px; height: 84px; margin: 0 auto 10px; }
.sign-card__img svg { width: 100%; height: 100%; }
.sign-card__name { font-weight: 700; font-size: .95rem; color: var(--text-primary); }

/* Достижения (геймификация) */
.ach { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px;
  border: 1px dashed var(--border); color: var(--text-muted); font-size: .82rem; font-weight: 600; opacity: .65; }
.ach.is-on { border-style: solid; border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); opacity: 1; }
.ach .ic svg { width: 16px; height: 16px; }

/* Таблица лидеров (геймификация) */
.lb-row { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; }
.lb-row + .lb-row { border-top: 1px solid var(--border); }
.lb-rank { font-weight: 800; color: var(--text-muted); }
.lb-name { font-weight: 600; }
.lb-xp { font-weight: 700; color: var(--accent-text); }
.lb-row.is-me { background: var(--accent-soft); border-radius: 10px; }
.lb-row.is-me .lb-rank, .lb-row.is-me .lb-name { color: var(--accent2); }
[data-theme="dark"] .lb-row.is-me { background: rgba(245,166,35,0.12); }

/* ============================================================
 * АРТ-ДИРЕКЦИЯ «ОСОЗНАННОЕ ПОГРУЖЕНИЕ» / NIGHT DRIVE
 * Среда вместо страниц: горизонт, разметка, приборная панель.
 * ============================================================ */

/* ---- Дисплейная типографика «дорожных указателей» ---- */
h1, .display-1 { font-family: var(--font-display); font-weight: 900; letter-spacing: -0.03em; line-height: .95; }
h2, .display-2 { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.025em; line-height: 1.0; }
.eyebrow {
  display: inline-block; font-family: var(--font-sans); font-weight: 700;
  text-transform: uppercase; letter-spacing: .18em; font-size: .78rem;
  color: var(--accent-text);
}
.hud-num { font-family: var(--font-hud); font-feature-settings: 'tnum' 1; font-variant-numeric: tabular-nums; }

/* ---- Signature-motif: разметка ---- */
.lane-divider {
  height: 4px; border: 0; margin: 0;
  background: repeating-linear-gradient(90deg, var(--headlight) 0 28px, transparent 28px 52px);
  border-radius: 2px; opacity: .9;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.lane-underline {
  background-image: repeating-linear-gradient(90deg, var(--headlight) 0 14px, transparent 14px 26px);
  background-position: 0 100%; background-repeat: repeat-x; background-size: 100% 3px;
  padding-bottom: .12em;
}

/* ---- Signature-motif: перспективный пол «уходящая трасса» ---- */
.road-floor { position: relative; overflow: hidden; }
.road-floor::after {
  content: ''; position: absolute; left: 50%; bottom: 0;
  width: 300%; height: 60%; transform: translateX(-50%) perspective(420px) rotateX(62deg);
  transform-origin: bottom center; pointer-events: none; opacity: .5; z-index: 0;
  background:
    repeating-linear-gradient(90deg, var(--lane-dim) 0 1px, transparent 1px 60px),
    repeating-linear-gradient(0deg, var(--lane-dim) 0 1px, transparent 1px 60px);
  -webkit-mask-image: linear-gradient(to top, #000 0%, #000 30%, transparent 85%);
  mask-image: linear-gradient(to top, #000 0%, #000 30%, transparent 85%);
  animation: laneFlow 7s linear infinite;
}
[data-theme="dark"] .road-floor::after { opacity: .35; }
@keyframes laneFlow { to { background-position: 0 140px, 0 140px; } }

/* ---- Приборная панель (HUD) — общий заголовок учебных экранов ---- */
.dash-hud {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
  padding: 12px 18px; border-radius: 16px;
  background: rgba(14,19,38,.55); backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), var(--shadow-md);
}
body:not([data-theme="dark"]) .dash-hud { background: rgba(255,255,255,.7); }
.dash-hud__label { font-family: var(--font-hud); letter-spacing: .04em; color: var(--text-secondary); }

/* ---- Motion: переход экрана «нажать на газ» ---- */
@keyframes driveIn { from { opacity:.001; transform: translateY(28px) scale(.985); filter: blur(6px);} to{opacity:1; transform:none; filter:blur(0);} }
.view-enter { animation: driveIn .42s cubic-bezier(.22,.61,.36,1) both; }

/* ============================================================
 * ЭКРАН 1 — HERO «Живая трасса» (3D-дорога фоном)
 * ============================================================ */
.hero-drive { position: relative; min-height: 92vh; display: flex; align-items: center; overflow: hidden; }
.hero-scene { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero-scene canvas { display: block; width: 100%; height: 100%; }
/* Статичный фолбэк, пока 3D грузится / при reduced-motion / без WebGL */
.hero-fallback {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(120% 60% at 50% 120%, rgba(245,166,35,0.30), transparent 60%),
    linear-gradient(180deg, #122046 0%, #0A1228 55%, #060A18 100%);
}
.hero-veil { position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, transparent, rgba(7,10,22,.18) 38%, rgba(7,10,22,.86) 100%); }
.hero-content { position: relative; z-index: 2; max-width: 780px; text-align: left; }
.hero-content .eyebrow { color: var(--headlight-core); }
.hero-content .display-1 { color: #fff; font-size: clamp(2.6rem, 8vw, 5.5rem); margin: 14px 0 0; text-shadow: 0 2px 30px rgba(0,0,0,.55); }
/* Акцентное слово заголовка: плотная контактная тень даёт чёткие края на ярком
   закатном небе (иначе бледный --headlight-core «тонет»), тёплое зарево держит
   концепт зажжённой фары. Легибельность вверх — контраст лучше, не хуже. */
.hero-content .display-1 .lane-underline {
  color: var(--headlight-core);
  text-shadow: 0 1px 2px rgba(8,12,26,.72), 0 2px 22px rgba(8,12,26,.5), 0 0 26px rgba(245,166,35,.38);
}
.hero-sub { color: rgba(255,255,255,.88); font-size: clamp(1.05rem, 2.4vw, 1.4rem); max-width: 620px; margin: 18px 0 0; text-shadow: 0 1px 16px rgba(0,0,0,.5); }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 30px; }
.hero-cta .btn-headlight { background: var(--grad-headlight); color: #0A0E1C; border: 0; box-shadow: var(--glow-headlight); font-weight: 700; }
.hero-cta .btn-headlight:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(255,210,122,.5), 0 14px 40px var(--headlight-glow); }
.hero-cta .btn-ghost { background: rgba(255,255,255,.06); color: #fff; border: 1.5px solid rgba(255,255,255,.55); backdrop-filter: blur(6px); }
.hero-cta .btn-ghost:hover { background: rgba(255,255,255,.14); border-color: #fff; }
.hero-speedo { position: absolute; right: 5%; bottom: 7%; z-index: 2; opacity: .92; text-align: center; pointer-events: none; }
.hero-speedo .hud-num { font-size: clamp(2rem, 6vw, 3.4rem); color: var(--headlight-core); line-height: 1; }
.hero-speedo small { display:block; font-size:.7rem; letter-spacing:.16em; text-transform:uppercase; color: rgba(255,255,255,.7); margin-top: 4px; }
@media (max-width: 720px) { .hero-speedo { display: none; } }

/* «Фарная» кнопка вне hero (завершение урока, «Дать газ» на экзамене) */
.btn-headlight { background: var(--grad-headlight); color: #0A0E1C; border: 0; box-shadow: var(--glow-headlight); font-weight: 700; }
.btn-headlight:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(255,210,122,.5), 0 14px 40px var(--headlight-glow); }

/* route-stop кликается целиком */
.route-stop { display: flex; align-items: flex-start; gap: 10px; }

/* ============================================================
 * ЭКРАН 2 — УРОК «Маршрут остановок» (вертикальный route-rail)
 * ============================================================ */
.route-rail { position: relative; padding-left: 28px; }
.route-rail::before { content:''; position:absolute; left:11px; top:6px; bottom:6px; width:3px;
  background: repeating-linear-gradient(0deg, var(--lane-dim) 0 10px, transparent 10px 22px); }
.route-stop { position: relative; padding: 12px 0; cursor: pointer; }
.route-stop__dot { position:absolute; left:-22px; top:14px; width:16px; height:16px; border-radius:50%;
  background: var(--bg-tertiary); border:2px solid var(--border); transition: var(--transition); }
.route-stop.is-done .route-stop__dot { background: var(--go); border-color: var(--go); box-shadow:0 0 10px var(--go-glow); }
.route-stop.is-active .route-stop__dot{ background: var(--headlight); border-color: var(--headlight-core);
  box-shadow: 0 0 0 4px var(--headlight-glow); animation: stopPulse 1.8s ease-in-out infinite; }
@keyframes stopPulse { 50% { box-shadow: 0 0 0 8px rgba(245,166,35,0); } }

/* ============================================================
 * ЭКРАН 3 — ЭКЗАМЕН «Выезд под светофор»
 * ============================================================ */
.trafficlight { width: 92px; padding: 14px; border-radius: 20px; background:#0A0E1C; border:1px solid var(--border);
  display:flex; flex-direction:column; gap:14px; box-shadow: var(--shadow-lg); margin: 0 auto; }
.tl-lamp { width:60px; height:60px; border-radius:50%; background:#1A2030; transition: box-shadow .3s, background .3s; }
.tl-lamp.on.red { background: var(--stop); box-shadow: 0 0 28px 6px var(--stop-glow); }
.tl-lamp.on.yellow { background: var(--headlight); box-shadow: 0 0 28px 6px var(--headlight-glow); }
.tl-lamp.on.green { background: var(--go); box-shadow: 0 0 28px 6px var(--go-glow); }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-3px)} 75%{transform:translateX(3px)} }
.answer.is-wrong { animation: shake .25s; border-color: var(--stop) !important; box-shadow: 0 0 0 3px var(--stop-glow); }
.answer.is-right { border-color: var(--go) !important; box-shadow: 0 0 0 3px var(--go-glow); }

/* ============================================================
 * ЭКРАН 4 — 3D «Кабина»: HUD-оверлей и переключатель камеры
 * ============================================================ */
.scene-wrap::before { content:''; position:absolute; inset:0; z-index:2; pointer-events:none;
  background: linear-gradient(180deg, rgba(255,255,255,.05), transparent 18%); border-radius: inherit; }
.scene-hud { position:absolute; top:14px; left:14px; right:14px; z-index:3; pointer-events:none; }
.scene-hud .dash-hud { pointer-events: auto; }
.camswitch { display:inline-flex; border:1px solid var(--border); border-radius:999px; overflow:hidden; background: rgba(10,14,28,.6); }
.camswitch button { padding:8px 16px; background:transparent; color:var(--text-secondary); font-weight:700; border:0; cursor:pointer; }
.camswitch button.is-active { background: var(--grad-headlight); color:#0A0E1C; }

/* HUD-кабина 3D на узких экранах */
@media (max-width: 640px) {
  .scene-hud { top: 10px; left: 10px; right: 10px; }
  .scene-hud .dash-hud { padding: 8px 12px; gap: 8px; }
  .camswitch button { padding: 6px 12px; }
}

/* ============================================================
 * Сертификат о теории (печатаемый) + карта точности по темам
 * ============================================================ */
.certificate {
  position: relative; text-align: center; padding: 40px 32px; border-radius: 20px;
  background: var(--bg); border: 2px solid var(--accent);
  box-shadow: var(--shadow-lg), inset 0 0 0 6px var(--accent-soft);
}
.certificate__seal { font-size: 3rem; margin-bottom: 6px; }
.certificate__title { font-family: var(--font-display); font-size: clamp(2rem, 6vw, 3.2rem); font-weight: 900; letter-spacing: -.02em; margin: 4px 0 0; color: var(--accent-text); }
.certificate__sub { color: var(--text-secondary); margin: 4px 0 18px; }
.certificate__name { font-family: var(--font-display); font-size: clamp(1.6rem, 5vw, 2.4rem); font-weight: 800; margin: 14px 0 6px; }
.certificate__body { color: var(--text-secondary); margin: 0; }
.certificate__course { font-weight: 700; font-size: 1.15rem; margin: 6px 0 22px; }
.certificate__foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-top: 18px; }
.certificate__line { width: 180px; max-width: 40vw; border-bottom: 1.5px solid var(--text-muted); margin-bottom: 6px; }

@media print {
  .navbar, .tabbar, .cert-actions, #loading-screen { display: none !important; }
  body { background: #fff !important; }
  .certificate { box-shadow: none; border-color: #E59400; }
}

/* Карта точности по темам */
.acc-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.acc-bar { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: var(--bg-tertiary); overflow: hidden; }
.acc-bar > span { display: block; height: 100%; border-radius: 999px; transition: width .4s; }
.acc-pct { font-family: var(--font-hud); font-variant-numeric: tabular-nums; font-weight: 700; }

/* Картиночные вопросы билетов (inline-SVG знаков/разметки) */
.quiz-img { display: flex; justify-content: center; margin: 0 0 14px; }
.quiz-img svg { width: 130px; height: 130px; max-width: 45vw; }

/* ============================================================
 * VIBE LAYER 2026 — «ОЖИВЛЕНИЕ» NIGHT DRIVE
 * Глубина · стекло · свет фар · энергия фона. Только добавки.
 * ============================================================ */

/* ---- 0. Доп-токены оживления (переиспользуют существующие) ---- */
:root {
  --vibe-edge: linear-gradient(135deg, rgba(255,210,122,.55), rgba(245,166,35,.10) 40%, transparent 70%);
  --vibe-glow-orange: 0 0 0 1px rgba(255,210,122,.30), 0 18px 50px -12px var(--headlight-glow);
  --vibe-ease: cubic-bezier(.22,.61,.36,1);
}

/* ============================================================
 * 1. КАРТОЧКИ — глубина, градиентная рамка, премиум-hover
 * Базовый .card уже даёт overflow:hidden, ::after-подсветку и lift.
 * Здесь: градиентная рамка (mask-трюк), нижнее свечение, glass в тёмной.
 * ============================================================ */

/* Тонкая градиентная рамка по периметру — рисуем поверх, не трогая border */
.card::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--vibe-edge);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
  opacity: .0;
  transition: opacity .35s var(--vibe-ease);
  pointer-events: none;
  z-index: 1;
}
.card:hover::before { opacity: 1; }

/* Премиум-подъём + тёплое оранжевое свечение под карточкой при hover */
.card { transition: transform .4s var(--vibe-ease), box-shadow .4s var(--vibe-ease), border-color .4s var(--vibe-ease); }
.card:hover {
  box-shadow: var(--shadow-lg), 0 30px 60px -24px var(--headlight-glow);
}

/* Тёмная тема — «стеклянность»: матовый слой + подсветка верхней кромки */
[data-theme="dark"] .card {
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,0) 42%), var(--bg);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), var(--shadow-md);
}
[data-theme="dark"] .card:hover {
  border-color: color-mix(in srgb, var(--headlight) 45%, var(--border));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), var(--shadow-lg), 0 26px 60px -22px var(--headlight-glow);
}

/* ============================================================
 * 2. КНОПКИ — живой свет фар, усиленный блик, активное состояние
 * .btn-primary/.btn-headlight уже имеют ::before-блик. Усиливаем
 * и добавляем тёплое внешнее свечение + чёткий :active.
 * ============================================================ */

/* Усиленный фарный glow + быстрый старт блика */
.btn-primary, .btn-headlight { transition: transform .25s var(--vibe-ease), box-shadow .3s var(--vibe-ease); }
.btn-primary:hover {
  box-shadow: 0 0 0 1px rgba(255,210,122,.5), 0 14px 30px -6px rgba(245,166,35,.5), 0 0 28px -2px var(--headlight-glow);
}
/* Тактильное «нажатие» (контраст текста #0A0E1C не меняем) */
.btn-primary:active, .btn-headlight:active {
  transform: translateY(1px) scale(.985);
  box-shadow: 0 4px 12px -2px rgba(245,166,35,.45), inset 0 2px 6px rgba(10,14,28,.18);
}

/* Блик: чуть ярче и шире для премиальности */
.btn-primary::before, .btn-headlight::before { width: 75%; }

/* Вторичная/ghost — оживлённый край при hover */
.btn-secondary:hover { box-shadow: 0 0 0 1px var(--accent), var(--shadow-md); }

/* ============================================================
 * 3. СЕКЦИИ / ФОН — энергия без потери читаемости
 * Мягкие радиальные блики у заголовков секций + тонкая
 * световая «разметка» сверху секций. Точечно, не на всём.
 * ============================================================ */

/* Заголовок секции с .eyebrow получает мягкое тёплое зарево за собой */
.eyebrow {
  position: relative;
}
.eyebrow::after {
  content: '';
  position: absolute; left: -18px; top: 50%; width: 120px; height: 120px;
  transform: translateY(-50%);
  background: radial-gradient(circle, var(--headlight-glow), transparent 68%);
  opacity: .35; filter: blur(8px); z-index: -1; pointer-events: none;
}
[data-theme="dark"] .eyebrow::after { opacity: .5; }

/* Утилита: секция с «дорожным» световым акцентом по верхней кромке.
 * Добавьте class="section-lit" на существующий <section>/<div> при желании. */
.section-lit { position: relative; }
.section-lit::before {
  content: '';
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: min(680px, 86%); height: 2px;
  background: linear-gradient(90deg, transparent, var(--headlight), transparent);
  opacity: .55; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent);
}

/* ============================================================
 * 4. БЕЙДЖИ / EYEBROW / CHIPS — характер: капс, трекинг, свечение
 * ============================================================ */

/* Eyebrow — лёгкая «лампочка»-маркер слева (дорожный сигнал) */
.eyebrow { padding-left: 16px; }
.eyebrow::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--headlight);
  box-shadow: 0 0 8px 1px var(--headlight-glow);
}

/* Бейдж-категория — премиальнее: капс + трекинг + тонкая рамка-свет */
.badge-primary {
  text-transform: uppercase; letter-spacing: .07em; font-size: .7rem; font-weight: 700;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}
[data-theme="dark"] .badge-primary {
  background: rgba(245,166,35,.12); color: var(--accent-text);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

/* XP-chip / ach — оживлённое свечение в активном состоянии */
.xp-chip:hover { box-shadow: 0 0 0 1px var(--accent), 0 6px 18px -8px var(--headlight-glow); }
.ach.is-on { box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent), 0 4px 14px -8px var(--headlight-glow); }

/* Pill-фильтр активный — добавляем мягкое зарево под капсулой */
.catfilter.is-active { box-shadow: var(--shadow-accent), 0 0 22px -6px var(--headlight-glow); }

/* ============================================================
 * 5. МИКРО-ДЕТАЛИ — разметка-разделители, подчёркивания, icon-chip
 * ============================================================ */

/* icon-chip — градиент «раскалённой фары» + мягкое свечение, живой hover */
.icon-chip {
  background: linear-gradient(150deg, rgba(255,210,122,.22), rgba(245,166,35,.10) 55%, transparent),
              var(--accent-soft);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.20), 0 8px 20px -12px var(--headlight-glow);
  transition: transform .3s var(--vibe-ease), box-shadow .3s var(--vibe-ease);
}
[data-theme="dark"] .icon-chip {
  background: linear-gradient(150deg, rgba(255,210,122,.16), rgba(245,166,35,.06) 55%, transparent),
              var(--bg-tertiary);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 8px 22px -12px var(--headlight-glow);
}
/* Карточка наводится — иконка «загорается» (наследуем hover родителя .card) */
.card:hover .icon-chip {
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 12px 26px -10px var(--headlight-glow);
}

/* Акцентное подчёркивание-«разметка» под любым заголовком: class="mark-underline" */
.mark-underline {
  background-image: repeating-linear-gradient(90deg, var(--headlight) 0 16px, transparent 16px 28px);
  background-position: 0 100%; background-repeat: repeat-x; background-size: 100% 3px;
  padding-bottom: .14em;
}

/* Утилита-разделитель «дорожная разметка» с точками-катафотами по краям */
.lane-divider { position: relative; }
.lane-divider::before,
.lane-divider::after {
  content: ''; position: absolute; top: 50%; transform: translateY(-50%);
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--headlight); box-shadow: 0 0 8px 1px var(--headlight-glow);
  opacity: .8;
}
.lane-divider::before { left: 6%; }
.lane-divider::after  { right: 6%; }

/* ============================================================
 * 6. HERO — кинематографичность: виньетка, свечение, Unbounded
 * .hero-veil / .hero-content уже заданы. Усиливаем глубину и
 * читаемость: круговая виньетка + тёплое зарево фар у заголовка.
 * ============================================================ */

/* Радиальная виньетка поверх сцены — кадр становится «фильмом» */
.hero-drive::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 40%, transparent 45%, rgba(4,6,14,.55) 100%);
}

/* Заголовок героя — мягкое тёплое зарево фар за текстом (читаемость сохранена) */
.hero-content .display-1 { position: relative; }
.hero-content .display-1::before {
  content: ''; position: absolute; left: -8%; top: -20%; width: 70%; height: 140%;
  background: radial-gradient(closest-side, var(--headlight-glow), transparent 70%);
  opacity: .35; filter: blur(20px); z-index: -1; pointer-events: none;
}

/* Дисплейная типографика героя — фирменный Unbounded гарантированно */
.hero-content .display-1 { font-family: var(--font-display); font-weight: 900; }

/* Скоростомер героя — лёгкая пульсация «живого приборного света» */
.hero-speedo .hud-num { text-shadow: 0 0 18px var(--headlight-glow); animation: hudFlicker 4.5s ease-in-out infinite; }
@keyframes hudFlicker { 0%,100% { opacity: .92; } 50% { opacity: 1; text-shadow: 0 0 26px var(--headlight-glow); } }

/* CTA в герое — фарная кнопка получает «дальний свет» при hover */
.hero-cta .btn-headlight:hover { box-shadow: 0 0 0 1px rgba(255,210,122,.6), 0 18px 50px -8px var(--headlight-glow), 0 0 40px -4px var(--headlight-glow); }

/* ============================================================
 * POLISH 2026 — доводка до «превосходно»
 * ============================================================ */
/* Skeleton-шиммер вместо безликих спиннеров */
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton { background: linear-gradient(90deg, var(--bg-tertiary) 0%, var(--bg-secondary) 40%, var(--bg-tertiary) 80%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: var(--radius); }
.skeleton-card { height: 180px; border-radius: var(--radius-lg); }

/* Критический таймер экзамена (<60с): красный + пульс — эмоциональный пик */
.timer-critical { color: var(--stop) !important; animation: timerPulse 1s ease-in-out infinite; }
@keyframes timerPulse { 50% { opacity: .55; text-shadow: 0 0 14px var(--stop-glow); } }

/* Иконка-стрелка в кнопке сдвигается при hover — премиальная микро-деталь */
.btn .ic--arrow { transition: transform .25s var(--vibe-ease, ease); }
.btn:hover .ic--arrow { transform: translateX(3px); }

/* Явные фокус-кольца для кастомных кликабельных элементов (клавиатура) */
.catfilter:focus-visible, .tabbar__item:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); border-radius: 999px; }
.route-stop:focus-visible, .sign-card:focus-visible, .lb-row:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent); border-radius: 10px; }

/* Золотая звезда рейтинга в каталоге */
.rating-star { color: var(--accent); }

/* Стеклянные тосты в духе VIBE-слоя */
.notification { background: rgba(14,19,38,.62); backdrop-filter: blur(14px) saturate(150%); color: var(--text-primary); border-color: var(--border); }
body:not([data-theme="dark"]) .notification { background: rgba(255,255,255,.82); }

/* Прогресс-кольцо готовности */
.ring-wrap { position: relative; display: inline-block; }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring .fg { transition: stroke-dashoffset .8s cubic-bezier(.22,.61,.36,1); }

/* Tariffs: акцент на рекомендованном тарифе */
.tariff-popular { position: relative; }
@media (min-width: 768px) { .tariff-popular { transform: scale(1.045); z-index: 1; } }
.tariff-badge { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); white-space: nowrap; box-shadow: var(--shadow-accent); z-index: 2; }
.feature-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.feature-row:last-child { border-bottom: 0; }
.feature-row .fr-ico { display: inline-flex; flex: 0 0 auto; }

/* ============================================================
 * Мобильная доводка и финальная гармония
 * ============================================================ */
/* Hero: small-viewport height (не подрезается адресной строкой) */
.hero-drive { min-height: 92svh; }
@media (max-width: 720px) {
  .hero-content .display-1 { font-size: clamp(2.2rem, 11vw, 3.4rem); }
  .hero-speedo { position: static; display: block; margin: 18px 0 0; opacity: .85; text-align: left; }
}
/* dash-hud на узких экранах — в колонку, по центру */
@media (max-width: 560px) {
  .dash-hud { grid-template-columns: 1fr; gap: 6px; text-align: center; justify-items: center; }
  .scene-hud .dash-hud { grid-template-columns: auto auto; }
}
/* Таб-бар: стабильная раскладка (4 равных слота) */
.tabbar__item { min-width: 0; }
/* Звезда рейтинга в каталоге — золотая */
.cat-rating .ic { color: var(--accent); }

/* ---------- Модалка входа/регистрации (Волна B: реальный auth за фиче-флагом) ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(6, 9, 20, .62); backdrop-filter: blur(3px);
  animation: fadeIn .18s ease;
}
.modal-card { width: 100%; max-width: 420px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .modal-overlay { animation: none; } }

/* ---------- Skip-link для клавиатуры (a11y, Волна C) ---------- */
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 1100;
  background: var(--accent); color: #0A0E1C; font-weight: 700;
  padding: 10px 16px; border-radius: 8px; transition: top .15s ease;
}
.skip-link:focus { top: 8px; outline: 3px solid var(--bg); }

/* ---------- Метка слабой темы в карте точности (не только цвет — a11y) ---------- */
.acc-weak-tag { font-size: .68rem; font-weight: 700; color: var(--stop); margin-left: 6px; text-transform: uppercase; letter-spacing: .03em; }

/* Только для скринридеров (a11y): заголовки/анонсы, невидимые визуально */
.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;
}

/* ---------- W2: светофорная секвенция вердикта экзамена (кинематографичный «выезд») ---------- */
.tl-seq .tl-lamp { animation: tlScan .35s ease both; }
.tl-seq .tl-lamp:nth-child(1) { animation-delay: .05s; }
.tl-seq .tl-lamp:nth-child(2) { animation-delay: .38s; }
.tl-seq .tl-lamp:nth-child(3) { animation-delay: .71s; }
.tl-seq .tl-lamp.on { animation: tlScan .35s ease both, tlIgnite .55s ease 1.05s both; }
@keyframes tlScan { 0% { filter: brightness(.55); } 45% { filter: brightness(2.4); transform: scale(1.14); } 100% { filter: none; transform: none; } }
@keyframes tlIgnite { 0% { transform: scale(1); } 45% { transform: scale(1.28); filter: brightness(1.9); } 100% { transform: none; filter: none; } }
@media (prefers-reduced-motion: reduce) { .tl-seq .tl-lamp { animation: none !important; } }

/* ---------- HUD прогресса в идущем экзамене (P1-p: арт-дирекция там, где юзер живёт) ---------- */
.exam-hud { display: flex; align-items: center; gap: 14px; padding: 12px 16px; margin-bottom: 16px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
.exam-hud .hud-num { font-size: 1.6rem; line-height: 1; color: var(--accent-text); }
.exam-hud .exam-hud__bar { flex: 1; }

/* Контрольная точка на route-rail: акцентная остановка-«флаг».
   is-done = реально пройдена (>=4/5); is-attempted = была попытка, но не зачёт —
   НЕ зелёный (иначе провал визуально неотличим от успеха, планёрка №4 P1). */
.route-stop--cp .route-stop__dot { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.route-stop--cp.is-done .route-stop__dot { background: var(--go); }
.route-stop--cp.is-attempted .route-stop__dot { background: var(--stop); box-shadow: 0 0 0 3px rgba(255, 59, 48, .15); }

/* ---------- Инвест-полировка (2026-07-22): паттерны уровня Magic UI, нативно ----------
   Библиотеки Magic UI/Kokonut/React Bits — React+Tailwind+framer-motion со сборкой;
   у нас сборки нет по решению В5, поэтому берём их ДИЗАЙН-ПАТТЕРНЫ и реализуем
   на чистом CSS/ванильном React. Ноль новых зависимостей (принцип №8). */

/* Shimmer-edge (паттерн shimmer-button): бегущий световой блик по периметру CTA. */
.shimmer-edge { position: relative; isolation: isolate; overflow: visible; }
.shimmer-edge::after {
  content: ""; position: absolute; inset: -2px; border-radius: inherit; z-index: -1;
  background: conic-gradient(from var(--shimmer-a, 0deg),
    transparent 0 40deg, rgba(255, 214, 130, .95) 55deg, transparent 75deg 360deg);
  animation: shimmerSpin 2.6s linear infinite;
  filter: blur(1px);
}
@property --shimmer-a { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes shimmerSpin { to { --shimmer-a: 360deg; } }
/* Фолбэк без @property (старые браузеры): блик статичен — не ломаемся. */
@supports not (background: conic-gradient(from var(--x, 0deg), red, blue)) {
  .shimmer-edge::after { animation: none; }
}

/* Метрики-тикеры: моноширинные цифры, чтобы не «дёргалась» ширина при отсчёте. */
.stat-ticker { font-variant-numeric: tabular-nums; }

/* Продуктовая строка метрик: тише основной (вторичная типографика, без карточек). */
.stat-strip { display: flex; justify-content: center; gap: 28px; flex-wrap: wrap;
  padding: 10px 0 0; color: var(--text-secondary); }
.stat-strip b { color: var(--accent-text); font-weight: 800; }
