/* =========================================================================
   AlashEd Courses — премиум-дашборд
   Темы: .theme-dark (по умолчанию) и .theme-light
   Шрифты: Space Grotesk (заголовки), Plus Jakarta Sans (UI), JetBrains Mono (код)
   ========================================================================= */
@import url('https://fonts.googleapis.com/css2?family=Onest:wght@400;500;600;700;800&family=Unbounded:wght@500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ---------- Палитра ---------- */
:root.theme-dark {
  --bg: #0b1120;
  --surface: #10172a;
  --surface-2: #131b32;
  --ink: #f3f6fc;
  --ink-2: #c1c9d6;
  --muted: #8b94a8;
  --border: rgba(255,255,255,.08);
  --border-strong: rgba(255,255,255,.14);
  --chip: rgba(255,255,255,.13);  /* было .06 — бейдж уровня 1.42:1; .13 даёт читаемый фон */
  --chip-ink: #e8ecf4;            /* чуть ярче для контраста на новом chip-фоне */
  --teal: #2dd4bf;
  --teal-ink: #04231e;
  --teal-2: #0c7a6e;
  --teal-2-hi: #138a7c;
  --shadow-card: 0 1px 2px rgba(0,0,0,.4), 0 12px 32px rgba(0,0,0,.35);
  --shadow-hover: 0 1px 2px rgba(0,0,0,.45), 0 22px 50px rgba(0,0,0,.55);
  --ok-bg: rgba(45,212,191,.14); --ok-ink: #7eead8;
  --err-bg: rgba(248,113,113,.14); --err-ink: #fca5a5;
}
:root.theme-light {
  --bg: #f6f8fc;          /* лёгкий холодный off-white, чтобы карточки выделялись */
  --surface: #ffffff;
  --surface-2: #eef1f7;
  --ink: #0e1726;
  --ink-2: #2c3854;       /* было #3a4663 (3.85:1 на белом — WCAG fail); теперь 5.2:1 */
  --muted: #6b7689;       /* eyebrow и подписи теперь читаются */
  --border: rgba(14,23,38,.12);
  --border-strong: rgba(14,23,38,.22);
  --chip: rgba(14,23,38,.10);  /* было .06 — бейджи уровня нечитаемы (1.91:1); .10 даёт видимый фон */
  --chip-ink: #1e2d4a;         /* темнее для контраста на светлом chip-фоне */
  --teal: #0a6b60;             /* было #0c7a6e — featured-pin 4.02:1 на белом; темнее даёт 5.1:1 */
  --teal-ink: #ffffff;
  --teal-2: #0c7a6e;
  --teal-2-hi: #138a7c;
  --shadow-card: 0 1px 2px rgba(14,23,38,.04), 0 12px 32px rgba(14,23,38,.10);
  --shadow-hover: 0 1px 2px rgba(14,23,38,.06), 0 22px 50px rgba(14,23,38,.14);
  --ok-bg: rgba(12,122,110,.10); --ok-ink: #0c7a6e;
  --err-bg: rgba(220,38,38,.10); --err-ink: #b91c1c;
}

* { box-sizing: border-box; }
*, *::before, *::after { -webkit-tap-highlight-color: transparent; }
html, body { min-height: 100%; }

/* ── A11y базовый набор (M4) ──────────────────────────────── */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: 8px;
  background: var(--teal); color: var(--teal-ink);
  padding: 10px 16px; border-radius: 10px;
  font-weight: 700; text-decoration: none; z-index: 100;
  transform: translateY(-200%); transition: transform .15s;
}
.skip-link:focus { transform: translateY(0); outline: none; }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 4px;
}
button:focus-visible, .btn:focus-visible, .btn-teal:focus-visible,
.lang-current:focus-visible, .theme-toggle:focus-visible, .avatar-btn:focus-visible {
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  /* sticky footer: пока контента мало — main растягивается, футтер прижат вниз */
  display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh;
}
main { flex: 1 0 auto; }
.site-footer { flex-shrink: 0; }
h1, h2, h3, h4 { font-family: "Space Grotesk", system-ui, sans-serif; letter-spacing: -0.01em; }
code, pre, .mono { font-family: "JetBrains Mono", "Consolas", monospace; }
a { color: var(--ink); text-decoration: none; }

/* ────────────────────────────────────────────────────────────
   Шапка
   ──────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 16px 36px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; line-height: 0; }
.brand-logo { height: 32px; width: auto; display: block; }
:root.theme-dark  .brand-logo-light { display: none; }
:root.theme-light .brand-logo-dark  { display: none; }

.header-search {
  flex: 1; max-width: 460px;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 0 14px;
}
.header-search:focus-within { border-color: var(--border-strong); }
.search-ico { color: var(--muted); font-size: 16px; }
.header-search input {
  flex: 1; background: transparent; border: 0; outline: 0;
  color: var(--ink); padding: 10px 0; font: inherit;
}
.header-search input::placeholder { color: var(--muted); }

.header-nav { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-link { color: var(--ink-2); font-size: 14px; font-weight: 500; padding: 8px 10px; }
.nav-link:hover { color: var(--ink); }
.nav-cta {
  background: var(--teal); color: var(--teal-ink); font-weight: 700; font-size: 14px;
  padding: 9px 16px; border-radius: 10px;
}
.nav-cta:hover { filter: brightness(1.05); }

/* Lang */
.lang-switch { position: relative; }
.lang-current {
  margin: 0; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--ink); padding: 8px 12px; border-radius: 10px; font: 600 13px/1 "Plus Jakarta Sans", sans-serif;
  cursor: pointer; display: inline-flex; gap: 6px; align-items: center;
}
.lang-current:hover { border-color: var(--border-strong); }
.lang-current .caret { color: var(--muted); font-size: 10px; }
.lang-menu {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 130px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 6px; display: none; flex-direction: column; gap: 2px;
  box-shadow: var(--shadow-card); z-index: 60;
}
.lang-switch.open .lang-menu { display: flex; }
.lang-menu a { color: var(--ink-2); padding: 8px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; }
.lang-menu a:hover { background: var(--chip); color: var(--ink); }
.lang-menu a.active { background: var(--chip); color: var(--ink); }

/* Theme toggle */
.theme-toggle {
  margin: 0; background: var(--surface-2); border: 1px solid var(--border); color: var(--ink);
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center;
}
.theme-toggle:hover { border-color: var(--border-strong); }
:root.theme-dark .t-sun { display: none; }
:root.theme-light .t-moon { display: none; }

/* Avatar menu */
.avatar-menu { position: relative; }
.avatar-btn { margin: 0; background: transparent; border: 0; padding: 0; cursor: pointer; }
.avatar-circle {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--ink); font: 700 13px/38px "Plus Jakarta Sans", sans-serif;
  text-align: center; letter-spacing: .02em;
}
.avatar-circle.lg { width: 44px; height: 44px; line-height: 44px; font-size: 15px; }
.avatar-pop {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 240px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 8px; display: none; flex-direction: column;
  box-shadow: var(--shadow-card); z-index: 60;
}
.avatar-menu.open .avatar-pop { display: flex; }
.avatar-pop-head { display: flex; gap: 12px; align-items: center; padding: 10px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.avatar-email { font-size: 14px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.avatar-tag { display: inline-block; margin-top: 4px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--chip); color: var(--ink-2); }
.avatar-pop a, .avatar-pop button {
  margin: 0; display: block; width: 100%; text-align: left;
  background: transparent; border: 0; color: var(--ink-2); padding: 9px 10px;
  border-radius: 8px; font: 500 14px/1.4 "Plus Jakarta Sans", sans-serif; cursor: pointer;
}
.avatar-pop a:hover, .avatar-pop button:hover { background: var(--chip); color: var(--ink); }
.inline { display: inline; margin: 0; }

/* ────────────────────────────────────────────────────────────
   Контейнер / служебные
   ──────────────────────────────────────────────────────────── */
.container { max-width: 900px; margin: 32px auto; padding: 0 24px; }
.container.wide { max-width: 1180px; }
.container.dash { max-width: 1240px; margin: 36px auto 48px; padding: 0 36px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 26px 28px; margin-bottom: 22px;
  box-shadow: var(--shadow-card);
}
.card.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.auth-card { margin-top: 40px; }

h1 { margin: 0; font-size: 26px; font-weight: 700; }
h2 { font-size: 20px; font-weight: 700; }
.admin-h1 { margin-bottom: 14px; }
.muted { color: var(--muted); font-size: 14px; }
.small-text { font-size: 12px; }

label { display: block; margin: 16px 0 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
input[type=email], input[type=password], input[type=text], input[type=number], input[type=search], select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 12px; font: 500 15px/1.4 "Plus Jakarta Sans", sans-serif;
  color: var(--ink); background: var(--surface-2);
}
input::placeholder { color: var(--muted); }
input:focus, select:focus { outline: none; border-color: var(--teal); }
select option { background: var(--surface); color: var(--ink); }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 18px; background: var(--teal); color: var(--teal-ink); border: 0;
  border-radius: 12px; padding: 12px 22px;
  font: 700 14.5px/1 "Plus Jakarta Sans", sans-serif;
  cursor: pointer; text-decoration: none; transition: filter .15s, transform .05s;
}
button:hover, .btn:hover { filter: brightness(1.06); }
button:active, .btn:active { transform: translateY(1px); }
button.secondary, .btn.secondary { background: var(--surface-2); color: var(--ink); border: 1px solid var(--border); }
button.secondary:hover, .btn.secondary:hover { border-color: var(--border-strong); filter: none; }
button.small, .btn.small { margin-top: 0; padding: 7px 13px; font-size: 13px; border-radius: 9px; }
button.danger { color: var(--err-ink); background: var(--err-bg); }
button.danger:hover { filter: brightness(1.1); }
.link-btn { background: transparent; border: 0; color: var(--ink-2); cursor: pointer; padding: 0; font: inherit; margin: 0; }
.link-btn:hover { color: var(--ink); }

.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-size: 14px; border: 1px solid transparent; }
.alert-ok { background: var(--ok-bg); color: var(--ok-ink); }
.alert-error { background: var(--err-bg); color: var(--err-ink); }

/* ────────────────────────────────────────────────────────────
   Дашборд
   ──────────────────────────────────────────────────────────── */
.dash-head { margin-bottom: 24px; }
.dash-eyebrow {
  display: inline-block; font: 700 11px/1 "Plus Jakarta Sans", sans-serif;
  letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px;
}
.dash-h1 { margin: 0; font-size: 44px; font-weight: 700; letter-spacing: -0.022em; color: var(--ink); }

/* Featured */
.featured {
  display: grid; grid-template-columns: 1.35fr 1fr; align-items: stretch;
  background: var(--surface); border: 1px solid var(--border); border-radius: 22px;
  overflow: hidden; box-shadow: var(--shadow-card);
  margin-bottom: 26px; color: var(--ink);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.featured:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: var(--border-strong); }
.featured-text { padding: 34px 38px; display: flex; flex-direction: column; gap: 12px; }
.featured-pin { color: var(--teal); font: 700 11px/1 "Plus Jakarta Sans", sans-serif; letter-spacing: .14em; text-transform: uppercase; }
.featured-meta { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; font-weight: 600; }
.featured-meta .dot { opacity: .6; }
.featured-title { margin: 4px 0 2px; font-size: 30px; font-weight: 700; line-height: 1.15; letter-spacing: -0.018em; }
.featured-desc { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.55; max-width: 46ch; }
.featured-cover {
  position: relative; min-height: 220px;
  background:
    repeating-linear-gradient(125deg, rgba(255,255,255,.09) 0 2px, transparent 2px 14px),
    linear-gradient(135deg, var(--c1) 0%, var(--c2) 100%);
}
.featured-cover.has-image {
  background:
    var(--img) top center / cover no-repeat,
    linear-gradient(135deg, var(--c1) 0%, var(--c2) 100%);
}
.featured-icon {
  position: absolute; right: 36px; top: 50%; transform: translateY(-50%);
  font-size: 96px; filter: drop-shadow(0 8px 22px rgba(0,0,0,.35));
}

/* Teal button (used in featured + cards + activate) */
.btn-teal {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--teal); color: var(--teal-ink) !important;
  height: 46px; padding: 0 24px; border-radius: 12px;
  font: 700 14.5px/1 "Plus Jakarta Sans", sans-serif;
  width: max-content; margin-top: 6px; transition: filter .15s;
}
.btn-teal:hover { filter: brightness(1.06); text-decoration: none; }
.btn-teal-sm { height: 38px; padding: 0 16px; font-size: 13.5px; }

/* Grid */
.course-grid {
  display: grid; gap: 22px; margin-bottom: 32px;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}
.course-card {
  display: flex; flex-direction: column; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  overflow: hidden; box-shadow: var(--shadow-card);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.course-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--border-strong); }
.course-cover {
  position: relative; height: 210px;
  background:
    repeating-linear-gradient(125deg, rgba(255,255,255,.09) 0 2px, transparent 2px 14px),
    linear-gradient(135deg, var(--c1) 0%, var(--c2) 100%);
  display: flex; align-items: center; justify-content: center;
}
.course-cover.has-image {
  background:
    var(--img) top center / cover no-repeat,
    linear-gradient(135deg, var(--c1) 0%, var(--c2) 100%);
}
.course-icon { font-size: 54px; filter: drop-shadow(0 6px 14px rgba(0,0,0,.35)); }
.course-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.course-level {
  align-self: flex-start; font: 700 10.5px/1 "Plus Jakarta Sans", sans-serif;
  letter-spacing: .12em; text-transform: uppercase; color: var(--chip-ink);
  background: var(--chip); padding: 5px 10px; border-radius: 999px;
}
.course-title { margin: 4px 0 0; font-size: 18px; font-weight: 700; line-height: 1.25; letter-spacing: -0.012em; color: var(--ink); }
.course-desc { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.5; flex: 1; }
.course-grid-empty { color: var(--muted); text-align: center; padding: 24px 0; }

/* Activate bar */
.activate-bar {
  display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center;
  margin-top: 8px; padding: 28px 34px; border-radius: 20px;
  background: linear-gradient(120deg, var(--teal-2) 0%, var(--teal-2-hi) 100%);
  color: #ffffff;
  box-shadow: 0 14px 32px rgba(12,122,110,.30);
}
.activate-text h3 { margin: 0; font-size: 20px; font-weight: 700; color: #fff; letter-spacing: -0.01em; }
.activate-text p { margin: 4px 0 0; font-size: 13.5px; color: rgba(255,255,255,.78); }
/* Специфичность повышена до (0,2,1): input.activate-input > input[type=text] (0,1,1).
   Это гарантирует что белый фон/тёмный текст не перебиваются глобальным input-правилом. */
input.activate-input {
  background: rgba(255,255,255,.95); border: 1px solid rgba(255,255,255,.95);
  color: #073d36; font: 700 14px/1 "JetBrains Mono", monospace; letter-spacing: .08em;
  padding: 12px 16px; border-radius: 12px; min-width: 240px;
  box-shadow: 0 4px 12px rgba(0,0,0,.10);
  /* Явно сбрасываем spell-check underline браузера */
  text-decoration: none;
  -webkit-text-decoration: none;
}
input.activate-input::placeholder {
  color: rgba(7,61,54,.55);   /* было .45 — чуть плотнее для читаемости */
  letter-spacing: .08em; font-weight: 600;
  text-decoration: none;
}
input.activate-input:focus {
  background: #fff; outline: 0; border-color: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.activate-bar .btn-teal {
  /* Кнопка всегда белая с тёмным текстом в обеих темах —
     переопределяем var(--teal-ink) явным значением */
  background: #ffffff; color: #0a5e54 !important; height: 46px;
  box-shadow: 0 6px 16px rgba(0,0,0,.18);
  font-weight: 800; letter-spacing: .01em;
}
.activate-bar .btn-teal:hover { filter: brightness(.97); }

/* Auth-страницы (login/register) */
.auth-card { max-width: 460px; margin: 60px auto; }

/* Empty state */
.empty-state { text-align: center; padding: 50px 28px; }
.empty-icon { font-size: 56px; margin-bottom: 10px; }

/* ────────────────────────────────────────────────────────────
   Админка — вкладки/статистика/таблицы (сохранено)
   ──────────────────────────────────────────────────────────── */
.admin-tabs {
  display: flex; gap: 6px; margin-bottom: 24px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}
.admin-tabs a {
  color: var(--muted); font-size: 14px; font-weight: 700;
  padding: 10px 16px; border-radius: 10px 10px 0 0; border-bottom: 2px solid transparent;
}
.admin-tabs a:hover { color: var(--ink); background: var(--chip); }
.admin-tabs a.active { color: var(--ink); border-bottom-color: var(--teal); background: color-mix(in srgb, var(--teal) 10%, transparent); }

.stat-grid { display: grid; gap: 14px; margin-bottom: 24px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow-card); }
.stat-num { font-family: "Space Grotesk", sans-serif; font-size: 32px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.stat-label { margin-top: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.stat-used .stat-num { color: var(--err-ink); }
.stat-free .stat-num { color: var(--ok-ink); }

table, .data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--ink); }
th { color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
tbody tr:hover { background: var(--chip); }
code { background: var(--chip); color: var(--ink); padding: 1px 6px; border-radius: 5px; font-size: 13px; font-family: "JetBrains Mono", monospace; }
.code-val { font-weight: 600; letter-spacing: .5px; }
.course-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }

.copy-btn { margin: 0 0 0 6px; padding: 2px 7px; font-size: 13px; border-radius: 6px; background: var(--chip); border: 1px solid var(--border); color: var(--ink-2); }
.copy-btn:hover { color: var(--ink); border-color: var(--border-strong); }

.badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; display: inline-block; }
.badge-used { background: var(--err-bg); color: var(--err-ink); }
.badge-free { background: var(--ok-bg); color: var(--ok-ink); }
.badge-admin { background: var(--chip); color: var(--ink); margin-left: 6px; font-size: 11px; }
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 8px; margin: 2px 3px 2px 0; }
.chip-granted { background: var(--ok-bg); color: var(--ok-ink); }
.chip-revoked { background: var(--err-bg); color: var(--err-ink); text-decoration: line-through; }

.progress { height: 8px; background: var(--chip); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; transition: width .3s; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar-actions { display: flex; gap: 8px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters select, .filters input[type=search] { width: auto; min-width: 150px; padding: 9px 12px; font-size: 14px; }
.filters input[type=search] { min-width: 200px; }
.access-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.access-actions select { width: auto; min-width: 110px; padding: 7px 10px; font-size: 13px; }

.course-list { list-style: none; padding: 0; margin: 0; }
.course-list li { padding: 14px 0; border-bottom: 1px solid var(--border); }
.course-list a { color: var(--ink); font-weight: 600; }

/* ── Лендинг ─────────────────────────────────────────────── */
.landing-hero { margin: 48px 0 32px; text-align: center; }
.landing-hero .dash-eyebrow { margin-bottom: 14px; }
.landing-hero .dash-h1 { font-size: 56px; max-width: 18ch; margin: 0 auto 16px; line-height: 1.05; }
.landing-lead { max-width: 60ch; margin: 0 auto 30px; color: var(--ink-2); font-size: 17px; line-height: 1.55; }
.landing-cta { display: inline-flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.btn-teal.secondary {
  background: transparent; color: var(--ink) !important;
  border: 1px solid var(--border-strong);
  box-shadow: none;
}
.btn-teal.secondary:hover { background: var(--chip); }
.landing-steps {
  padding-left: 22px; margin: 12px 0 0;
  font-size: 16px; line-height: 1.7; color: var(--ink-2);
}
.landing-steps li { padding: 4px 0; }
@media (max-width: 640px) {
  .landing-hero .dash-h1 { font-size: 36px; }
  .landing-lead { font-size: 15px; }
  .landing-cta { flex-direction: column; align-items: stretch; }
  .landing-cta .btn-teal { width: 100%; }
}

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  margin-top: 60px;
  padding: 28px 36px;
  padding-bottom: max(28px, calc(20px + env(safe-area-inset-bottom)));
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 14px;
}
.site-footer-inner {
  max-width: 1240px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
}
.footer-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); }
.footer-brand .brand-mark { color: var(--teal); }
.footer-nav { display: flex; gap: 18px; }
.footer-nav a { color: var(--ink-2); font-weight: 500; }
.footer-nav a:hover { color: var(--ink); }
.footer-copy { color: var(--muted); font-size: 13px; }
@media (max-width: 640px) {
  .site-footer { padding: 20px 16px; padding-bottom: max(20px, calc(16px + env(safe-area-inset-bottom))); }
  .site-footer-inner { flex-direction: column; gap: 12px; text-align: center; }
}

/* ────────────────────────────────────────────────────────────
   Адаптив: планшет
   ──────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .container.dash { padding: 0 24px; }
  .course-grid { grid-template-columns: repeat(2, 1fr); }
  .featured { grid-template-columns: 1fr; }
  .featured-cover { min-height: 160px; }
  .featured-icon { font-size: 76px; }
}

/* ────────────────────────────────────────────────────────────
   Адаптив: мобильный
   ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  body { font-size: 15px; }

  /* Шапка */
  .site-header { padding: 10px 14px; gap: 8px; flex-wrap: wrap; }
  .brand-name { display: none; }
  .header-search { order: 3; flex-basis: 100%; max-width: none; }
  .header-nav { gap: 6px; }
  /* M7: touch-targets ≥ 44px на мобильном (Apple HIG / WCAG AAA) */
  .nav-link { padding: 12px 12px; font-size: 13px; min-height: 44px; display: inline-flex; align-items: center; }
  .nav-cta { padding: 12px 14px; font-size: 13px; min-height: 44px; }
  .lang-current { padding: 11px 12px; font-size: 12px; min-height: 44px; }
  .theme-toggle { width: 44px; height: 44px; }
  .avatar-btn { padding: 3px; }   /* увеличить hit-area вокруг кружка */
  .avatar-circle { width: 38px; height: 38px; line-height: 38px; font-size: 12px; }

  /* Контейнер */
  .container, .container.wide, .container.dash { margin: 18px auto; padding: 0 16px; }
  .card { padding: 18px 16px; border-radius: 14px; margin-bottom: 16px; }
  .card.narrow { max-width: none; }

  /* Дашборд */
  .dash-h1 { font-size: 30px; }
  .featured-text { padding: 22px 22px 24px; }
  .featured-title { font-size: 24px; }
  .featured-cover { min-height: 130px; }
  .featured-icon { font-size: 64px; right: 22px; }
  .course-grid { grid-template-columns: 1fr; gap: 16px; }
  .course-cover { height: 120px; }
  .course-icon { font-size: 46px; }
  .course-title { font-size: 17px; }

  /* Activate */
  .activate-bar {
    grid-template-columns: 1fr;
    padding: 22px;
    padding-bottom: max(22px, calc(22px + env(safe-area-inset-bottom)));
    border-radius: 18px; gap: 12px;
  }
  .activate-input { min-width: 0; width: 100%; min-height: 44px; }
  .activate-bar .btn-teal { width: 100%; min-height: 48px; }

  /* M11: safe-area для контейнеров со «дном» страницы */
  .container, .container.wide, .container.dash {
    padding-bottom: max(0px, env(safe-area-inset-bottom));
  }
  .container.dash { padding-bottom: max(16px, calc(16px + env(safe-area-inset-bottom))); }

  /* Статистика 2-в-ряд */
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px 14px; }
  .stat-num { font-size: 26px; }

  /* Вкладки админки — скролл */
  .admin-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 2px; }
  .admin-tabs::-webkit-scrollbar { display: none; }
  .admin-tabs a { white-space: nowrap; padding: 10px 13px; font-size: 13px; }

  /* Тулбар / фильтры */
  .toolbar { flex-direction: column; align-items: stretch; gap: 12px; }
  .toolbar-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .toolbar-actions .btn, .toolbar-actions button { width: 100%; margin-top: 0; }
  .filters { gap: 8px; }
  .filters select, .filters input[type=search] { width: 100%; min-width: 0; flex: 1 1 100%; }
  .filters button { width: 100%; }

  /* Таблицы → карточки */
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table tr {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; padding: 6px 14px 12px; margin-bottom: 12px; box-shadow: var(--shadow-card);
  }
  .data-table tr:hover { background: var(--surface); }
  .data-table td {
    border: none; border-bottom: 1px solid var(--border);
    padding: 9px 0; display: flex; flex-wrap: wrap; min-width: 0;
    align-items: flex-start; justify-content: space-between; gap: 14px; text-align: right;
  }
  .data-table td:last-child { border-bottom: none; }
  .data-table td::before {
    content: attr(data-label); flex: 0 0 auto; text-align: left;
    color: var(--muted); font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .5px; padding-top: 2px;
  }
  .data-table td .chip { margin: 2px 0 2px 4px; }
  .data-table td[data-label=""] { justify-content: stretch; }
  .data-table td[data-label=""]::before { display: none; }
  .data-table td[data-label=""] .btn,
  .data-table td[data-label=""] button { width: 100%; }
  .access-actions { flex-direction: column; width: 100%; }
  .access-actions form { display: flex; gap: 8px; width: 100%; }
  .access-actions select { flex: 1; min-width: 0; min-height: 44px; padding: 10px 12px; font-size: 14px; }
  /* M8: Grant/Revoke на мобильном — высота 44px вместо 34px */
  .access-actions button.small, .access-actions .btn.small {
    min-height: 44px; padding: 12px 16px; font-size: 14px;
  }
  /* любые button.small внутри карточных строк таблицы — тоже до 44 */
  .data-table button.small, .data-table .btn.small {
    min-height: 44px; padding: 12px 14px; font-size: 13.5px;
  }
  .data-table td .progress { flex: 1; min-width: 120px; }
  .data-table td[colspan] { display: block; text-align: center; }
  .data-table td[colspan]::before { display: none; }
}

/* ── Витрина: широкая сетка, закрытые курсы, страница продажи набора ── */
.container.dash { width: 100%; max-width: 1560px; padding: 0 clamp(20px, 3vw, 56px); }
.course-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.dash-head-sub { margin: 18px 0 18px; }
.dash-h2 { margin: 0 0 4px; font-size: 28px; font-weight: 700; letter-spacing: -0.018em; color: var(--ink); }
.course-card { position: relative; }
.course-card-link { display: flex; flex-direction: column; color: inherit; flex: 1; text-decoration: none; }
.course-card-link:hover { text-decoration: none; }
.course-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; padding: 0 20px 20px; }
.course-actions .btn-teal { margin-top: 0; }
.kit-price { font: 700 15px/1 "Plus Jakarta Sans", sans-serif; color: var(--ink); margin-right: auto; }
.kit-price-lg { font-size: 26px; margin: 6px 0 0; }
.btn-ghost-sm {
  display: inline-flex; align-items: center; height: 38px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--border-strong); color: var(--ink-2); font: 600 13.5px/1 "Plus Jakarta Sans", sans-serif;
}
.btn-ghost-sm:hover { color: var(--ink); border-color: var(--ink-2); text-decoration: none; }
.btn-ghost {
  display: inline-flex; align-items: center; height: 46px; padding: 0 22px; border-radius: 12px;
  border: 1px solid var(--border-strong); color: var(--ink); font: 700 15px/1 "Plus Jakarta Sans", sans-serif;
}
.btn-ghost:hover { border-color: var(--ink-2); text-decoration: none; }
.lock-badge, .own-badge {
  position: absolute; top: 14px; left: 14px; padding: 7px 12px; border-radius: 999px;
  font: 700 12px/1 "Plus Jakarta Sans", sans-serif; color: #fff;
  background: rgba(10,14,28,.72); backdrop-filter: blur(6px);
}
.own-badge { background: rgba(10,107,96,.9); }
/* Фото обложек показываем целиком (contain), поля заполняем размытой копией того же фото. */
.course-cover.has-image, .sale-cover.has-image, .featured-cover.has-image {
  background: linear-gradient(135deg, var(--c1), var(--c2)); overflow: hidden;
}
.course-cover.has-image::before, .sale-cover.has-image::before, .featured-cover.has-image::before {
  content: ""; position: absolute; inset: -24px; z-index: 0;
  background: var(--img) center / cover no-repeat; filter: blur(22px) saturate(1.1); opacity: .85;
}
.cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; z-index: 1; }
.lock-badge, .own-badge { z-index: 2; }
.course-cover { height: 220px; }
.course-card.is-locked .lock-badge { z-index: 2; }

.crumbs { margin: 0 0 16px; }
.crumbs a { color: var(--ink-2); font-weight: 600; font-size: 14px; }
.sale { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: start; margin-bottom: 44px; }
.sale-cover {
  position: relative; min-height: 420px; border-radius: 22px; overflow: hidden;
  background: repeating-linear-gradient(125deg, rgba(255,255,255,.09) 0 2px, transparent 2px 14px), linear-gradient(135deg, var(--c1), var(--c2));
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-card);
}
.sale-cover.has-image { background: var(--img) center / cover no-repeat, linear-gradient(135deg, var(--c1), var(--c2)); }
.sale-text { display: flex; flex-direction: column; gap: 14px; }
.sale-title { margin: 0; font-size: clamp(30px, 3.2vw, 46px); line-height: 1.08; letter-spacing: -0.022em; color: var(--ink); }
.sale-desc { margin: 0; color: var(--ink-2); font-size: 17px; line-height: 1.55; max-width: 52ch; }
.sale-points { margin: 4px 0; padding-left: 20px; color: var(--ink-2); line-height: 1.7; }
.sale-kit { display: flex; align-items: center; gap: 18px; padding: 18px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.sale-kit-img { width: 120px; height: 120px; object-fit: contain; border-radius: 12px; background: #fff; }
.sale-kit-name { font-weight: 700; font-size: 17px; color: var(--ink); }
.sale-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.sale-buttons .btn-teal { margin-top: 0; height: 46px; padding: 0 26px; font-size: 15px; }
.sale-more { margin: 0 0 18px; font-size: 24px; color: var(--ink); }
@media (max-width: 900px) {
  .sale { grid-template-columns: 1fr; gap: 24px; }
  .sale-cover { min-height: 240px; }
}


/* ═══════════════════════════════════════════════════════════════════════
   Дизайн v2: «лаборатория набора». Чертёжная бумага, чернильный синий,
   сигнальный жёлтый для покупки, зелёный для «открыто».
   Шрифты: Unbounded (заголовки), Onest (текст), JetBrains Mono (коды).
   ═══════════════════════════════════════════════════════════════════════ */
:root.theme-light {
  --bg: #eef2fa;
  --surface: #ffffff;
  --surface-2: #e4eaf6;
  --ink: #0a1a3a;
  --ink-2: #26365b;
  --muted: #5d6a86;
  --border: rgba(10,26,58,.14);
  --border-strong: rgba(10,26,58,.34);
  --blue: #2250f4;
  --blue-ink: #ffffff;
  --signal: #ffc400;
  --signal-ink: #1b1400;
  --teal: #0a7a56;
  --teal-ink: #ffffff;
  --grid: rgba(34,80,244,.075);
  --hard: 5px 5px 0 var(--ink);
}
:root.theme-dark {
  --bg: #08122b;
  --surface: #0f1d40;
  --surface-2: #14264f;
  --ink: #f2f5ff;
  --ink-2: #c3cdea;
  --muted: #8d9cc4;
  --border: rgba(160,185,255,.16);
  --border-strong: rgba(160,185,255,.38);
  --blue: #6f8fff;
  --blue-ink: #06102a;
  --signal: #ffc400;
  --signal-ink: #1b1400;
  --teal: #3ddba0;
  --teal-ink: #04231a;
  --grid: rgba(111,143,255,.09);
  --hard: 5px 5px 0 #2b45b8;
}
body {
  font-family: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  background-attachment: fixed;
}
h1, h2, h3, h4 { font-family: "Onest", system-ui, sans-serif; }
h1, h2, .dash-h1, .dash-h2, .sale-title, .featured-title, .sale-more, .activate-text h3 {
  font-family: "Unbounded", "Onest", sans-serif; font-weight: 600; letter-spacing: -0.02em;
}
.dash-h1 { font-size: clamp(30px, 3.2vw, 44px); line-height: 1.08; }
.dash-h2, .sale-more { font-size: clamp(22px, 2vw, 28px); }
.featured-title { font-size: clamp(24px, 2.2vw, 32px); line-height: 1.15; }
.sale-title { font-size: clamp(26px, 3vw, 40px); line-height: 1.1; }
.site-header { background: color-mix(in srgb, var(--bg) 88%, transparent); border-bottom-color: var(--border-strong); }

/* ярлыки без капса */
.dash-eyebrow, .featured-pin {
  text-transform: none; letter-spacing: .01em; font: 600 14px/1.2 "Onest", sans-serif; color: var(--muted);
}
.featured-pin { color: var(--teal); }
.course-level {
  text-transform: none; letter-spacing: 0; font: 600 12.5px/1 "Onest", sans-serif;
  border-radius: 6px; padding: 5px 9px; background: var(--surface-2); color: var(--ink-2);
}

/* кнопки: зелёная «открыть», жёлтая «купить», синяя «регистрация» */
.btn-teal {
  background: var(--teal); color: var(--teal-ink); border-radius: 10px; font-family: "Onest", sans-serif; font-weight: 700;
}
.nav-cta { background: var(--blue); color: var(--blue-ink); border-radius: 10px; }
.course-actions .btn-teal:not([href^="/courses"]), .sale-buttons .btn-teal {
  background: var(--signal); color: var(--signal-ink);
  box-shadow: 0 2px 0 rgba(0,0,0,.25);
}
.btn-ghost, .btn-ghost-sm { border-color: var(--border-strong); border-radius: 10px; }
.btn-ghost:hover, .btn-ghost-sm:hover { background: var(--surface-2); }

/* карточки: рамка и жёсткая тень вместо мягкого «облака» */
.course-card, .featured, .sale-kit {
  border: 1.5px solid var(--border-strong); border-radius: 14px; box-shadow: none; background: var(--surface);
}
.course-card:hover, .featured:hover {
  transform: translate(-3px, -3px); box-shadow: var(--hard); border-color: var(--ink);
}
:root.theme-dark .course-card:hover, :root.theme-dark .featured:hover { border-color: var(--blue); }
.course-cover { border-radius: 0; border-bottom: 1.5px solid var(--border-strong); }
.course-title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.lock-badge {
  background: var(--signal); color: var(--signal-ink); border-radius: 4px; transform: rotate(-2deg);
  font: 700 12px/1 "Onest", sans-serif; backdrop-filter: none; box-shadow: 0 2px 0 rgba(0,0,0,.25);
}
.own-badge { background: var(--teal); color: var(--teal-ink); border-radius: 4px; backdrop-filter: none; }
.kit-price { font-family: "Unbounded", sans-serif; font-weight: 600; font-size: 14px; }
.kit-price-lg { font-size: 28px; }

/* поле активации — билетик с перфорацией */
.activate-bar {
  position: relative; background: var(--ink); color: var(--bg); border: 0; border-radius: 14px;
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.06) 0 2px, transparent 2px 14px);
  box-shadow: var(--hard);
}
:root.theme-dark .activate-bar { background: #1a3280; color: #fff; }
.activate-bar::before, .activate-bar::after {
  content: ""; position: absolute; top: 50%; width: 26px; height: 26px; margin-top: -13px;
  border-radius: 50%; background: var(--bg);
}
.activate-bar::before { left: -13px; } .activate-bar::after { right: -13px; }
.activate-text h3 { color: inherit; font-size: 20px; }
.activate-text p { color: inherit; opacity: .78; }
input.activate-input {
  background: #fff; color: #0a1a3a; border: 2px dashed #0a1a3a55; border-radius: 8px; letter-spacing: .12em;
}
.activate-bar .btn-teal { background: var(--signal); color: var(--signal-ink) !important; border-radius: 8px; }

/* лендинг: слева заголовок, справа билетик с кодом */
.landing-hero {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px; align-items: center;
  text-align: left; margin: 56px 0 56px;
}
.landing-hero .dash-h1 { font-size: clamp(34px, 4.2vw, 62px); max-width: 16ch; margin: 0 0 20px; line-height: 1.05; }
.landing-lead { margin: 0 0 30px; max-width: 54ch; font-size: 18px; }
.landing-cta { justify-content: flex-start; }
.landing-hero .btn-teal { background: var(--blue); color: var(--blue-ink); height: 50px; padding: 0 26px; font-size: 16px; }
.landing-hero .btn-teal.secondary { background: transparent; color: var(--ink) !important; border: 1.5px solid var(--border-strong); }
.ticket-wrap { display: flex; justify-content: center; padding: 20px 0; }
.ticket {
  position: relative; width: min(100%, 430px); padding: 26px 28px 24px; border-radius: 16px;
  background: var(--signal); color: var(--signal-ink); transform: rotate(-3deg);
  box-shadow: 8px 8px 0 var(--ink);
}
:root.theme-dark .ticket { box-shadow: 8px 8px 0 #2b45b8; }
.ticket::before, .ticket::after {
  content: ""; position: absolute; top: 58%; width: 28px; height: 28px; margin-top: -14px; border-radius: 50%; background: var(--bg);
}
.ticket::before { left: -14px; } .ticket::after { right: -14px; }
.ticket-brand { font: 700 14px/1 "Onest", sans-serif; opacity: .8; }
.ticket-title { margin: 14px 0 22px; font: 600 24px/1.15 "Unbounded", sans-serif; letter-spacing: -0.02em; }
.ticket-cut { border-top: 2px dashed rgba(27,20,0,.45); margin: 0 -8px 18px; }
.ticket-code { font: 700 20px/1 "JetBrains Mono", monospace; letter-spacing: .08em; }
.ticket-note { margin-top: 10px; font-size: 13px; opacity: .75; }
@media (max-width: 900px) {
  .landing-hero { grid-template-columns: 1fr; gap: 20px; margin: 32px 0; }
  .ticket { transform: rotate(-2deg); }
}

/* шаги «как это работает» — это последовательность, поэтому с цифрами */
.landing-steps { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 14px; counter-reset: step; }
.landing-steps li {
  counter-increment: step; position: relative; padding: 14px 16px 14px 64px; border: 1.5px solid var(--border-strong);
  border-radius: 12px; background: var(--surface); font-size: 16px;
}
.landing-steps li::before {
  content: counter(step); position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 8px; background: var(--ink); color: var(--bg);
  font: 600 16px/36px "Unbounded", sans-serif; text-align: center;
}
:root.theme-dark .landing-steps li::before { background: var(--blue); color: var(--blue-ink); }
.card { border: 1.5px solid var(--border-strong); border-radius: 14px; box-shadow: none; }
/* на лендинге секции без вложенной рамки: карточки курсов и так обведены */
.landing-hero ~ .card { border: 0; background: transparent; padding: 0; margin-top: 0; }
.landing-hero ~ .card h2 { margin: 0 0 6px; }
.landing-hero ~ .card + .card { margin-top: 56px; }
.ticket-title { font-size: 26px; }
.ticket { width: min(100%, 460px); padding: 30px 32px 28px; }
.ticket-code { font-size: 24px; }

/* страница продажи: блоки под героем, юридические страницы */
.sale-h { margin: 6px 0 4px; font-size: 20px; font-family: "Onest", sans-serif; letter-spacing: -0.01em; }
.sale-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; margin-bottom: 48px; }
.sale-box { border: 1.5px solid var(--border-strong); border-radius: 14px; background: var(--surface); padding: 22px 24px; }
.sale-outline, .sale-steps { margin: 10px 0 0; padding-left: 22px; color: var(--ink-2); line-height: 1.75; }
.sale-box details { border-top: 1px solid var(--border); padding: 12px 0; }
.sale-box details:first-of-type { border-top: 0; }
.sale-box summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.sale-box details p { margin: 8px 0 0; color: var(--ink-2); font-size: 15px; line-height: 1.55; }
.legal h2 { font-size: 18px; margin: 22px 0 6px; font-family: "Onest", sans-serif; }
.legal h2:first-child { margin-top: 0; }
.legal ul { margin: 6px 0; padding-left: 22px; color: var(--ink-2); line-height: 1.7; }
.legal p { color: var(--ink-2); line-height: 1.65; }

/* ── Бренд «Courses wiki» и футер со всеми сайтами ── */
.brand { gap: 9px; color: var(--ink); line-height: 1; text-decoration: none; }
.brand-bolt { color: var(--blue); flex: none; }
.brand-word { font: 600 19px/1 "Unbounded", "Onest", sans-serif; letter-spacing: -0.03em; }
.brand-word span { color: var(--blue); margin-left: 2px; }
:root.theme-dark .brand-word span { color: var(--blue); }
.site-footer {
  margin-top: 72px; padding: 0; border-top: 0;
  background: #07102a; color: #c3cdea;
  background-image: linear-gradient(rgba(111,143,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(111,143,255,.07) 1px, transparent 1px);
  background-size: 32px 32px;
}
.foot-inner {
  max-width: 1560px; margin: 0 auto; padding: 56px clamp(20px, 3vw, 56px) 40px;
  display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: 40px;
}
.foot-brand .brand { color: #f2f5ff; }
.foot-brand .brand-word span, .foot-brand .brand-bolt { color: #ffc400; }
.foot-about { margin: 16px 0; max-width: 38ch; font-size: 15px; line-height: 1.6; color: #aab6da; }
.foot-mail { color: #ffc400; font-weight: 600; font-size: 15px; }
.foot-mail:hover { text-decoration: underline; }
.foot-col h2 { margin: 0 0 14px; font: 600 15px/1.2 "Onest", sans-serif; color: #f2f5ff; }
.foot-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.foot-col a { color: #aab6da; font-size: 15px; text-decoration: none; }
.foot-col a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.foot-bottom {
  max-width: 1560px; margin: 0 auto; padding: 18px clamp(20px, 3vw, 56px) 26px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border-top: 1px solid rgba(160,185,255,.16); font-size: 13.5px; color: #8d9cc4;
}
@media (max-width: 900px) {
  .foot-inner { grid-template-columns: 1fr 1fr; gap: 32px; padding-top: 40px; }
  .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) { .foot-inner { grid-template-columns: 1fr; } }

.brand-logo { height: 28px; width: auto; display: block; }
.foot-logo { height: 30px; width: auto; display: block; }

/* Поиск в шапке: капсула с иконкой и подсказкой «/» */
.header-search {
  flex: 1; max-width: 520px; margin: 0; padding: 0 14px; gap: 10px; height: 44px;
  background: var(--surface); border: 1.5px solid var(--border-strong); border-radius: 12px;
  display: flex; align-items: center;
}
.header-search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 22%, transparent); }
.search-ico { color: var(--muted); flex: none; }
.header-search input[type="search"] {
  flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent;
  color: var(--ink); font: 500 15px/1 "Onest", sans-serif; box-shadow: none; -webkit-appearance: none; appearance: none;
}
.header-search input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
.header-search input::placeholder { color: var(--muted); }
.search-kbd {
  flex: none; font: 600 12px/1 "JetBrains Mono", monospace; color: var(--muted);
  border: 1.5px solid var(--border-strong); border-radius: 6px; padding: 4px 7px; background: var(--surface-2);
}
.header-search:focus-within .search-kbd { display: none; }
.search-empty { margin: 8px 0 24px; padding: 20px; border: 1.5px dashed var(--border-strong); border-radius: 12px; color: var(--ink-2); text-align: center; }
@media (max-width: 640px) { .header-search { order: 3; flex-basis: 100%; max-width: none; } .search-kbd { display: none; } }
[hidden] { display: none !important; }

/* обложки: фото целиком на чистом белом фоне (вместо размытой копии) */
.course-cover.has-image, .sale-cover.has-image, .featured-cover.has-image { background: #fff !important; }
.course-cover.has-image::before, .sale-cover.has-image::before, .featured-cover.has-image::before { content: none !important; display: none !important; }
.cover-img { object-fit: contain; }

.featured-resume { margin: 2px 0 6px; color: var(--ink-2); font-size: 15px; }
.featured-resume b { color: var(--ink); }

/* мягкие тени вместо жёсткой тёмной подложки */
:root.theme-light { --hard: 0 14px 34px -14px rgba(34,80,244,.38), 0 2px 6px rgba(10,26,58,.08); }
:root.theme-dark  { --hard: 0 16px 36px -14px rgba(0,0,0,.65), 0 0 0 1px rgba(111,143,255,.35); }
.course-card:hover, .featured:hover { transform: translateY(-3px); box-shadow: var(--hard); border-color: var(--blue); }
:root.theme-dark .course-card:hover, :root.theme-dark .featured:hover { border-color: var(--blue); }
.ticket, :root.theme-dark .ticket { box-shadow: 0 22px 44px -18px rgba(10,26,58,.5); }
.activate-bar { box-shadow: 0 16px 36px -18px rgba(10,26,58,.55); }
:root.theme-dark .activate-bar { box-shadow: 0 16px 36px -16px rgba(0,0,0,.7); }

/* иконки вместо эмодзи */
.ic { vertical-align: -2px; margin-right: 4px; }
.lock-badge { display: inline-flex; align-items: center; gap: 4px; }
.lang-globe, .t-sun, .t-moon { flex: none; }
.err-code { font: 600 72px/1 "Unbounded", sans-serif; letter-spacing: -0.03em; color: var(--blue); margin-bottom: 8px; }

/* статистика */
.stats-range { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 18px; }
.stats-range a.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.stats-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card { border: 1.5px solid var(--border-strong); border-radius: 14px; background: var(--surface); padding: 18px 20px; display: grid; gap: 4px; }
.stat-card b { font: 600 34px/1 "Unbounded", sans-serif; letter-spacing: -0.03em; color: var(--ink); }
.stat-card span { color: var(--muted); font-size: 14px; }

/* ── Мобильная версия: компактная шапка и отступы ── */
@media (max-width: 640px) {
  .site-header { position: static; flex-wrap: wrap; gap: 10px 8px; padding: 12px 14px 10px; }
  .site-header .brand { flex: none; }
  .brand-logo { height: 22px; }
  .header-nav { margin-left: auto; gap: 8px; flex-wrap: nowrap; }
  .header-nav .nav-link { display: none; }
  .header-nav .nav-cta { padding: 9px 13px; font-size: 13.5px; white-space: nowrap; }
  .lang-current { padding: 8px 10px; }
  .lang-current .caret { display: none; }
  .header-search { order: 3; flex-basis: 100%; max-width: none; height: 42px; margin: 0; }
  .container.dash { padding: 0 16px; margin: 16px auto 32px; }
  .dash-h1 { font-size: 28px; }
  .landing-hero { margin: 20px 0 32px; gap: 28px; }
  .landing-hero .dash-h1 { font-size: 30px; }
  .landing-lead { font-size: 16px; margin-bottom: 20px; }
  .ticket { transform: rotate(-1.5deg); padding: 22px 22px 20px; }
  .ticket-title { font-size: 21px; }
  .ticket-code { font-size: 19px; }
  .course-grid { grid-template-columns: 1fr; gap: 18px; }
  .course-cover { height: 200px; }
  .course-actions { padding: 0 16px 18px; }
  .course-body { padding: 16px 16px 12px; }
  .section, .card { padding: 20px 16px; }
  .landing-hero ~ .card { padding: 0; }
  .landing-steps li { padding: 12px 12px 12px 56px; font-size: 15px; }
  .sale { gap: 20px; margin-bottom: 28px; }
  .sale-cover { min-height: 0; aspect-ratio: 4 / 3; }
  .sale-box { padding: 18px 16px; }
  .sale-grid { grid-template-columns: 1fr; gap: 16px; margin-bottom: 32px; }
  .sale-buttons .btn-teal, .sale-buttons .btn-ghost { flex: 1 1 100%; justify-content: center; text-align: center; }
  .sale-kit { flex-direction: column; align-items: flex-start; }
  .featured-text { padding: 22px 18px 24px; }
  .featured-cover { min-height: 220px; }
  .activate-bar { grid-template-columns: 1fr; padding: 22px 18px; gap: 12px; }
  input.activate-input { min-width: 0; width: 100%; }
  .stats-cards { grid-template-columns: 1fr 1fr; }
  .foot-inner { padding: 36px 16px 24px; }
  .foot-bottom { padding: 16px; }
}
@media (max-width: 380px) { .brand-logo { height: 20px; } .header-nav .nav-cta { padding: 8px 10px; } }
