/*
  UVI Online School — стили лендинга.

  Палитра и типографика взяты из бренд-брифа. Правило 60/30/10:
  нейтральные фоны — лаванда — оранжевые акценты. Оранжевый только на
  кнопках и мелких акцентах, никогда как фон большой площади.

  Сборки нет: файл подключается напрямую, поэтому правки видны сразу.
*/

:root {
  /* Основные */
  --lavender: #b897e7;
  --yellow: #f7ee7f;
  --orange: #f79433;
  --orange-hover: #f9a34a;
  --purple: #4a3572;
  /* Для текста поверх лаванды: основной фиолетовый даёт 4.22:1. */
  --purple-on-lavender: #443066;
  --purple-light: #5b4587;

  /* Вспомогательные */
  --lilac: #e3d6f7;
  --milk: #faf7ff;
  --graphite: #3a3444;
  --grey: #726f80;

  /* Функциональные */
  --mint: #5dc99b;
  --coral: #f0777b;
  --sky: #6ba8e8;
  /* Для текста по светлому фону: #6BA8E8 даёт 2.36:1. */
  --sky-text: #2f6fb0;
  --amber: #ffb84d;
  --turquoise: #3fbfc9;

  /* Предметные подложки */
  --math-bg: #ddf3ea;
  --english-bg: #fde9cf;
  --informatics-bg: #d3e4f8;
  --physics-bg: #d6f2f4;
  --chemistry-bg: #fbddde;

  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 12px 40px rgba(74, 53, 114, 0.2);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--milk);
  color: var(--graphite);
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

h1,
h2,
h3 {
  font-family: "Montserrat Alternates", "Nunito", sans-serif;
  font-weight: 700;
  color: var(--purple);
  margin: 0;
  text-wrap: balance;
}

a {
  color: var(--sky-text);
  text-decoration: none;
}

a:hover {
  color: var(--purple);
}

img {
  max-width: 100%;
  height: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── Раскладка ─────────────────────────────────────────────────────── */

.container {
  max-width: 1100px;
  margin: 0 auto;
}

.container--narrow {
  max-width: 800px;
}

.section {
  padding: 72px 32px;
}

.section--milk {
  background: var(--milk);
}

.section--yellow {
  background: var(--yellow);
}

.section--lilac {
  background: var(--lilac);
}

.section--lavender {
  background: var(--lavender);
}

.section--purple {
  background: var(--purple);
}

.section--purple h2 {
  color: #fff;
}

.section h2 {
  font-size: 36px;
  margin-bottom: 12px;
}

.section__lead {
  color: var(--grey);
  font-size: 17px;
  margin: 0 0 36px;
}

.section__lead--dark {
  color: var(--purple);
}

.section__lead--light {
  color: var(--lilac);
}

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

.button {
  display: inline-block;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  font-size: 15px;
  padding: 10px 22px;
  white-space: nowrap;
  text-align: center;
}

.button--accent {
  background: var(--orange);
  color: var(--purple);
}

.button--accent:hover {
  background: var(--orange-hover);
  color: var(--purple);
}

.button--lg {
  font-size: 18px;
  padding: 16px 32px;
  box-shadow: 0 6px 20px rgba(74, 53, 114, 0.25);
}

.button--block {
  display: block;
  width: 100%;
  font-size: 17px;
  padding: 15px 32px;
}

/* ── Шапка ─────────────────────────────────────────────────────────── */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--milk);
  border-bottom: 1px solid var(--lilac);
  padding: 12px 32px;
  display: flex;
  align-items: center;
  gap: 24px;
  justify-content: space-between;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--purple);
  font-family: "Montserrat Alternates", sans-serif;
  font-weight: 700;
  font-size: 20px;
}

.header__logo img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.header__nav {
  display: flex;
  gap: 28px;
  font-weight: 700;
  font-size: 15px;
}

.header__nav a {
  color: var(--graphite);
}

.header__nav a:hover {
  color: var(--purple);
}

/* ── Первый экран ──────────────────────────────────────────────────── */

.hero {
  background: var(--lavender);
  padding: 72px 32px 80px;
}

.hero__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: center;
}

.eyebrow {
  color: var(--purple);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 14px;
}

.hero__title {
  font-size: 48px;
  line-height: 1.2;
  margin: 0 0 20px;
}

/* Жёлтый маркер из брендбука: текст на жёлтом — только глубоким фиолетовым. */
.marker {
  background: var(--yellow);
  color: var(--purple);
  padding: 2px 12px;
  border-radius: 10px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.hero__lead {
  font-size: 20px;
  color: var(--purple-on-lavender);
  margin: 0 0 28px;
  max-width: 520px;
  line-height: 1.5;
}

.hero__points {
  list-style: none;
  padding: 0;
  margin: 0 0 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 17px;
  color: var(--purple);
  font-weight: 700;
}

.hero__points li::before {
  content: "✦";
  color: #fff;
  margin-right: 10px;
}

.hero__actions {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.hero__note {
  color: var(--purple);
  font-weight: 700;
}

.hero__logo {
  display: flex;
  justify-content: center;
}

.hero__logo img {
  width: 340px;
  height: 340px;
  border-radius: 32px;
  box-shadow: 0 12px 40px rgba(74, 53, 114, 0.3);
}

/* ── Карточки ──────────────────────────────────────────────────────── */

.cards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 20px;
}

.cards--subjects {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.cards--three {
  grid-template-columns: repeat(3, 1fr);
}

.cards--passes {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.subject {
  border-radius: var(--radius);
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.subject h3 {
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.subject__dot {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 50%;
}

.subject p {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
}

.subject--math {
  background: var(--math-bg);
}
.subject--math .subject__dot {
  background: var(--mint);
}
.subject--english {
  background: var(--english-bg);
}
.subject--english .subject__dot {
  background: var(--orange);
}
.subject--informatics {
  background: var(--informatics-bg);
}
.subject--informatics .subject__dot {
  background: var(--sky);
}
.subject--physics {
  background: var(--physics-bg);
}
.subject--physics .subject__dot {
  background: var(--turquoise);
}
.subject--chemistry {
  background: var(--chemistry-bg);
}
.subject--chemistry .subject__dot {
  background: var(--coral);
}

.format {
  background: var(--milk);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.format h3 {
  font-size: 26px;
}

.format p {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
}

.format__meta {
  font-weight: 800;
  font-size: 15px;
}

.format__meta--accent {
  color: var(--orange);
}

/* ── Цены ──────────────────────────────────────────────────────────── */

.tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 24px;
}

.tab {
  background: var(--lilac);
  color: var(--purple);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  font-size: 15px;
  padding: 10px 20px;
}

.tab:hover {
  background: #d7c5f2;
}

.tab.is-active {
  background: var(--purple);
  color: #fff;
}

.price {
  background: #fff;
  border: 1px solid var(--lilac);
  border-radius: var(--radius);
  overflow: hidden;
}

.price__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

.price__table th,
.price__table td {
  padding: 14px 20px;
  text-align: right;
}

.price__table thead th {
  background: var(--lilac);
  color: var(--purple);
  font-weight: 800;
  font-size: 15px;
}

.price__table th:first-child,
.price__table tbody th {
  text-align: left;
  font-weight: 700;
  color: var(--purple);
}

.price__table tbody tr {
  border-top: 1px solid var(--lilac);
}

.price__note {
  color: var(--grey);
  font-size: 14px;
  margin: 0;
  padding: 0 20px 16px;
}

/* Без JS показываем все таблицы: цены важнее переключателя. */
.price + .price {
  margin-top: 12px;
}

/* ── Абонементы ────────────────────────────────────────────────────── */

.pass {
  background: var(--purple-light);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pass__base {
  color: var(--yellow);
  font-weight: 800;
  font-size: 15px;
  margin: 0;
}

.tier {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  align-items: baseline;
}

.tier span {
  font-weight: 800;
  white-space: nowrap;
}

.tier b {
  font-weight: 800;
  font-size: 18px;
  white-space: nowrap;
}

.tier small {
  grid-column: 1 / -1;
  font-size: 13px;
  opacity: 0.85;
}

.tier em {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 800;
  font-style: normal;
}

.tier--best {
  background: var(--amber);
  color: var(--purple);
}

/* ── Преподаватели ─────────────────────────────────────────────────── */

.teachers {
  list-style: none;
  padding: 0 0 16px;
  margin: 0;
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}

.teacher {
  flex: 0 0 320px;
  scroll-snap-align: start;
  background: #fff;
  border: 1px solid var(--lilac);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  text-align: center;
}

.teacher h3 {
  font-size: 19px;
}

.teacher p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: var(--lilac);
  color: var(--lavender);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}

.chip {
  color: var(--purple);
  font-weight: 800;
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 999px;
}

.chip--math {
  background: var(--math-bg);
}
.chip--english {
  background: var(--english-bg);
}
.chip--informatics {
  background: var(--informatics-bg);
}
.chip--physics {
  background: var(--physics-bg);
}
.chip--chemistry {
  background: var(--chemistry-bg);
}

/* ── Отзывы ────────────────────────────────────────────────────────── */

.review {
  background: var(--milk);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.review p {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
}

.review__stars {
  color: var(--orange);
  font-size: 18px;
  letter-spacing: 3px;
}

.review__author {
  color: var(--grey);
  font-size: 14px;
  font-weight: 700;
}

/* ── FAQ ───────────────────────────────────────────────────────────── */

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

.faq__item {
  background: #fff;
  border: 1px solid var(--lilac);
  border-radius: 16px;
  overflow: hidden;
}

.faq__item summary {
  cursor: pointer;
  padding: 18px 22px;
  font-size: 17px;
  font-weight: 800;
  color: var(--purple);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.faq__item summary::-webkit-details-marker {
  display: none;
}

.faq__item summary::after {
  content: "▾";
  color: var(--orange);
  font-size: 18px;
  transition: transform 0.2s;
}

.faq__item[open] summary::after {
  transform: rotate(180deg);
}

.faq__item p {
  margin: 0;
  padding: 0 22px 18px;
  font-size: 15px;
  line-height: 1.6;
}

/* ── Заявка ────────────────────────────────────────────────────────── */

.contact {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.contact__star {
  color: #fff;
  font-size: 32px;
  margin: 0;
}

.contact h2 {
  font-size: 38px;
  margin: 0 0 20px;
}

.contact__lead {
  color: var(--purple-on-lavender);
  font-size: 18px;
  margin: 0 0 20px;
  line-height: 1.5;
}

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

.messenger {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--milk);
  border-radius: 16px;
  padding: 14px 20px;
  color: var(--purple);
  font-weight: 800;
  font-size: 16px;
}

.messenger:hover {
  background: #fff;
  color: var(--purple);
}

.messenger__badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}

.messenger__badge--tg {
  background: var(--sky);
  font-size: 14px;
}

.messenger__badge--max {
  background: var(--mint);
}

.lead-card {
  background: var(--milk);
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.lead-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lead-form__title {
  font-family: "Montserrat Alternates", sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--purple);
  margin: 0;
}

.lead-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 800;
  color: var(--purple);
}

.lead-form input[type="text"],
.lead-form input[type="tel"] {
  font-family: inherit;
  font-size: 16px;
  padding: 12px 16px;
  border: 1px solid var(--lilac);
  border-radius: 12px;
  background: #fff;
  color: var(--graphite);
}

.lead-form input:focus-visible {
  outline: 2px solid var(--lavender);
  outline-offset: 1px;
}

.lead-form .checkbox {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  font-weight: 400;
  color: var(--grey);
  line-height: 1.4;
}

.lead-form .checkbox input {
  margin-top: 2px;
  flex-shrink: 0;
}

.lead-form__error {
  color: var(--coral);
  font-size: 14px;
  font-weight: 700;
  margin: 0;
}

.lead-done {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  text-align: center;
  padding: 32px 0;
}

.lead-done p {
  margin: 0;
  font-size: 15px;
}

.lead-done__mark {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--mint);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.lead-done__title {
  font-family: "Montserrat Alternates", sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--purple);
}

/* ── Подвал ────────────────────────────────────────────────────────── */

.footer {
  background: var(--purple);
  color: var(--lilac);
  padding: 32px;
  display: flex;
  justify-content: center;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 14px;
  text-align: center;
}

.footer img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.footer a {
  color: var(--lilac);
  text-decoration: underline;
}

.footer a:hover {
  color: #fff;
}

/* ── Адаптив ───────────────────────────────────────────────────────────
   В исходном макете медиазапросов не было вовсе, а с рекламы приходят
   в основном с телефонов. */

@media (max-width: 900px) {
  .section {
    padding: 56px 20px;
  }

  .hero {
    padding: 48px 20px 56px;
  }

  .hero__inner,
  .contact {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  /* Логотип под текстом занимает пол-экрана — уменьшаем и ставим первым. */
  .hero__logo {
    order: -1;
  }

  .hero__logo img {
    width: 200px;
    height: 200px;
  }

  .hero__title {
    font-size: 34px;
  }

  .hero__lead {
    font-size: 18px;
  }

  .section h2 {
    font-size: 28px;
  }

  .contact h2 {
    font-size: 30px;
  }

  .cards--three {
    grid-template-columns: 1fr;
  }

  .header {
    padding: 10px 16px;
    gap: 12px;
    flex-wrap: wrap;
  }

  /* Меню на телефоне прячем: якоря дублируются кнопкой и содержимым. */
  .header__nav {
    display: none;
  }

  .lead-card {
    padding: 24px;
  }
}

@media (max-width: 620px) {
  /* Таблица цен в четыре колонки на узком экране нечитаема:
     превращаем каждую строку в карточку с подписями. */
  .price__table thead {
    display: none;
  }

  .price__table,
  .price__table tbody,
  .price__table tr {
    display: block;
  }

  .price__table tr {
    padding: 12px 16px;
  }

  .price__table tbody th {
    display: block;
    padding: 0 0 6px;
  }

  .price__table td {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    text-align: right;
  }

  .price__table td::before {
    content: attr(data-label);
    color: var(--grey);
    font-weight: 700;
  }

  .teacher {
    flex-basis: 260px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .faq__item summary::after {
    transition: none;
  }
}

/* ── Запасной блок вместо формы ─────────────────────────────────────
   Показывается, пока не подключён приём заявок. */

.lead-fallback {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lead-fallback p {
  margin: 0;
  font-size: 15px;
}

.button--ghost {
  background: transparent;
  color: var(--purple);
  border: 2px solid var(--lavender);
}

.button--ghost:hover {
  background: var(--lilac);
  color: var(--purple);
}
