:root {
  --az-blue: #5b8cff;
  --az-purple: #6c5ce7;
  --az-purple-deep: #3b2db8;
  --az-navy: #1a1a2e;
  --az-bg: #eef1f8;
  --az-grad: linear-gradient(135deg, #5b8cff 0%, #6c5ce7 50%, #3b2db8 100%);
  --bg: #eef1f8;
  --bg2: #ffffff;
  --card: #ffffff;
  --card2: #f4f6fb;
  --line: #d5dbe8;
  --text: #1a1a2e;
  --muted: #4a5570;
  --accent: #6c5ce7;
  --accent2: #3b2db8;
  --accent-soft: rgba(108, 92, 231, 0.12);
  --shadow: 0 10px 28px rgba(21, 21, 40, 0.10);
  --radius: 20px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  overflow-x: hidden;
}

/* ===== HERO ===== */
.hero {
  position: relative;
  padding: 76px 22px 44px;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(900px 420px at 50% -80px, rgba(91, 140, 255, 0.18), transparent 70%),
    radial-gradient(720px 380px at 110% 8%, rgba(108, 92, 231, 0.12), transparent 62%),
    var(--bg);
  border-bottom: 1px solid var(--line);
}

.hero::before, .hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.18;
  pointer-events: none;
}
.hero::before { width: 260px; height: 260px; background: var(--accent); top: -90px; left: -80px; }
.hero::after { width: 320px; height: 320px; background: var(--accent2); bottom: -140px; right: -100px; }

.hero-inner { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; }

.hero-label {
  margin: 0 0 14px;
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(108, 92, 231, 0.28);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 11px;
  font-weight: 700;
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 9vw, 58px);
  line-height: 1.04;
  font-weight: 900;
  letter-spacing: -1.5px;
}

.hero h1 span {
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-text {
  max-width: 520px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 16px;
}

.btn-hero,
.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 26px;
  padding: 14px 18px;
  border-radius: 14px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
  position: relative;
  isolation: isolate;
  z-index: 0;
  box-sizing: border-box;
  transition: color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.cta-btn .az-ico {
  width: 18px;
  height: 18px;
  color: currentColor;
}
.az-ico {
  display: inline-flex;
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  color: inherit;
  line-height: 0;
}
.az-ico svg { width: 100%; height: 100%; }
/* A19 из лаборатории — белая outline */
.cta-btn.btn-outline {
  background: linear-gradient(#fff, #f4f6fb) padding-box, var(--az-grad) border-box;
  border: 1.5px solid transparent;
  color: var(--az-purple-deep);
  box-shadow: 0 4px 14px rgba(21, 21, 40, 0.08);
}
.cta-btn.btn-outline:hover {
  background: var(--az-grad);
  color: #fff;
  border-color: transparent;
  transform: translateY(-1px);
}
.train-gate .cta-btn,
.train-cta .cta-btn {
  width: 100%;
  margin-top: 0;
}
.train-gate .cta-btn { margin-top: 18px; }

.hero-meta {
  margin-top: 26px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-meta span {
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

/* ===== TOOLBAR ===== */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(238, 241, 248, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.toolbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#search {
  width: 100%;
  padding: 14px 18px 14px 46px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--bg2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a5570' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 14px center / 20px no-repeat;
  color: var(--text);
  font-size: 15px;
  font-family: var(--font);
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}

#search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15); }

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter {
  flex: 1 1 auto;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--muted);
  font-size: 13px;
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  min-width: calc(50% - 4px);
}

.filter.active, .filter:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--accent-soft);
}

/* ===== MAP ===== */
.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

.map {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 8px 0;
}

.map-group-wrap {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.map-group {
  width: 100%;
  margin: 4px 0 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

/* Кружок-соцсеть */
.platform {
  width: 92px;
  height: 92px;
  border-radius: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  position: relative;
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  text-align: center;
  box-shadow: 0 10px 24px -10px rgba(0,0,0,0.7);
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s;
}

.platform::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(160deg, rgba(255,255,255,0.25), transparent 45%);
}

.platform .mono {
  position: relative;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -1px;
}

.platform .icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
}

.platform .icon svg {
  width: 34px;
  height: 34px;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.35));
}

.platform .pname {
  position: relative;
  font-size: 10.5px;
  font-weight: 700;
  padding: 0 6px;
  opacity: 0.95;
}

.platform:active { transform: scale(0.93); }
.platform:hover {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 18px 34px -10px rgba(0,0,0,0.8), 0 0 0 2px var(--accent), 0 0 26px -4px var(--accent);
}

.map-hint {
  width: 100%;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}

/* ===== OVERLAY ===== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 46, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
  z-index: 30;
  backdrop-filter: blur(3px);
}
.overlay.open { opacity: 1; pointer-events: auto; }

/* ===== DRAWER (mobile bottom sheet) ===== */
.drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 92vh;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -18px 60px rgba(21, 21, 40, 0.18);
  transform: translateY(105%);
  transition: transform .32s cubic-bezier(.32,.72,.28,1);
  z-index: 40;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom);
}

.drawer.open { transform: translateY(0); }

.drawer-grabber {
  padding: 12px 0 2px;
  display: flex;
  justify-content: center;
}
.drawer-grabber span {
  width: 44px;
  height: 5px;
  border-radius: 99px;
  background: var(--line);
}

.drawer-head {
  padding: 4px 16px 0;
  display: flex;
  justify-content: flex-end;
}

.close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.close:hover { border-color: var(--accent); transform: rotate(90deg); }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px 30px;
}

/* ===== Детали панели ===== */
.dtitle {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.dm {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 8px 20px -8px rgba(0,0,0,0.6);
}

.icon-big { display: flex; align-items: center; justify-content: center; }
.icon-big svg { width: 30px; height: 30px; display: block; }

.dname { font-size: 24px; font-weight: 800; margin: 0; letter-spacing: -0.5px; }
.dtag { color: var(--muted); font-size: 14px; margin: 4px 0 0; }

.doffer {
  margin: 14px 0 0;
  padding: 13px 16px;
  border-radius: 14px;
  background: var(--accent-soft);
  border: 1px solid rgba(108, 92, 231, 0.28);
  color: var(--accent);
  font-size: 14px;
  line-height: 1.5;
}

.dstats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.chip {
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
}

.section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  margin: 24px 0 12px;
  font-weight: 700;
}

/* План продаж */
.plan {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
  counter-reset: plan;
}

.plan-item {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px 12px 48px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
}

.plan-item::before {
  counter-increment: plan;
  content: counter(plan);
  position: absolute;
  left: 12px;
  top: 12px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.plan-item strong { color: var(--text); }

/* Уроки */
.lesson {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 12px;
  transition: border-color .15s, transform .15s;
}
.lesson:hover { border-color: var(--accent); transform: translateY(-1px); }

.lesson-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.badge {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 5px 10px;
  border-radius: 999px;
}
.badge-text { background: #2a3f8f; color: #cfe; }
.badge-video { background: #8f2a4e; color: #ffe6ef; }
.badge-checklist { background: #2a6f2f; color: #e0ffe2; }
.badge-task { background: #7a5c13; color: #fff3d6; }

.lesson h3 { margin: 2px 0 0; font-size: 16px; font-weight: 700; }

.lesson p { margin: 10px 0 0; color: var(--muted); font-size: 14.5px; }

.lesson a.llink {
  display: inline-block;
  margin-top: 10px;
  color: var(--accent);
  font-size: 14px;
  text-decoration: none;
  font-weight: 700;
}
.lesson a.llink:hover { text-decoration: underline; }

.empty {
  color: var(--muted);
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
}

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid var(--line);
  padding: 28px 20px calc(28px + env(safe-area-inset-bottom));
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* ===== ПРОГРЕСС ОБУЧЕНИЯ ===== */
.pbadge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
  line-height: 1;
}
.pbadge.full { background: #2fbf6f; color: #062; }

.progress-bar {
  position: relative;
  margin: 14px 0 4px;
  height: 26px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 999px;
  transition: width .4s ease;
}
.progress-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.course-done {
  margin: 8px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(47,191,111,0.12);
  border: 1px solid rgba(47,191,111,0.35);
  color: #1a7a48;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.lesson-done {
  margin-left: auto;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
}
.lesson-done:hover { border-color: var(--accent); color: var(--text); }
.lesson-done.checked {
  background: var(--az-grad);
  color: #fff;
  border-color: transparent;
}

.lesson.done { border-color: rgba(47,191,111,0.4); background: rgba(47,191,111,0.05); }

.btn-reset {
  margin-top: 6px;
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.btn-reset:hover { border-color: #c0392b; color: #c0392b; }

/* ===== DESKTOP (адаптив на весь экран) ===== */
@media (min-width: 860px) {
  body .toolbar-inner { flex-direction: row; align-items: center; }
  #search { width: 340px; }
  body .filter { flex: none; min-width: 0; }
  body .platform { width: 120px; height: 120px; border-radius: 34px; }
  body .platform .mono { font-size: 34px; }
  body .platform .icon { height: 44px; }
  .platform .icon svg { width: 44px; height: 44px; }
  .platform .pname { font-size: 12px; }
  .map-group-wrap { gap: 30px; }
  .drawer { left: auto; right: 0; top: 0; bottom: 0; width: 520px; max-height: none; border-radius: 0; border-bottom: none; transform: translateX(105%); padding-bottom: 0; }
  .drawer.open { transform: translateX(0); }
  .drawer-grabber { display: none; }
}

/* ===== Кабинет: вход и CTA (не site.css) ===== */
.train-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 18px;
  background:
    radial-gradient(900px 420px at 50% -80px, rgba(91, 140, 255, 0.18), transparent 70%),
    var(--bg);
}
.train-gate[hidden] { display: none !important; }
#trainApp[hidden] { display: none !important; }
.train-gate-card {
  max-width: 440px;
  text-align: center;
}
.train-gate-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.train-gate-note a { color: var(--accent); font-weight: 700; text-decoration: none; }
.train-back {
  display: inline-flex;
  margin: 0 0 16px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.train-back:hover { text-decoration: underline; }
.hero { padding-top: 36px; }
.train-cta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 18px;
}
.train-cta-hint {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.train-cta .cta-btn { font-size: 14px; padding: 12px 16px; }
.train-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(16px);
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  z-index: 80;
  transition: opacity .2s, transform .2s;
}
.train-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
