/* Общая база для всех макетов: сброс, токены тем, типовые блоки */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

/* Атрибут hidden должен побеждать раскладку компонентов */
[hidden] {
  display: none !important;
}

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

button {
  font: inherit;
  cursor: pointer;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  margin: 0;
  line-height: 1.08;
  letter-spacing: var(--display-tracking, -0.01em);
}

p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Светлая тема — значения по умолчанию, бренд может их переопределить */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f4f0;
  --surface: #ffffff;
  --surface-2: #f1ede6;
  --fg: #16130f;
  --fg-muted: #6d645b;
  --border: #e5dfd6;
  --shadow-soft: 0 18px 40px -26px rgba(22, 19, 15, 0.32);
  --shadow-card: 0 24px 60px -34px rgba(22, 19, 15, 0.4);
  --radius: 18px;
  --radius-lg: 28px;
  --radius-pill: 999px;
  --section-gap: 104px;
}

[data-theme='dark'] {
  --bg: #131110;
  --bg-soft: #1a1715;
  --surface: #1e1a17;
  --surface-2: #262019;
  --fg: #f7f2ea;
  --fg-muted: #a79d90;
  --border: #322b23;
  --shadow-soft: 0 18px 40px -26px rgba(0, 0, 0, 0.75);
  --shadow-card: 0 26px 64px -34px rgba(0, 0, 0, 0.85);
}

.container {
  width: min(1180px, calc(100% - 44px));
  margin-inline: auto;
}

.container--narrow {
  width: min(880px, calc(100% - 44px));
  margin-inline: auto;
}

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 26px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
  pointer-events: none;
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 14px 30px -18px var(--accent-shadow);
}

.btn--dark {
  background: var(--fg);
  color: var(--bg);
}

.btn--outline {
  border-color: var(--border);
  color: var(--fg);
  background: transparent;
}

.btn--lg {
  padding: 18px 34px;
  font-size: 18px;
}

.btn--block {
  width: 100%;
}

/* Мелкие элементы */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-muted);
}

.lead {
  color: var(--fg-muted);
  font-size: 19px;
}

.muted {
  color: var(--fg-muted);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* Шапка */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 14px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand__crest {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  line-height: 1.1;
}

.brand__tagline {
  display: block;
  font-family: var(--font-text);
  font-weight: 600;
  font-size: 12px;
  color: var(--fg-muted);
}

.site-nav {
  display: flex;
  gap: 24px;
  margin-left: auto;
  font-size: 15px;
  font-weight: 600;
}

.site-nav a:hover {
  color: var(--accent-text);
}

.site-header__cta {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Секции */
.section {
  padding-block: var(--section-gap);
}

.section__head {
  max-width: 720px;
  margin-bottom: 48px;
}

.section__title {
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 800;
  margin-bottom: 14px;
}

/* Карточки */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
}

.grid {
  display: grid;
  gap: 22px;
}

.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Макет живого урока: звонок, доска, презентация */
.callmock {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--fg);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.callmock__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 14px;
}

.callmock__bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
}

.callmock__bar b {
  margin-left: 8px;
  font-family: var(--font-text);
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-muted);
}

.callmock__board {
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 22px;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.callmock__slide-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
}

.callmock__code {
  font-family: 'SFMono-Regular', ui-monospace, 'Cascadia Mono', Menlo, monospace;
  font-size: 13px;
  line-height: 1.7;
  color: var(--fg-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}

.callmock__code b {
  color: var(--accent-text);
}

.callmock__tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding-top: 12px;
}

.callmock__tile {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-muted);
  min-height: 58px;
  display: flex;
  align-items: flex-end;
}

.callmock__tile--teacher {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent-text);
}

/* Формы записи */
.form {
  display: grid;
  gap: 14px;
}

.form__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 13px;
  font-weight: 700;
  color: var(--fg-muted);
}

.field input,
.field select {
  font: inherit;
  font-size: 16px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
}

.field input:focus,
.field select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.form__note {
  font-size: 13px;
  color: var(--fg-muted);
}

/* Контакты родителя: тип связи + значение, строк может быть несколько */
.contact-row {
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.contact-row + .contact-row {
  margin-top: 8px;
}

.contact-row__type,
.contact-row__value {
  font: inherit;
  font-size: 16px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  min-width: 0;
}

.contact-row__type:focus,
.contact-row__value:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.contact-row__value[aria-invalid='true'] {
  border-color: #e5484d;
}

.contact-row__remove {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg-muted);
  font-size: 18px;
  line-height: 1;
  padding: 0;
}

.contact-row__remove:hover {
  border-color: var(--accent);
  color: var(--accent-text);
}

.contact-add {
  justify-self: start;
  margin-top: 10px;
  padding: 0;
  border: none;
  background: none;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-text);
}

.contact-add:hover {
  text-decoration: underline;
}

.form__hint {
  margin-top: 8px;
  font-size: 13px;
  color: var(--fg-muted);
}

/* Подвал */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 54px 40px;
  background: var(--bg-soft);
}

.site-footer__top {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: space-between;
  margin-bottom: 36px;
}

.site-footer__col h4 {
  font-size: 15px;
  margin-bottom: 14px;
}

.site-footer__col li {
  font-size: 15px;
  color: var(--fg-muted);
  margin-bottom: 8px;
}

.site-footer__legal {
  border-top: 1px solid var(--border);
  padding-top: 22px;
  font-size: 13px;
  color: var(--fg-muted);
}

/* Круглая кнопка с иконкой — переключатель темы в шапке */
.icon-btn {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg-muted);
  transition: color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.icon-btn:hover {
  color: var(--accent-text);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.icon-btn .icon-sun {
  display: none;
}

[data-theme='dark'] .icon-btn .icon-sun {
  display: block;
}

[data-theme='dark'] .icon-btn .icon-moon {
  display: none;
}

/* Кнопки мессенджеров */
.contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.contact {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.contact--tg {
  --brand: #229ed9;
}

.contact--wa {
  --brand: #25d366;
}

.contact--max {
  --brand: #4e40f2;
}

.contact__max {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  color: var(--brand);
}

.contacts--sm .contact__max {
  font-size: 9px;
}

.contacts--header {
  margin-right: 2px;
}

.contact svg {
  color: var(--brand, var(--accent));
  flex-shrink: 0;
}

.contact:hover {
  border-color: var(--brand, var(--accent));
  background: color-mix(in srgb, var(--brand, var(--accent)) 10%, var(--surface));
  transform: translateY(-2px);
}

.contacts--sm .contact {
  width: 42px;
  height: 42px;
  padding: 0;
  justify-content: center;
}

/* Согласие на обработку данных */
.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--fg-muted);
  cursor: pointer;
}

.checkbox input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.checkbox a {
  color: var(--accent-text);
  text-decoration: underline;
}

/* Состояния отправки заявки */
.form__status {
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: 14px;
  font-weight: 700;
}

.form__status[data-kind='error'] {
  background: color-mix(in srgb, #e5484d 14%, transparent);
  color: #b32328;
}

[data-theme='dark'] .form__status[data-kind='error'] {
  color: #ff9ea1;
}

.field input[aria-invalid='true'] {
  border-color: #e5484d;
}

/* Поле-ловушка для ботов: человек его не видит */
.form__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.lead-success {
  display: grid;
  justify-items: start;
  gap: 12px;
  padding: 30px;
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
}

.lead-success h3 {
  font-size: 26px;
  font-weight: 800;
}

.lead-success p {
  color: var(--fg-muted);
}

/* Правовые страницы */
.legal {
  padding-block: 64px 80px;
}

.legal h1 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  margin-bottom: 12px;
}

.legal h2 {
  font-size: 22px;
  font-weight: 800;
  margin-top: 38px;
  margin-bottom: 12px;
}

.legal p,
.legal li {
  color: var(--fg-muted);
  margin-bottom: 10px;
}

.legal li {
  padding-left: 18px;
  position: relative;
}

.legal li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.legal__fill {
  padding: 1px 8px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 700;
}

@media (max-width: 980px) {
  .grid--3,
  .grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-nav {
    display: none;
  }

  .contacts--header {
    display: none;
  }
}

@media (max-width: 720px) {
  :root {
    --section-gap: 68px;
  }

  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: minmax(0, 1fr);
  }

  .form__row {
    grid-template-columns: minmax(0, 1fr);
  }

  .callmock__tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact {
    flex: 1 1 auto;
    justify-content: center;
  }

  .contact-row {
    grid-template-columns: 116px minmax(0, 1fr) auto;
    gap: 6px;
  }

  .contact-row__type,
  .contact-row__value {
    padding: 13px 12px;
  }
}
