/* ya300 — лендинг и каталог курсов. Светлый минимализм по мотивам референса. */

:root {
  --bg: #f3eee3;
  --panel: #fffdf7;
  --text: #221c12;
  --muted: #7c7157;
  --line: #e2d9c3;
  --accent: #f14e1c;
  --accent-dark: #d13d10;
  --accent-soft: #ffe4d6;
  --teal: #1e6b52;
  --teal-soft: #d9efe4;
  --radius: 20px;
  --shadow: 0 18px 44px rgba(84, 62, 22, 0.10);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* фиксированная шапка не должна накрывать текст при переходе по якорям */
  scroll-padding-top: 104px;
}

@media (max-width: 700px) {
  html { scroll-padding-top: 96px; }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: Onest, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

a { color: inherit; text-decoration: none; }

h1, h2, .logo, .subject-name, .auth-modal h2, .cab-title, .sup-text h3, .login-card h1 {
  font-family: Golos Text, Onest, system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ---------- Шапка: плавающая, матовое стекло (по мотивам референса) ---------- */

body { padding-top: 104px; }

.header {
  position: fixed;
  z-index: 50;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1168px, calc(100% - 24px));
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 16px;
  background: linear-gradient(115deg, rgba(255, 252, 244, 0.62), rgba(255, 250, 240, 0.34) 55%, rgba(255, 253, 247, 0.56));
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(255, 255, 255, 0.5),
    0 8px 30px rgba(84, 62, 22, 0.08);
  transition: top 0.35s ease, box-shadow 0.35s ease, background 0.35s ease;
}

.header.scrolled {
  top: 8px;
  background: linear-gradient(115deg, rgba(255, 251, 241, 0.82), rgba(246, 240, 227, 0.66) 60%, rgba(255, 253, 247, 0.78));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 10px 32px rgba(84, 62, 22, 0.12);
}

.header-inner {
  display: flex;
  align-items: center;
  /* лого слева (margin-right:auto), остальные кнопки — группой справа с зазором */
  justify-content: flex-start;
  gap: 14px;
  padding: 12px 0 13px;
  position: relative;
}

.header-inner .nav { margin-right: auto; }

.logo {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.logo em { font-style: normal; opacity: 0.35; }

.nav {
  display: flex;
  gap: 6px;
  font-size: 15px;
  color: var(--muted);
}

.nav a {
  padding: 9px 14px;
  border-radius: 10px;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.55); }

.header .btn { padding: 10px 20px; font-size: 15px; }

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border-radius: 14px;
  padding: 14px 26px;
  font-size: 16px;
  font-weight: 700;
  border: 1.5px solid var(--accent);
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(241, 78, 28, 0.25);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover { transform: translateY(-2px); background: var(--accent-dark); border-color: var(--accent-dark); }

.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--text);
  box-shadow: none;
}

.btn.ghost:hover { background: var(--text); color: var(--panel); }

.btn.small { padding: 9px 16px; font-size: 14px; border-width: 1px; box-shadow: 0 4px 12px rgba(241, 78, 28, 0.2); }

.arrow { display: inline-block; transition: transform 0.15s ease; }
.btn:hover .arrow { transform: translate(2px, -2px); }

/* ---------- Hero ---------- */

.hero { padding: 84px 0 64px; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 48px;
  align-items: center;
}

.hero-kicker {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(34px, 4.9vw, 60px);
  line-height: 1.03;
  letter-spacing: -0.035em;
  font-weight: 800;
}

.hero h1 .dot { opacity: 0.35; }

.hero-sub {
  margin-top: 22px;
  font-size: 19px;
  color: var(--muted);
  max-width: 520px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
  align-items: center;
}

.hero-note {
  margin-top: 18px;
  font-size: 14px;
  color: var(--muted);
}

/* Превью каталога в hero — живая карточка без картинок */

.hero-visual { position: relative; }

.preview-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  rotate: 1.5deg;
  transition: rotate 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.hero-visual:hover .preview-card { rotate: 0deg; }

.preview-card .pc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.pc-avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 15px;
}

.pc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.pc-row:last-child { border-bottom: none; }

.pc-row .pc-price { font-weight: 700; white-space: nowrap; }

.pc-chip {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg);
  border-radius: 999px;
  padding: 3px 10px;
  margin-left: 10px;
}

/* ---------- Секции ---------- */

.section { padding: 64px 0; }

.section-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 36px;
}

.section-top h2 {
  font-size: clamp(26px, 3.6vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 800;
}


/* Полоса школ */

.school-band {
  padding: 34px 0 10px;
}

.band-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.school-names {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.school-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 18px 7px 8px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.school-chip:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.school-chip img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}

.school-chip.text { padding: 8px 18px; }

/* Выбор экзамена */

.exam-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.exam-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 32px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.exam-card:hover {
  box-shadow: var(--shadow);
}

.exam-card h3 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.exam-card p { color: var(--muted); margin-top: 6px; }

.exam-card strong {
  display: inline-block;
  margin-top: 18px;
  font-size: 15px;
  font-weight: 700;
}

.exam-card:hover strong { text-decoration: underline; }

/* Как выглядит подготовка: рамка телефона с наклоном, на hover выпрямляется */

.look-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: stretch;
}

.look-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Телефон-айфон (по мотивам референса): титановый кант, грани боковыми
   тенями-стопкой, кнопки сбоку, Dynamic Island; наклон за курсором сверху */

.phone-stage {
  position: relative;
  perspective: 1000px;
  margin: 6px 14px 30px;
}

.phone-tilt {
  transform: rotateX(calc(var(--bx, 0deg) + var(--rx, 0deg))) rotateY(calc(var(--by, 0deg) + var(--ry, 0deg))) rotate(var(--bz, 0deg)) translateY(var(--lift, 0px));
  transition: transform 0.35s ease-out;
  will-change: transform;
}

.look-item:nth-child(1) .phone-tilt { --bx: 4deg; --by: -22deg; --bz: -4deg; }
.look-item:nth-child(2) .phone-tilt { --bx: 5deg; --by: 18deg; --bz: 3deg; }
.look-item:nth-child(3) .phone-tilt { --bx: 3deg; --by: -12deg; --bz: 5deg; }

.look-item:nth-child(1) .phone, .look-item:nth-child(3) .phone { --edge: 1; }
.look-item:nth-child(2) .phone { --edge: -1; }

.look-item:hover .phone-tilt {
  --bx: 0deg; --by: 0deg; --bz: 0deg;
  --lift: -8px;
}

.phone-sway {
  animation: phone-sway 9s ease-in-out infinite;
}

.look-item:nth-child(2) .phone-sway { animation-delay: -3s; }
.look-item:nth-child(3) .phone-sway { animation-delay: -6s; }

.look-item:hover .phone-sway { animation-play-state: paused; }

@keyframes phone-sway {
  0%, 100% { transform: rotateX(1.5deg) rotateY(-2deg); }
  50% { transform: rotateX(-1.5deg) rotateY(2deg); }
}

/* корпус: чёрный с тонким титановым кантом, толщина — стопка боковых теней */

.phone {
  position: relative;
  padding: 5px;
  background: #141514;
  border: 2px solid #b7b8b4;
  border-radius: 43px;
  --edge: 1; /* сторона видимой грани: 1 = справа, -1 = слева */
  box-shadow:
    inset 0 0 0 1px #f1f1ea,
    calc(var(--edge) * 3px) calc(var(--edge) * 0.5px) 0 #777a76,
    calc(var(--edge) * 7px) calc(var(--edge) * 1px) 0 #454844,
    calc(var(--edge) * 11px) calc(var(--edge) * 2px) 0 #777b75,
    25px 30px 36px -14px rgba(41, 37, 29, 0.4);
  transition: box-shadow 0.5s ease;
}

.look-item:hover .phone {
  box-shadow:
    inset 0 0 0 1px #f1f1ea,
    calc(var(--edge) * 1px) calc(var(--edge) * 0.5px) 0 #777a76,
    calc(var(--edge) * 2px) calc(var(--edge) * 1px) 0 #454844,
    calc(var(--edge) * 3px) calc(var(--edge) * 2px) 0 #777b75,
    12px 30px 40px -16px rgba(41, 37, 29, 0.4);
}

/* кнопки: слева качелька громкости, справа питание */

.phone::before,
.phone::after {
  content: "";
  position: absolute;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, #777, #deded6, #555);
  left: -4px;
  top: 19%;
  height: 46px;
}

.phone::after {
  left: auto;
  right: -4px;
  top: 24%;
  height: 62px;
}

.phone-notch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 86px;
  height: 24px;
  background: #0a0a0a;
  border-radius: 999px;
  z-index: 4;
  box-shadow: inset 0 0 2px #000;
}

.phone-tour.has-video .phone-notch { display: none; }

/* экран: тонкая чёрная окантовка, глубокий радиус */

.phone-screen {
  position: relative;
  overflow: hidden;
  border: 2px solid #080908;
  border-radius: 36px;
  background: #111;
  aspect-ratio: 9 / 19;
  line-height: 1.4;
}

.phone-screen .mock { padding: 48px 14px 14px; }




.look-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}

/* CSS-мокапы экранов платформы (заменяются на реальные скрины <img> без правок CSS) */

.mock { width: 100%; display: flex; flex-direction: column; gap: 3px; font-size: 12px; }

.mock-title {
  font-weight: 700;
  font-size: 13px;
  padding: 2px 0 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 5px;
}

.mock-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 10px;
  background: var(--bg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mock-row.sub { background: transparent; padding-left: 22px; color: var(--muted); }

.mock-play {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-size: 8px;
  flex: none;
}

.mock-file {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 20px;
  padding: 0 5px;
  border-radius: 6px;
  border: 1px solid var(--line);
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
  flex: none;
}

.mock-player {
  background: #1c1c1c;
  border-radius: 12px;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
}

.mock-play-big {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 15px;
  padding-left: 3px;
}

.mock-progress {
  width: 70%;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  margin-top: -34px;
}

.mock-progress i { display: block; width: 38%; height: 100%; border-radius: 999px; background: #fff; }

.look-item h4 { font-size: 18px; font-weight: 700; }

.look-item p { font-size: 15px; color: var(--muted); }

.look-more { margin-top: 30px; }

/* Шаги */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.step {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px;
}

.step .n {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.14em;
}

.step h4 { font-size: 20px; font-weight: 800; margin: 10px 0 8px; }

.step p { font-size: 15px; color: var(--muted); }

/* Отзывы-заглушка */

.reviews-stub {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 44px 32px;
  text-align: center;
  color: var(--muted);
}

.reviews-stub h3 { color: var(--text); font-size: 22px; font-weight: 800; margin-bottom: 8px; }

/* Футер */

.footer { padding: 72px 0 40px; }

.footer-cta h2 {
  font-size: clamp(28px, 4vw, 46px);
  letter-spacing: -0.03em;
  font-weight: 800;
  line-height: 1.05;
}

.footer-cta p { color: var(--muted); margin: 16px 0 28px; font-size: 18px; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  margin-top: 56px;
  padding-top: 22px;
  font-size: 14px;
  color: var(--muted);
}

.footer-links { display: flex; flex-wrap: wrap; gap: 22px; }

.footer-links a:hover { color: var(--text); }

/* ---------- Способы оплаты (карточки) ---------- */

.pay-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0 14px;
}

/* на странице курса блок способов стоит в сетке тарифов — на всю ширину,
   карточки — по содержимому, а не в растяжку на высоту тарифов */
.course-tariffs .pay-options { grid-column: 1 / -1; margin: 0 0 16px; }
.pay-options { align-items: start; }

.pay-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}

.pay-opt .po-ic { font-size: 22px; flex: none; }

.pay-opt .po-t {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  min-width: 0;
}

.pay-opt .po-t small { font-weight: 600; font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.pay-opt:hover { border-color: var(--muted); }

.pay-opt.active { border-color: var(--accent); background: var(--accent-soft); }
.pay-opt.active .po-t { color: var(--accent-dark); }

@media (max-width: 640px) {
  .pay-options { grid-template-columns: 1fr; gap: 8px; margin: 8px 0 12px; }
}

/* ---------- Страница каталога ---------- */

.crumbs {
  padding: 26px 0 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.catalog-hero { padding: 18px 0 8px; }

.catalog-hero h1 {
  font-size: clamp(30px, 4.4vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.catalog-hero .sub { color: var(--muted); margin-top: 14px; max-width: 680px; }

.exam-switch {
  display: inline-flex;
  gap: 8px;
  background: #e2e2e2;
  border-radius: 999px;
  padding: 5px;
  margin: 26px 0 8px;
}

.exam-switch a {
  border-radius: 999px;
  padding: 9px 22px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}

.exam-switch a.active {
  background: var(--accent);
  color: #fff;
}

.subject-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 18px 0 8px;
}

.subject-pills a {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.15s ease;
}

.subject-pills a:hover { color: var(--text); border-color: var(--text); }

.price-note {
  font-size: 13px;
  color: var(--muted);
  padding: 10px 0 26px;
}

/* Секции предметов — структура как на витрине сайта */

.subject-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px 8px;
  margin-bottom: 20px;
}

.subject-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  user-select: none;
}

.subject-toggle {
  font-size: 26px;
  font-weight: 400;
  line-height: 1;
  color: var(--muted);
  transition: transform 0.25s ease;
  flex: none;
}

.subject-card.open .subject-toggle { transform: rotate(45deg); }

.subject-card.open .subject-head { border-bottom-color: transparent; }

.teacher-rows {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
}

.subject-card.open .teacher-rows { grid-template-rows: 1fr; }

.teacher-rows > div { overflow: hidden; }

.course-emoji {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--bg);
  display: grid;
  place-items: center;
  font-size: 26px;
  flex: none;
}

.subject-name {
  font-size: clamp(20px, 2.6vw, 25px);
  font-weight: 800;
  letter-spacing: -0.02em;
  flex: 1;
  min-width: 220px;
}

.tag-ege {
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.tag-oge {
  background: var(--teal-soft);
  color: var(--teal);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.subject-count { color: var(--muted); font-size: 14px; white-space: nowrap; }

.teacher-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}

.teacher-rows > .teacher-row:last-child { border-bottom: none; }

.teacher-info b { font-size: 17px; font-weight: 800; }

.tag-school {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  vertical-align: 2px;
  margin-left: 8px;
  white-space: nowrap;
}

.teacher-info small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.45;
}

.teacher-buy {
  display: flex;
  align-items: center;
  gap: 16px;
  white-space: nowrap;
}

.course-price { font-weight: 800; font-size: 17px; }

/* Низ каталога */

.catalog-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 32px;
  margin: 46px 0 60px;
}

.catalog-bottom h3 { font-size: 24px; font-weight: 800; }

.catalog-bottom p { color: var(--muted); margin-top: 4px; }

.catalog-bottom .actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Адаптив ---------- */

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-visual { max-width: 420px; }
  .look-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .nav { display: none; }
}

@media (max-width: 640px) {
  .exam-choices { grid-template-columns: 1fr; }
  .section { padding: 46px 20px; }
  .hero { padding: 52px 0 40px; }
  .subject-card { padding: 18px 16px 6px; }
  .teacher-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .teacher-buy { width: 100%; justify-content: space-between; }
  .year-banner { padding: 18px; }
  .catalog-bottom { flex-direction: column; align-items: flex-start; }
}

/* ---------- Движение и эффекты ---------- */

/* Появление при прокрутке */

.reveal { opacity: 0; }

.reveal-enter { opacity: 1; animation: reveal-in 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }

.reveal.d1 { animation-delay: 0.08s; }
.reveal.d2 { animation-delay: 0.16s; }
.reveal.d3 { animation-delay: 0.24s; }

@keyframes reveal-in {
  from { opacity: 0.1; transform: translateY(26px); filter: blur(3px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

/* Блик, пробегающий по кнопке при наведении */

.btn { position: relative; overflow: hidden; }

.btn::after {
  content: "";
  position: absolute;
  inset: -50%;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, 0.25) 49%, transparent 63%);
  transform: translateX(-110%);
  transition: transform 0.7s ease;
  pointer-events: none;
}

.btn:hover::after { transform: translateX(110%); }

/* 3D-наклон карточек за курсором (значения ставит motion.js) */

[data-tilt] {
  transform: translateY(var(--ty, 0)) perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.25s ease-out, box-shadow 0.25s ease;
  will-change: transform;
}

[data-tilt]:hover { --ty: -4px; }

[data-tilt]::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle at var(--px, 50%) var(--py, 30%), rgba(255, 255, 255, 0.5), transparent 60%);
  opacity: 0;
  transition: opacity 0.35s ease;
}

[data-tilt]:hover::after { opacity: 1; }

.exam-card, .school-card { position: relative; }

/* Парящий стикер в hero */

.float-badge {
  position: absolute;
  left: -26px;
  bottom: -18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.1);
  font-size: 14px;
  font-weight: 700;
  z-index: 2;
  animation: badge-float 7s ease-in-out infinite;
}

.float-badge small { display: block; font-size: 11px; font-weight: 600; color: var(--muted); }

@keyframes badge-float {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-10px) rotate(-3deg); }
}

/* Полоса прогресса чтения в шапке */

.reading-progress {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: rgba(34, 34, 34, 0.35);
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
  pointer-events: none;
}


.header-inner { position: relative; }

/* «Живые» экраны телефонов: пульс кнопки, заполнение прогресса, подсветка строк */

.phone-1 .mock-row:not(.sub) { animation: row-glow 9s ease-in-out infinite; }
.phone-1 .mock-row:not(.sub):nth-child(2) { animation-delay: 1.4s; }
.phone-1 .mock-row:not(.sub):nth-child(3) { animation-delay: 2.8s; }
.phone-1 .mock-row:not(.sub):nth-child(4) { animation-delay: 4.2s; }
.phone-1 .mock-row:not(.sub):nth-child(5) { animation-delay: 5.6s; }
.phone-1 .mock-row:not(.sub):nth-child(6) { animation-delay: 7s; }

@keyframes row-glow {
  0%, 4% { background: #dcdcdc; }
  12%, 100% { background: var(--bg); }
}

.mock-play-big { animation: play-pulse 2.4s ease-in-out infinite; }

@keyframes play-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.09); }
}

.phone-2 .mock-progress i { animation: tour-progress 14s linear infinite; }

@keyframes tour-progress {
  from { width: 6%; }
  to { width: 96%; }
}

.phone-3 .mock-row .mock-file { animation: chip-pulse 3.2s ease-in-out infinite; }
.phone-3 .mock-row:nth-child(3) .mock-file { animation-delay: 0.8s; }
.phone-3 .mock-row:nth-child(5) .mock-file { animation-delay: 1.6s; }

@keyframes chip-pulse {
  0%, 100% { border-color: var(--line); }
  50% { border-color: var(--text); }
}

/* Шаги: подсветка при наведении */

.step { transition: padding-left 0.3s ease, border-color 0.3s ease; }

.step:hover { padding-left: 34px; border-color: var(--text); }

/* Меньше движения — почти без анимаций */

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; }
  .reveal-enter, .float-badge, .mock-play-big, .phone-1 .mock-row,
  .phone-2 .mock-progress i, .phone-3 .mock-file { animation: none; }
  .phone-sway { animation: none; }
  .phone-tilt, [data-tilt], .step, .btn::after { transition: none; }
}

/* ---------- Страница входа ---------- */

.login-wrap {
  max-width: 520px;
  padding-top: 64px;
  padding-bottom: 40px;
}

.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 34px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.06);
}

.login-card h1 {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.login-card h1 .muted { font-weight: 500; color: var(--muted); font-size: 26px; }

.login-sub { color: var(--muted); margin: 10px 0 24px; font-size: 15px; }

.login-tabs {
  display: inline-flex;
  gap: 8px;
  background: #e2e2e2;
  border-radius: 999px;
  padding: 5px;
  margin-bottom: 22px;
}

.login-tab {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 9px 24px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s ease, color 0.2s ease;
}

.login-tab.active { background: var(--accent); color: #fff; }

.login-panel { display: flex; flex-direction: column; gap: 12px; }

.login-hint, .login-status { font-size: 14px; color: var(--muted); }

.login-status { text-align: center; margin-top: 6px; }

.btn-full { width: 100%; justify-content: center; }

.login-label { font-size: 13px; font-weight: 700; color: var(--muted); margin-top: 6px; }

.login-input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  padding: 14px 16px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease;
}

.login-input:focus { border-color: var(--text); }

.login-input.code { text-align: center; font-size: 22px; letter-spacing: 0.3em; font-weight: 700; }

.email-code-row { display: flex; flex-direction: column; gap: 12px; }

.login-err {
  margin-top: 14px;
  background: #fde8e8;
  border: 1px solid #f3bcbc;
  color: #8a2424;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
}

.login-done { text-align: center; padding: 16px 0 4px; }

.login-done h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }

.login-done p { color: var(--muted); margin: 8px 0 18px; }

@media (max-width: 640px) {
  .login-wrap { padding-top: 36px; }
  .login-card { padding: 26px 20px; }
  .cab-tabs { flex-wrap: wrap; }
}

/* ---------- Видео-тур в телефоне (как у референса) ---------- */

.phone-tour { padding: 0; }

.phone-tour video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #1c1c1c;
  z-index: 1;
}

.phone-tour .tour-fallback {
  position: relative;
  z-index: 2;
  padding: 48px 14px 14px;
  background: #fff;
  min-height: 100%;
}

.phone-tour.has-video .tour-fallback { display: none; }

.phone-tour .phone-notch { z-index: 4; }

.tour-control {
  position: absolute;
  right: 10px;
  bottom: 12px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s ease;
}

.tour-control:hover { transform: translateY(-1px); }

.tour-control-icon { font-size: 10px; }

.tour-hint {
  position: absolute;
  left: 12px;
  bottom: 15px;
  z-index: 4;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.phone-tour.has-video.is-playing .tour-hint { opacity: 0; }

.phone-tour:not(.has-video) .tour-hint { color: var(--muted); text-shadow: none; }

/* ---------- Статус-бар iOS и Telegram-экраны ---------- */

.ios-status {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px 0;
  height: 40px;
  color: #111;
  pointer-events: none;
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.02em;
}

.ios-status .st-icons { display: flex; align-items: center; gap: 6px; }

.phone-tour.has-video .ios-status { display: none; }

.mock.tg {
  background: #eff0f4;
  padding: 46px 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100%;
}

.tg-header {
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  padding: 9px 10px;
  border-bottom: 1px solid #e3e4e9;
  margin: 0 -10px 2px;
}

.tg-back { font-size: 22px; color: #3478f6; line-height: 1; margin-top: -2px; }

.tg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a8c6fa, #6ea1f7);
  display: grid;
  place-items: center;
  font-size: 15px;
  flex: none;
}

.tg-chat { display: flex; flex-direction: column; min-width: 0; }
.tg-chat b { font-size: 13px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-chat small { font-size: 10.5px; color: #8e8e93; }

.tg-post {
  position: relative;
  background: #fff;
  border-radius: 14px;
  padding: 9px 10px 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  max-width: 92%;
  align-self: flex-start;
}

.tg-post.out { align-self: flex-end; background: var(--teal-soft); }

.tg-post.out p { font-size: 12.5px; }

.tg-author { display: block; font-size: 11px; font-weight: 700; color: #3478f6; margin-bottom: 5px; }

.tg-post p { font-size: 12.5px; line-height: 1.4; color: #1c1c1e; }

.tg-post time {
  position: absolute;
  right: 9px;
  bottom: 5px;
  font-size: 9.5px;
  color: #8e8e93;
}

.tg-video {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1c1c1e;
  border-radius: 10px;
  padding: 10px 10px;
  color: #fff;
  font-size: 12px;
  margin: 2px 0;
}

.tg-video em { margin-left: auto; font-style: normal; font-size: 10px; color: #bbb; flex: none; }

.tg-file {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e3e4e9;
  border-radius: 10px;
  padding: 8px 9px;
  font-size: 12px;
  color: #3478f6;
  margin-top: 4px;
}

.tg-file .mock-file { color: #3478f6; border-color: #b9d2fb; }

/* тёплая светящаяся подложка секции, как у референса */

.look-item {
  background:
    radial-gradient(ellipse at 28% 38%, rgba(241, 78, 28, 0.08), transparent 55%),
    linear-gradient(125deg, #faf6ec, #fffdf7 70%);
  border-color: rgba(255, 255, 255, 0.8);
}

/* телефон — компактнее, как у референса */

.phone { width: min(296px, 100%); margin-inline: auto; }

/* ---------- Модальное окно входа (фон замыливается) ---------- */

/* подтверждение покупки на странице курса (buy.js) */
.bc-what { margin: 4px 0 12px; color: var(--muted); font-size: 15px; line-height: 1.45; }
.bc-rows { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px;
  background: var(--bg); border-radius: 14px; padding: 12px 14px; }
.bc-row { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.bc-row b { font-weight: 700; white-space: nowrap; }
.bc-warn { margin: 0 0 12px; color: #c2372c; background: #fbeeec; border: 1px solid #f3d2cd;
  border-radius: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.4; }
#buyConfirmOverlay .btn-full + .btn-full { margin-top: 9px; }

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(24, 24, 24, 0.32);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  animation: auth-fade 0.25s ease both;
}

@keyframes auth-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.auth-modal {
  position: relative;
  width: min(430px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 26px;
  padding: 26px 28px 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25), inset 0 1px 0 #fff;
  animation: auth-pop 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes auth-pop {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg);
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-close:hover { color: var(--text); border-color: var(--text); transform: rotate(90deg); }

.auth-tabs {
  display: flex;
  gap: 6px;
  background: #e4e4e4;
  border-radius: 999px;
  padding: 5px;
  margin-bottom: 20px;
  margin-right: 40px; /* место под крестик, чтобы не наезжал на вкладки */
}

.auth-tab {
  flex: 1;
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 10px 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.auth-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.auth-head { margin-bottom: 18px; }

.auth-head h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }

.auth-head p { color: var(--muted); font-size: 14px; margin-top: 4px; }

.auth-methods { display: flex; flex-direction: column; gap: 10px; }

.auth-method {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: var(--bg);
  padding: 14px 16px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.auth-method:hover {
  border-color: var(--text);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.am-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
  flex: none;
}

.am-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }

.am-text b { font-size: 15.5px; }

.am-text small { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.am-arrow { font-size: 22px; color: var(--muted); line-height: 1; }

.auth-panel { display: flex; flex-direction: column; gap: 12px; }

.auth-back {
  margin-top: 14px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 0;
  align-self: flex-start;
}

.auth-back:hover { color: var(--text); }

/* ---------- Модалка: панели входа/регистрации ---------- */

.auth-pane { display: flex; flex-direction: column; gap: 12px; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-tg-small {
  align-self: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  padding: 6px 12px;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
}

.auth-tg-small:hover { color: var(--text); background: var(--bg); }

.field-hint { font-size: 12.5px; color: var(--muted); margin-top: -6px; }

/* страховка: hidden всегда прячет, даже если у элемента свой display */

[hidden] { display: none !important; }

.reg-steps { display: flex; flex-direction: column; gap: 12px; }

/* ---------- Скриншоты в карточках «как выглядит подготовка» ---------- */

.look-media {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
  aspect-ratio: 3 / 5;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.10);
  transform: rotate(-1.2deg);
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.4s ease;
}

.look-item:nth-child(3) .look-media { transform: rotate(1.2deg); }

.look-item:hover .look-media {
  transform: rotate(0deg) translateY(-4px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.14);
}

.look-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}

/* ---------- Карточка менеджера ---------- */

.support-card {
  display: flex;
  align-items: center;
  gap: 34px;
  background:
    radial-gradient(ellipse at 12% 50%, rgba(30, 107, 82, 0.10), transparent 55%),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 34px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.support-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.09);
}

.sup-chat {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  flex: none;
}

.sup-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  overflow: hidden;
  flex: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.sup-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.sup-bubbles { display: flex; flex-direction: column; gap: 6px; max-width: 240px; }

.sup-bubble {
  background: var(--bg);
  border-radius: 4px 14px 14px 14px;
  padding: 8px 11px;
  font-size: 13px;
  line-height: 1.35;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.sup-bubble b { display: block; font-size: 11.5px; color: #3478f6; margin-bottom: 2px; }

.sup-bubble.out {
  background: var(--teal-soft);
  border-radius: 14px 4px 14px 14px;
  align-self: flex-end;
}

.sup-bubble span { color: #1c1c1e; }

.sup-text { flex: 1; min-width: 220px; }

.sup-text h3 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }

.sup-text p { color: var(--muted); margin-top: 6px; font-size: 15px; max-width: 420px; }

.support-card .btn { flex: none; }

@media (max-width: 760px) {
  .support-card { flex-direction: column; align-items: flex-start; }
  .support-card .btn { width: 100%; justify-content: center; }
}

/* Видео-тур в плоской рамке — точно под кадр 9:16, без обрезки */

.look-media.tour {
  aspect-ratio: 9 / 16;
  position: relative;
  background: #111;
}

.look-media.tour video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.look-media.tour .tour-fallback {
  position: relative;
  min-height: 100%;
  padding: 22px 14px 14px;
}

.look-grid { align-items: start; }

.look-media.tour.has-video .tour-fallback { display: none; }

/* ---------- Личный кабинет ---------- */

.cab-wrap { max-width: 780px; padding-top: 44px; padding-bottom: 60px; }

.cab-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.cab-title { font-size: clamp(32px, 5vw, 48px); font-weight: 800; letter-spacing: -0.03em; }

.cab-sub { color: var(--muted); margin-top: 8px; }

.cab-list { display: flex; flex-direction: column; gap: 14px; }

.cab-course {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px 22px;
  flex-wrap: wrap;
}

.cc-info b { font-size: 17px; font-weight: 800; }

.cc-info small { display: block; color: var(--muted); margin-top: 4px; font-size: 14px; }

.cc-done { color: #1e7a4a; font-weight: 700; font-size: 14px; }

.cab-empty {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 44px 32px;
  text-align: center;
  color: var(--muted);
}

.cab-empty h3 { color: var(--text); font-size: 22px; font-weight: 800; margin-bottom: 8px; }

.cab-empty p { margin-bottom: 20px; }

.cab-empty .btn { margin: 0 6px 6px; }

.cab-err {
  margin-top: 16px;
  background: #fde8e8;
  border: 1px solid #f3bcbc;
  color: #8a2424;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
}

/* ---------- Редизайн: hero наоборот, бегущая строка школ, таймлайн шагов ---------- */

@media (min-width: 901px) {
  .hero-grid .hero-visual { order: -1; }
}

.school-marquee {
  position: relative;
  overflow: hidden;
  padding: 26px 0 6px;
}

/* дешёвое растворение краёв: статичные градиенты поверх ленты */

.school-marquee::before,
.school-marquee::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 96px;
  z-index: 2;
  pointer-events: none;
}

.school-marquee::before {
  left: 0;
  background: linear-gradient(90deg, var(--bg), rgba(243, 238, 227, 0));
}

.school-marquee::after {
  right: 0;
  background: linear-gradient(-90deg, var(--bg), rgba(243, 238, 227, 0));
}

.school-track {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  width: max-content;
  will-change: transform;
  transform: translateZ(0);
  animation: school-run 28s linear infinite;
}


@keyframes school-run {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 640px;
}

.step {
  position: relative;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 4px 0 30px 92px;
  box-shadow: none;
}

.step:last-child { padding-bottom: 14px; }

.step::before {
  content: "";
  position: absolute;
  left: 33px;
  top: 46px;
  bottom: 4px;
  width: 2px;
  border-radius: 2px;
  background: var(--line);
}

.step:last-child::before { display: none; }

.step .n {
  position: absolute;
  left: 0;
  top: 0;
  min-width: 44px;
  width: max-content;
  padding: 0 12px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(241, 78, 28, 0.25);
}

.step h4 { margin-top: 8px; }

.step:hover { padding-left: 92px; border-color: transparent; }

/* ---------- Hero: центрированная версия ---------- */

.hero-center {
  text-align: center;
  padding: 72px 0 40px;
}

.hero-center .hero-kicker { margin-bottom: 22px; }

.hero-center h1 { margin-inline: auto; }

.hero-center .hero-sub {
  margin-left: auto;
  margin-right: auto;
  max-width: 560px;
}

.hero-center .hero-actions { justify-content: center; }

.hero-center .hero-note { margin-top: 20px; }

/* Бесшовный цикл ленты школ: две одинаковые последовательности,
   каждая с хвостовым отступом = ровно 50% ширины трека */

.school-track { gap: 0; }

.school-seq {
  display: flex;
  gap: 12px;
  padding-right: 12px;
}

/* Плавные переходы между страницами (Chromium) + фолбэк-затухание */

@view-transition {
  navigation: auto;
}

html.page-leave { opacity: 0.001; }

html {
  transition: opacity 0.16s ease;
}

/* ---------- Отзывы ---------- */

.reviews-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.review-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 24px 20px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rc-head { display: flex; align-items: center; gap: 12px; }

.rc-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--teal-soft);
  color: var(--teal);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 17px;
  flex: none;
}

.rc-head b { display: block; font-size: 15.5px; }

.rc-head small { color: var(--muted); font-size: 12.5px; }

.review-card blockquote {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text);
}

.reviews-note { margin-top: 16px; font-size: 13px; color: var(--muted); }

@media (max-width: 900px) {
  .reviews-grid { grid-template-columns: 1fr; }
}

/* Кабинет: вкладки, баланс, информация */

.cab-tabs {
  display: inline-flex;
  gap: 6px;
  background: #e9e2cf;
  border-radius: 14px;
  padding: 5px;
  margin-bottom: 22px;
}

.cab-tab {
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s ease, color 0.2s ease;
}

.cab-tab.active { background: var(--accent); color: #fff; }

.cab-balance-card {
  background: linear-gradient(125deg, var(--teal), #164c3a);
  color: #fff;
  border-radius: var(--radius);
  padding: 30px 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.cb-label { font-size: 13px; font-weight: 700; opacity: 0.8; letter-spacing: 0.06em; text-transform: uppercase; }

.cb-amount { font-family: Golos Text, Onest, sans-serif; font-size: 44px; font-weight: 600; }

.cb-hint { font-size: 13.5px; opacity: 0.75; max-width: 420px; }

.cab-balance-card .btn { background: #fff; color: var(--teal); border-color: #fff; box-shadow: none; margin-top: 8px; }

.cab-info { display: flex; flex-direction: column; gap: 10px; }

.ci-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 20px;
}

.ci-row span { color: var(--muted); }

.ci-row b { font-size: 15px; }

/* Кабинет: блоки смены пароля/почты */

.ci-block {
  margin-top: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ci-block h4 { font-size: 16px; font-weight: 800; }

.ci-hint { font-size: 13px; color: var(--muted); }

.ci-block .btn { align-self: flex-start; margin-top: 6px; }

.ci-msg { font-size: 13.5px; font-weight: 600; color: var(--teal); min-height: 18px; }

.ci-msg:empty { min-height: 0; }

.email-change-codes { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Страница курса (/course/{id}) ---------- */

.course-hero { padding: 26px 0 8px; }

.course-exam-line {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 14px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em;
}

.course-hero h1 { font-size: clamp(30px, 4.6vw, 46px); margin: 12px 0 10px; }

.course-hero .sub { max-width: 640px; font-size: 18px; color: var(--muted); }

.course-facts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

.fact-chip {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 14px;
}

.course-tariffs {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 20px; margin: 30px 0 10px;
}

.price-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px 26px 24px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px;
}

.price-card-year { border-color: var(--accent); }

.pc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

.pc-head h3 { font-family: Golos Text, Onest, sans-serif; font-size: 19px; font-weight: 600; }

.pc-price { font-size: 26px; font-weight: 800; white-space: nowrap; }

.pc-badge {
  display: inline-block; vertical-align: 6px; margin-left: 8px;
  background: var(--accent-soft); color: var(--accent-dark);
  border-radius: 999px; padding: 2px 10px;
  font-family: Onest, sans-serif; font-size: 12px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
}

.pc-list { list-style: none; display: flex; flex-direction: column; gap: 9px; color: var(--muted); }

.pc-list li { padding-left: 22px; position: relative; font-size: 15.5px; }

.pc-list li::before {
  content: "✓"; position: absolute; left: 0; color: var(--teal); font-weight: 800;
}

.course-msg {
  margin: 14px 0 0; padding: 13px 18px; border-radius: 14px;
  background: var(--accent-soft); color: var(--accent-dark); font-weight: 600;
}

.course-alt { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 26px 0 40px; }

.course-alt > span { color: var(--muted); font-weight: 600; font-size: 15px; }

/* ---------- Страница оплаты (/pay/{id}) ---------- */

.pay-wrap { max-width: 640px; }

.pay-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 34px 32px 28px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px;
  margin: 22px 0 40px;
}

.pay-card h1 { font-size: clamp(26px, 3.6vw, 34px); }

.pay-amount {
  font-family: Golos Text, Onest, sans-serif; font-size: 34px; font-weight: 700;
  color: var(--text);
}

.pay-hint { color: var(--muted); font-size: 14.5px; }

.pay-status { color: var(--accent-dark); font-weight: 700; }

.pay-ok-badge {
  align-self: flex-start;
  background: var(--teal-soft); color: var(--teal);
  border-radius: 999px; padding: 6px 16px; font-weight: 800; font-size: 14px;
}

.pay-actions { display: flex; flex-direction: column; gap: 12px; }

.pay-tg-link {
  border: 1px dashed var(--line); border-radius: 14px; padding: 16px;
  color: var(--muted); font-size: 15px; display: flex; flex-direction: column; gap: 10px;
}

.btn.teal {
  background: var(--teal); border-color: var(--teal);
  box-shadow: 0 10px 26px rgba(30, 107, 82, 0.25);
}

.btn.teal:hover { background: #175943; }

@media (max-width: 640px) {
  .teacher-buy { flex-wrap: wrap; }
  .pay-card { padding: 24px 18px; }
}

/* ---------- Оплата с баланса (страница курса) и пополнение (кабинет) ---------- */

.course-balance {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  margin: 4px 0 6px; color: var(--muted); font-weight: 600; font-size: 15px;
}

.cab-topup { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }

.cab-topup-status { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }

/* ---------- Страница курса: «назад» и выбор блока ---------- */

.course-back { margin-top: 22px; }

.course-blocks { display: flex; flex-direction: column; gap: 8px; }

.cbl-label { font-size: 13.5px; font-weight: 700; color: var(--muted); }

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

.block-chip {
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
  border-radius: 999px; padding: 7px 16px; font: 600 14px/1 Onest, sans-serif;
  min-height: 44px;
  cursor: pointer; transition: border-color .15s, background .15s;
}

.block-chip:hover { border-color: var(--accent); }

.block-chip.active {
  background: var(--text); color: var(--panel); border-color: var(--text);
}

.block-chip.owned {
  opacity: .55; cursor: default;
  background: var(--teal-soft); color: var(--teal); border-color: var(--teal-soft);
}

/* ---------- Подвал прижат к низу окна (везде) ----------
   Короткая страница (курс, оплата, вход) не оставляет «© 2026–2027 ya300»
   висеть сразу после контента: main растягивается, footer уходит в самый низ. */
body { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1 0 auto; width: 100%; }
.footer { flex-shrink: 0; }

/* ---------- Мобильная шапка ----------
   В 375px лого + 3 навссылки + 2 кнопки не помещаются в один ряд:
   «Войти / Регистрация» обрезалось краем. Делаем два ряда: лого + вход,
   навигация ниже; кнопку «Telegram-бот» прячем (дублируется в футере). */
@media (max-width: 700px) {
  body { padding-top: 132px; }

  .header { top: 8px; }

  .header-inner {
    flex-wrap: wrap;
    gap: 4px 10px;
    padding: 10px 14px 8px;
  }

  .logo { font-size: 22px; margin-right: auto; }

  /* навигация скрыта правилом @media 900px выше — ряд занимает только лого+вход */
  .header .btn.ghost { display: none; }

  .header .btn:not(.ghost) {
    padding: 8px 14px;
    font-size: 13.5px;
    border-radius: 11px;
    white-space: nowrap;
  }
}

/* на телефоне фейд-края закрывали половину леты школ (по 96px с каждой стороны
   на 375px ширины) — выглядели как «замыливание» справа и слева; убираем */
@media (max-width: 700px) {
  .school-marquee::before,
  .school-marquee::after { display: none; }

  /* плавность: blur/translate в reveal дорого и мыльно на телефонах — чистый фейд */
  .reveal-enter { animation: reveal-in-m 0.45s ease-out backwards; }

  a, button, [role="button"], input, select { touch-action: manipulation; }

  /* тарифы: minmax(290px) шире узких экранов — одна колонка без переполнения */
  .course-tariffs { grid-template-columns: 1fr; }
  .price-card { min-width: 0; }
}

* { -webkit-tap-highlight-color: transparent; }

@keyframes reveal-in-m {
  from { opacity: 0.1; }
  to { opacity: 1; }
}

/* ---------- Кабинет: карточка пополнения баланса ---------- */

.topup-card { margin-top: 16px; display: flex; flex-direction: column; gap: 14px; }

.tc-title {
  font-family: Golos Text, Onest, sans-serif; font-size: 18px; font-weight: 600;
  margin: 0;
}

.tc-sub { color: var(--muted); font-size: 14.5px; margin: -6px 0 0; }

.topup-chips { display: flex; flex-wrap: wrap; gap: 10px; }

.topup-chips .chip {
  border: 1.5px solid var(--line); background: var(--bg); color: var(--text);
  border-radius: 999px; padding: 10px 18px;
  font: 700 15px/1 Onest, sans-serif; cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}

.topup-chips .chip:hover { border-color: var(--accent); }

.topup-chips .chip.active {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 6px 16px rgba(241, 78, 28, 0.25);
}

.topup-chips .chip-custom { border-style: dashed; }

.topup-card .btn-full { width: 100%; justify-content: center; }

.topup-invoice {
  border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
  background: var(--bg);
}

.ti-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }

.ti-num { color: var(--muted); font-size: 14px; font-weight: 600; }
.ti-num b { color: var(--text); }

.ti-amount {
  font-family: Golos Text, Onest, sans-serif; font-size: 20px; font-weight: 700;
}

.ti-wait { display: flex; flex-direction: column; gap: 10px; }

.ti-done { text-align: center; padding: 6px 0 2px; }

.ti-badge {
  display: inline-block; background: var(--teal-soft); color: var(--teal);
  border-radius: 999px; padding: 10px 22px; font-weight: 800; font-size: 15px;
}

/* карточка пополнения — светлая, поверх зелёного баланса читается лучше */
.topup-card {
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}

.topup-card .login-input { background: var(--bg); }

/* на телефоне анимированная лента режет чипы школ краями экрана — показываем
   статичные ряды, в которые всё помещается целиком (десктопу остаётся лента) */
@media (max-width: 700px) {
  .school-marquee { overflow: visible; padding: 18px 0 4px; }
  .school-track {
    flex-wrap: wrap;
    width: 100%;
    animation: none;
    transform: none;
    gap: 10px;
  }
  .school-seq {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding-right: 0;
  }
  .school-seq[aria-hidden="true"] { display: none; }
  /* в статичном режиме дубли чипов (нужны для цикла) не нужны — оставляем 7 уникальных */
  .school-seq:not([aria-hidden="true"]) .school-chip:nth-child(n + 8) { display: none; }
}

/* ---------- Юридические страницы (/terms /privacy) и согласие ---------- */

.legal { max-width: 760px; padding-bottom: 40px; }

.legal h1 { font-size: clamp(24px, 3.4vw, 34px); margin: 10px 0 4px; }

.legal-updated { color: var(--muted); font-size: 14px; margin-bottom: 18px; }

.legal h3 {
  font-size: 17px; font-weight: 800; margin: 26px 0 8px;
  font-family: Onest, sans-serif;
}

.legal p, .legal li { color: #4c4231; font-size: 15.5px; line-height: 1.65; }

.legal ul { padding-left: 20px; margin: 8px 0; display: flex; flex-direction: column; gap: 6px; }

.auth-consent {
  font-size: 12.5px; color: var(--muted); text-align: center;
  margin: 10px 0 2px; line-height: 1.5;
}

.auth-consent a { color: var(--accent-dark); font-weight: 600; text-decoration: underline; }

/* ---------- Кабинет: привязка Telegram ---------- */

.tg-bind {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  border: 1.5px dashed var(--accent); border-radius: 14px;
  background: var(--accent-soft); padding: 14px 16px; margin-bottom: 14px;
}

.tg-bind .tb-text { flex: 1 1 240px; color: var(--text); font-size: 15px; }

/* глазик пароля */
.pw-wrap { position: relative; }

.pw-wrap .login-input { width: 100%; padding-right: 44px; }

.pw-eye {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; cursor: pointer; font-size: 16px;
  opacity: 0.55; line-height: 1; padding: 2px;
}

.pw-eye:hover { opacity: 1; }

/* ---------- Кабинет: каталог семей + история ---------- */

.fam-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; margin-bottom: 12px;
}

.fam-head {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 18px; cursor: pointer; user-select: none;
  border-radius: 13px 13px 0 0;
}

.fam-title { flex: 1; font-weight: 800; font-size: 15.5px; }

.fam-tag {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 10px;
  font-size: 12px; font-weight: 700;
}

.fam-year {
  background: var(--teal-soft); color: var(--teal);
  border-radius: 999px; padding: 3px 12px; font-size: 12.5px; font-weight: 800;
}

.fam-toggle { color: var(--muted); }

.fam-blocks { padding: 0 18px 14px; display: flex; flex-direction: column; gap: 8px; }

.fam-block {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  background: var(--bg); border-radius: 10px; padding: 10px 14px;
}

.fam-block-name { flex: 1 1 160px; font-weight: 700; font-size: 14.5px; }

.fam-lock {
  color: var(--muted); font-size: 12.5px; border: 1px dashed var(--line);
  border-radius: 999px; padding: 2px 10px;
}

.fam-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* история */
.hi-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 16px; margin-bottom: 8px;
}

.hi-row-cancel { opacity: 0.5; }

.hi-icon { font-size: 20px; }

.hi-body { flex: 1; display: flex; flex-direction: column; }

.hi-body small { color: var(--muted); font-size: 12.5px; }

.hi-amount { font-weight: 800; white-space: nowrap; }

.hi-badge {
  background: var(--accent-soft); color: var(--accent-dark);
  border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700;
}

.hi-badge.hi-cancel { background: var(--bg); color: var(--muted); }
