/* ==========================================================================
   Токены темы
   Светлая — по умолчанию; тёмная — по системной настройке или переключателю.
   ========================================================================== */
:root {
  color-scheme: light;
  --bg: #f7f4ef;
  --bg-soft: #efeae1;
  --surface: #ffffff;
  --text: #2b2a28;
  --heading: #2b2a28;
  --heading-weight: 500;
  --title-fit: 0.08;
  --label: #6b665e;
  --muted: #6b665e;
  --border: #e3ddd2;
  --accent: #56756a;
  --accent-hover: #476358;
  --accent-text: #ffffff;
  --accent-soft: #e3ece7;
  --switch-off: #d6d0c5;
  --switch-on: #56756a;
  --shadow: 0 10px 30px rgba(43, 42, 40, 0.08);
  --slide-1: radial-gradient(120% 140% at 85% 20%, #dfe9e3 0%, #eae3d6 55%, #f3eee6 100%);
  --slide-2: radial-gradient(120% 140% at 15% 80%, #e8ded2 0%, #efe9df 60%, #f6f2ec 100%);
  --slide-3: radial-gradient(120% 140% at 80% 80%, #e4e0ec 0%, #ece7e2 60%, #f5f2ee 100%);
  --slide-4: radial-gradient(120% 140% at 20% 20%, #dce8e8 0%, #e9e7df 60%, #f4f1eb 100%);

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --radius: 20px;
  --radius-sm: 12px;
  --container: 1160px;
  --gutter: 16px;
  --header-h: 72px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #222328;
    --bg-soft: #28292f;
    --surface: #2d2d35;
    --text: #e6e7ec;
    --heading: #ffffff;
    --heading-weight: 700;
    --title-fit: 0.071;
    --narrow-card-title: 0.93;
    --label: #ffffff;
    --muted: #cfd0d8;
    --border: #464753;
    --accent: #9fc0e8;
    --accent-hover: #b8d2f1;
    --accent-text: #0b0b0c;
    --accent-soft: #383944;
    --switch-off: #54555f;
    --switch-on: #9fc0e8;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    --slide-1: radial-gradient(120% 140% at 85% 20%, #464753 0%, #2d2d35 55%, #222328 100%);
    --slide-2: radial-gradient(120% 140% at 15% 80%, #464753 0%, #2d2d35 60%, #222328 100%);
    --slide-3: radial-gradient(120% 140% at 80% 80%, #464753 0%, #2d2d35 60%, #222328 100%);
    --slide-4: radial-gradient(120% 140% at 20% 20%, #464753 0%, #2d2d35 60%, #222328 100%);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #222328;
  --bg-soft: #28292f;
  --surface: #2d2d35;
  --text: #e6e7ec;
  --heading: #ffffff;
  --heading-weight: 700;
  --title-fit: 0.071;
  --narrow-card-title: 0.93;
  --label: #ffffff;
  --muted: #cfd0d8;
  --border: #464753;
  --accent: #9fc0e8;
  --accent-hover: #b8d2f1;
  --accent-text: #0b0b0c;
  --accent-soft: #383944;
  --switch-off: #54555f;
  --switch-on: #9fc0e8;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --slide-1: radial-gradient(120% 140% at 85% 20%, #464753 0%, #2d2d35 55%, #222328 100%);
  --slide-2: radial-gradient(120% 140% at 15% 80%, #464753 0%, #2d2d35 60%, #222328 100%);
  --slide-3: radial-gradient(120% 140% at 80% 80%, #464753 0%, #2d2d35 60%, #222328 100%);
  --slide-4: radial-gradient(120% 140% at 20% 20%, #464753 0%, #2d2d35 60%, #222328 100%);
}

/* ==========================================================================
   База
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  /* Быстрые нажатия не приближают страницу; масштаб двумя пальцами работает */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.3;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  overflow-x: clip;
  transition: background-color 0.25s ease, color 0.25s ease;
}

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

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

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

/* Длинные слова («конфиденциальности») не должны расширять страницу на узких экранах */
h1,
h2,
h3,
.h3 {
  overflow-wrap: break-word;
  font-family: var(--font-serif);
  font-weight: var(--heading-weight);
  line-height: 1.2;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
  color: var(--heading);
}

strong,
.faq summary,
.facts dd,
.footer__title,
.slide__actions-label {
  color: var(--heading);
}

h1 {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
}

/* «Конфиденциальности» в заголовке должно вмещаться целиком */
@media (max-width: 359px) {
  h1 {
    font-size: 1.7rem;
  }
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
}

h3,
.h3 {
  font-size: 1.3rem;
}

p {
  margin: 0 0 1em;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
}

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

.todo {
  background: var(--accent-soft);
  color: inherit;
  border-radius: 4px;
  padding: 0 4px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  background: var(--surface);
  color: var(--text);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.skip-link:focus {
  top: 12px;
}

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

/* ==========================================================================
   Кнопки
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-text);
}

.btn--primary:hover {
  background: var(--accent-hover);
  color: var(--accent-text);
}

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

.btn--outline:hover {
  border-color: var(--accent);
  color: var(--text);
}

.btn--sm {
  min-height: 40px;
  padding: 8px 18px;
  font-size: 0.95rem;
}

.btn svg {
  width: 20px;
  height: 20px;
  flex: none;
}

.link-button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ==========================================================================
   Шапка и навигация
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-h);
}

.logo {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  line-height: 1.15;
}

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

.logo__name {
  font-family: var(--font-serif);
  font-size: 1.3rem;
}

.logo__role {
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav__list {
  display: flex;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav__list a {
  color: var(--text);
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}

.nav__list a:hover,
.nav__list a[aria-current="page"] {
  border-bottom-color: var(--accent);
}

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

.nav-toggle {
  display: none;
}

/* Переключатель темы в стиле iOS */
.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.theme-switch__track {
  position: relative;
  width: 51px;
  height: 31px;
  border-radius: 999px;
  background: var(--switch-off);
  transition: background-color 0.25s ease;
  flex: none;
}

.theme-switch__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  display: grid;
  place-items: center;
  color: #8a8478;
  transition: transform 0.25s cubic-bezier(0.3, 0.7, 0.4, 1);
}

.theme-switch__thumb svg {
  width: 15px;
  height: 15px;
}

.theme-switch__moon {
  display: none;
}

.theme-switch[aria-checked="true"] .theme-switch__track {
  background: var(--switch-on);
}

.theme-switch[aria-checked="true"] .theme-switch__thumb {
  transform: translateX(20px);
  color: #2c4a75;
}

.theme-switch[aria-checked="true"] .theme-switch__sun {
  display: none;
}

.theme-switch[aria-checked="true"] .theme-switch__moon {
  display: block;
}

.theme-switch__label {
  display: none;
}

/* Копия навигации под слайдером на главной */
.hero-nav {
  padding-top: 14px;
}

@media (max-width: 900px) {
  .hero-nav {
    display: none;
  }
}

.hero-nav__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 28px;
}

.hero-nav__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero-nav__list a {
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  color: var(--text);
  text-decoration: none;
}

.hero-nav__list a:hover,
.hero-nav__list a[aria-current="page"] {
  border-bottom-color: var(--accent);
}

.hero-nav__actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

html:not(.js) .theme-switch--hero {
  display: none;
}

/* Копия переключателя в шапке — только на мобилке, рядом с бургером */
.theme-switch--bar {
  display: none;
}

@media (max-width: 900px) {
  .js .theme-switch--bar {
    display: inline-flex;
    margin-left: auto;
  }

  .js .theme-switch--nav {
    display: none;
  }

  .js .nav-toggle {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
  }

  .nav-toggle__bar,
  .nav-toggle__bar::before,
  .nav-toggle__bar::after {
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.2s ease, background-color 0.2s ease;
  }

  .nav-toggle__bar {
    position: relative;
  }

  .nav-toggle__bar::before,
  .nav-toggle__bar::after {
    content: "";
    position: absolute;
    left: 0;
  }

  .nav-toggle__bar::before {
    top: -6px;
  }

  .nav-toggle__bar::after {
    top: 6px;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle__bar {
    background: transparent;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle__bar::before {
    transform: translateY(6px) rotate(45deg);
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle__bar::after {
    transform: translateY(-6px) rotate(-45deg);
  }

  .header__inner {
    flex-wrap: wrap;
    column-gap: 12px;
  }

  .theme-switch--bar,
  .nav-toggle {
    flex: none;
  }

  .site-nav {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding-bottom: 16px;
  }

  .js .site-nav {
    display: none;
  }

  .js .site-header.is-open .site-nav {
    display: flex;
  }

  .nav__list {
    flex-direction: column;
    gap: 0;
  }

  .nav__list a {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 1.1rem;
  }

  .nav__list a[aria-current="page"] {
    color: var(--accent);
    border-bottom-color: var(--border);
  }

  .nav__actions {
    justify-content: space-between;
  }
}

/* Узкие телефоны (iPhone SE и т.п.): логотип, тумблер и бургер — в одну строку */
@media (max-width: 360px) {
  .logo__name {
    font-size: 1.15rem;
  }
}

/* ==========================================================================
   Слайдер на главной
   ========================================================================== */
/* Боковой зазор растёт с шириной экрана: 16px на телефоне, до 48px на десктопе */
.hero {
  padding: 20px max(clamp(var(--gutter), 3.5vw, 48px), env(safe-area-inset-right)) 0 max(clamp(var(--gutter), 3.5vw, 48px), env(safe-area-inset-left));
}

.slider {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
  touch-action: pan-y;
}

.slider__track {
  position: relative;
  display: flex;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* На широком экране слайд во всю ширину и на 20% ниже фото: картинка
   заполняет его без искажений (чуть подрезается сверху и снизу), текст —
   поверх светлой левой части. На узком — фото сверху целиком, текст под ним. */
.slide {
  flex: 0 0 100%;
  /* Слайд никогда не шире слайдера, даже если в тексте очень длинное слово:
     иначе он растягивается и наезжает на соседний. (overflow: hidden здесь нельзя —
     на ПК он отключает рост слайда под длинный текст, и текст обрезается) */
  min-width: 0;
  display: grid;
  background: var(--bg-soft);
}

.slide__image {
  grid-area: 1 / 1;
  width: 100%;
  height: auto;
  /* Единая рамка для фото разных пропорций; лишнее срезается со стороны пустой стены */
  aspect-ratio: 1671 / 941;
  object-fit: cover;
  object-position: 70% 30%;
}

.slide__content {
  grid-area: 1 / 1;
  position: relative;
  z-index: 1;
  align-self: center;
  max-width: min(48%, 620px);
  padding: 32px 0 56px clamp(24px, 7vw, 104px);
  color: var(--text);
  /* Слово без пробелов длиннее строки (ссылка, опечатка) переносится по буквам;
     обычный текст по-прежнему переносится по словам. Кнопок это не касается —
     надписи на них не должны рваться посреди слова */
  overflow-wrap: anywhere;
}

.slide__actions {
  overflow-wrap: normal;
}

.slide__content h1,
.slide__content h2 {
  font-size: clamp(1.5rem, 2.6vw, 2.5rem);
}

.slide__line {
  white-space: nowrap;
}

/* На узких телефонах заголовок ужимается, чтобы первая строка не переносилась
   (слайды с настройкой «первая строка без переноса» в админке) */
@media (max-width: 420px) {
  .slide--fit .slide__content h1,
  .slide--fit .slide__content h2 {
    font-size: min(1.5rem, calc((100vw - 74px) * var(--title-fit)));
  }
}

@media (min-width: 901px) {
  /* Фото светлое в любой теме — текст на нём всегда тёмный */
  .slide {
    --text: #2b2a28;
    --heading: #2b2a28;
    --muted: #514b43;
    --border: rgba(43, 42, 40, 0.25);
  }

  /* На 20% ниже пропорций фото (941 × 0.8 ≈ 753). Если тексту не хватает
     места, слайд вырастет, и фото заполнит его целиком. */
  .slide {
    position: relative;
    aspect-ratio: 1671 / 753;
  }

  .slide__image {
    position: absolute;
    inset: 0;
    height: 100%;
    aspect-ratio: auto;
    object-fit: cover;
    /* держим в кадре лицо и фигуру */
    object-position: 60% 35%;
  }

  .slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(247, 244, 239, 0.88) 0%, rgba(247, 244, 239, 0.6) 32%, rgba(247, 244, 239, 0) 58%);
  }

  .slide__content .btn--outline {
    background: rgba(255, 255, 255, 0.55);
  }

  /* Настройка слайда «скрыть текст на ПК» */
  .slide--hide-text-pc .slide__text {
    display: none;
  }
}

@media (max-width: 900px) {
  .slide {
    display: flex;
    flex-direction: column;
  }

  /* Слайды одной высоты: разницу забирает фото, чтобы у коротких не было пустоты */
  .slide__image {
    flex: 1 1 auto;
    min-height: 0;
  }

  .slide__content {
    flex: none;
    max-width: none;
    padding: 17px 21px 69px;
  }

  .slide__eyebrow {
    margin-bottom: 8px;
    font-size: 0.75rem;
  }

  .slide__text {
    font-size: 1rem;
    margin-bottom: 0;
  }

  /* Настройка слайда «скрыть текст на телефоне» */
  .slide--hide-text-phone .slide__text {
    display: none;
  }

}

.slide__eyebrow {
  display: inline-block;
  margin-bottom: 16px;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.slide__text {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 520px;
}

.slide__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

/* Первый слайд: подпись над кнопками связи */
.slide__actions-label {
  margin: 20px 0 0;
  font-weight: 600;
}

/* Под подписью кнопки ближе — для любых кнопок, не только мессенджеров */
.slide__actions-label + .slide__actions {
  margin-top: 10px;
}

/* Кнопки всех способов связи: первый слайд и блоки призыва к записи */
.contact-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: min(100%, 420px);
}

.contact-buttons .btn {
  padding-left: 8px;
  padding-right: 8px;
}

/* Кнопка мессенджера рядом с обычными кнопками — того же размера, что плитка
   в блоке 2 × 2 (половина от min(100%, 420px) за вычетом промежутка 8px) */
.slide__actions:not(.contact-buttons) .btn[data-goal] {
  flex: 0 0 calc((min(100%, 420px) - 8px) / 2);
  padding-left: 8px;
  padding-right: 8px;
}

@media (max-width: 900px) {
  .slide__actions {
    margin-top: 12px;
  }

  .slide__actions-label {
    margin-top: 12px;
  }

  .slide__actions-label + .slide__actions {
    margin-top: 6px;
  }
}

.slider__arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-top: -26px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.slider__arrow:hover {
  background: var(--surface);
  transform: scale(1.05);
}

.slider__arrow svg {
  width: 22px;
  height: 22px;
}

.slider__arrow--prev {
  left: 20px;
}

.slider__arrow--next {
  right: 20px;
}

.slider__dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 24px;
  display: flex;
  justify-content: center;
  gap: 4px;
}

.slider__dot {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.slider__dot::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--muted);
  opacity: 0.4;
  transition: width 0.3s ease, opacity 0.3s ease;
}

.slider__dot[aria-current="true"]::before {
  width: 26px;
  opacity: 1;
  background: var(--accent);
}

@media (min-width: 901px) {
  /* Точки лежат на фото — светлые, с лёгкой тенью для контраста */
  .slider__dot::before {
    background: #ffffff;
    opacity: 0.6;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  }

  .slider__dot[aria-current="true"]::before {
    background: #ffffff;
    opacity: 1;
  }
}

@media (max-width: 900px) {
  .slider__arrow {
    top: auto;
    bottom: 12px;
    margin-top: 0;
    width: 44px;
    height: 44px;
  }

  /* Стрелки по бокам от точек — правый край занят кнопками связи */
  .slider__arrow--prev {
    left: calc(50% - 120px);
  }

  .slider__arrow--next {
    right: calc(50% - 120px);
  }

  .slider__dots {
    bottom: 20px;
  }
}

/* ==========================================================================
   Секции и карточки
   ========================================================================== */
.section {
  padding: clamp(28px, 4.5vw, 52px) 0;
}

@media (min-width: 901px) {
  .section {
    padding: clamp(20px, 2.25vw, 26px) 0;
  }
}

/* Дипломы и сертификаты: снизу вдвое меньше обычного */
.section--certs {
  padding-bottom: clamp(14px, 2.25vw, 26px);
}

@media (min-width: 901px) {
  .section--certs {
    padding-bottom: clamp(10px, 1.125vw, 13px);
  }
}

/* Блок записи: отступы сверху и снизу дают соседняя секция и футер */
.section--cta {
  padding: 0;
}

.section--soft {
  background: var(--bg-soft);
}

.section__head {
  max-width: 680px;
  margin-bottom: 20px;
}

.section__head p {
  color: var(--muted);
  font-size: 1.1rem;
}

.icon-inline {
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  vertical-align: -0.22em;
  color: var(--accent);
}

.page-head {
  padding: clamp(20px, 3.5vw, 40px) 0 8px;
}

.page-head p {
  max-width: 680px;
  font-size: 1.15rem;
  color: var(--muted);
}

.phones {
  display: grid;
  gap: 14px;
  margin: 16px 0 0;
  font-size: 1.15rem;
}

.phones dt {
  color: var(--muted);
}

.phones dd {
  margin: 0;
}

/* Номер для мессенджеров не ссылка, поэтому серый */
.phones dd > span,
.story p > span.nowrap,
.footer__links li > span {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 10px 20px;
}

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

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

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

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

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

.nowrap {
  white-space: nowrap;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.card p:last-child {
  margin-bottom: 0;
}

/* Узкий ПК — три карточки в ряд (901–1000 px): в тёмной теме заголовки жирнее, и длинное слово
   («профориентирование») не помещалось в карточку и рвалось посередине. Там заголовки карточек
   чуть меньше; в светлой теме --narrow-card-title не задан, и ничего не меняется */
/* Граница — ровно там, где сетка становится трёхколоночной (у Firefox ширина бывает дробной, 900,5) */
@media not all and (max-width: 900px) {
  @media (max-width: 1000px) {
    .grid--3 .card h3 {
      font-size: calc(1.3rem * var(--narrow-card-title, 1));
    }
  }
}

.card__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
}

.card__icon svg {
  width: 24px;
  height: 24px;
}

.service {
  display: flex;
  flex-direction: column;
}

.service__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 8px 0 20px;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Длительность и цена прижаты к низу — во всех карточках на одном уровне */
.service__meta {
  margin-top: auto;
}

/* Длинное описание открывается стрелкой; анимация включается с первым нажатием */
.service__toggle {
  margin-left: auto;
}

.service__more {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: -8px 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
}

.service__more[hidden] {
  display: none;
}

.service__more svg {
  width: 20px;
  height: 20px;
}

.service.is-animated .service__more svg {
  transition: transform 0.35s ease;
}

.service.is-open .service__more svg {
  transform: rotate(180deg);
}

/* 5 строк на телефоне, 4 на компьютере; открытую высоту ставит main.js */
.js .service__desc {
  --desc-lines: 5;
  max-height: calc(1.3em * var(--desc-lines));
  overflow: hidden;
  line-height: 1.3;
}

@media (min-width: 901px) {
  .js .service__desc {
    --desc-lines: 4;
  }
}

/* Многоточие в конце обрезанного текста; пока идёт анимация, его нет */
.js .service__desc.is-clamped {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--desc-lines);
}

.service.is-animated .service__desc {
  transition: max-height 0.35s ease;
}

@media (prefers-reduced-motion: reduce) {
  .service.is-animated .service__desc,
  .service.is-animated .service__more svg {
    transition: none;
  }
}

.service__price {
  margin-bottom: 0;
  font-family: var(--font-serif);
  font-size: 1.5rem;
}

/* Зачёркнутая обычная цена рядом со скидочной */
.price-old {
  color: var(--muted);
}

.service__price .price-old {
  font-size: 0.75em;
}

/* Значок «скидка N%»: в карточке услуги и в любом тексте, где скидка записана как «5000 ₽ {50%}» */
.service__save,
.price-save {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.service__usd {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--muted);
}

/* Пакеты консультаций */
.package {
  display: flex;
  flex-direction: column;
}

.package__name {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--label);
}

.package__price {
  margin: 4px 0 8px;
  font-family: var(--font-serif);
  font-size: 2.75rem;
  line-height: 1.1;
}

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

.package__per s {
  opacity: 0.8;
}

.package__save {
  align-self: flex-start;
  margin-top: auto;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
}

.package--deal {
  border-color: var(--accent);
}

.steps {
  counter-reset: step;
  display: grid;
  gap: 10px 20px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 28px;
  padding-top: 76px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.steps li::before {
  content: counter(step);
  position: absolute;
  top: 24px;
  left: 28px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
}

.steps h3 {
  font-size: 1.15rem;
}

.steps p {
  margin: 0;
  color: var(--muted);
}

.cta-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(28px, 5vw, 56px);
  border-radius: var(--radius);
  background: var(--accent-soft);
}

.cta-band h2 {
  margin: 0 0 8px;
}

.cta-band p {
  margin: 0;
  color: var(--muted);
}

/* FAQ */
.faq {
  max-width: 820px;
}

.faq details {
  border-bottom: 1px solid var(--border);
}

.faq summary {
  position: relative;
  padding: 20px 40px 20px 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

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

.faq summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--accent);
  transition: transform 0.2s ease;
}

.faq details[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
}

.faq details p {
  margin: 0 0 20px;
  color: var(--muted);
}

/* ==========================================================================
   Обо мне
   ========================================================================== */
.about {
  display: grid;
  gap: clamp(14px, 2.5vw, 32px) clamp(28px, 5vw, 64px);
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: start;
}

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

.photo-placeholder {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  background: var(--slide-1);
  border: 1px dashed var(--border);
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

.facts {
  display: grid;
  gap: 8px 16px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  margin: 28px 0 0;
}

.facts div {
  padding: 20px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
}

.facts dt {
  font-size: 0.85rem;
  color: var(--muted);
}

.facts dd {
  margin: 4px 0 0;
  font-weight: 600;
}

/* Бесконечная карусель (отзывы, сертификаты).
   --per-view — сколько карточек видно одновременно. */
.carousel {
  --per-view: 3;
  --gap: 20px;
}

.carousel--certs {
  --per-view: 4;
}

@media (max-width: 1000px) {
  .carousel,
  .carousel--certs {
    --per-view: 2;
  }
}

@media (max-width: 600px) {
  .carousel,
  .carousel--certs {
    --per-view: 1.15;
  }
}

.carousel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0 24px;
}

.carousel__viewport {
  overflow: hidden;
  touch-action: pan-y;
}

.carousel__track {
  position: relative;
  display: flex;
  gap: var(--gap);
  margin: 0;
  padding: 0;
  list-style: none;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel__item {
  flex: 0 0 calc((100% - (var(--per-view) - 1) * var(--gap)) / var(--per-view));
  display: flex;
}

.carousel__item > * {
  flex: 1;
}

.review {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.review__stars {
  color: #d6a64b;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.review__text {
  margin: 0 0 20px;
}

.review__author {
  margin-top: auto;
  font-size: 0.95rem;
}

.reviews__more {
  margin: 32px 0 0;
}

.cert {
  margin: 0;
}

/* Все документы — в одинаковых рамках 4:3, скан целиком и по центру */
.cert__open {
  display: block;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: zoom-in;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cert__open:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.cert__image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
}

.cert figcaption {
  margin-top: 12px;
  font-size: 0.95rem;
  line-height: 1.2;
}

/* Фото на странице «Обо мне» */
.about__photo {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
}

.about__photo img {
  /* Чуть шире рамки: у исходного снимка справа узкая белая полоса */
  width: 104%;
  max-width: none;
  height: 100%;
  object-fit: cover;
  object-position: left 30%;
}

/* Просмотр документа */
.lightbox {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 24px 80px;
  border: 0;
  background: transparent;
  color: var(--text);
}

.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* В тёмной теме — цвет основного фона, в светлой — прозрачный серый.
   В ::backdrop старые браузеры не видят переменные, поэтому цвета заданы явно */
.lightbox::backdrop {
  background: rgba(34, 35, 40, 0.94);
}

:root[data-theme="light"] .lightbox::backdrop {
  background: rgba(70, 70, 70, 0.75);
}

:root[data-theme="light"] .lightbox__caption {
  color: #ffffff;
}

/* Начальный фокус окна — на документе, а не на кнопке «×» (иначе Safari сразу рисует кольцо) */
.lightbox__figure:focus {
  outline: none;
}

.lightbox__figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  max-height: 100%;
}

.lightbox__image {
  max-width: 100%;
  max-height: calc(100vh - 120px);
  max-height: calc(100dvh - 120px);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox__caption {
  text-align: center;
  font-size: 1rem;
  max-width: 800px;
}

.lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox__close:hover {
  background: var(--accent-soft);
}

.lightbox__arrow {
  top: 50%;
}

.lightbox__arrow--prev {
  left: 16px;
}

.lightbox__arrow--next {
  right: 16px;
}

@media (max-width: 700px) {
  .lightbox {
    padding: 72px 12px 88px;
  }

  .lightbox__image {
    max-height: calc(100vh - 220px);
    max-height: calc(100dvh - 220px);
  }

  .lightbox__arrow {
    top: auto;
    bottom: 20px;
    margin-top: 0;
  }

  .lightbox__arrow--prev {
    left: calc(50% - 60px);
  }

  .lightbox__arrow--next {
    right: calc(50% - 60px);
  }
}

.carousel__controls {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.carousel__controls .slider__arrow {
  position: static;
  margin: 0;
  width: 44px;
  height: 44px;
  box-shadow: none;
}


/* ==========================================================================
   Контакты
   ========================================================================== */
.contact-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contact-card p {
  margin-bottom: 20px;
}

/* Кнопки прижаты к низу карточки, чтобы стоять на одном уровне при любом объёме текста */
.contact-card .btn {
  margin-top: auto;
  align-self: flex-start;
}

/* На телефоне карточки становятся кнопками 2×2, нажимается вся кнопка */
@media (max-width: 700px) {
  .contact-grid {
    grid-template-columns: repeat(2, 131px);
    justify-content: center;
    gap: 10px;
  }

  .contact-card {
    position: relative;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 15px 5px;
    border-color: transparent;
    background: var(--accent);
    color: var(--accent-text);
    text-align: center;
    transition: transform 0.15s ease;
  }

  .contact-card:active {
    transform: scale(0.97);
  }

  .contact-card .card__icon {
    width: 73px;
    height: 73px;
    margin: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    color: inherit;
  }

  .contact-card .card__icon svg {
    width: 39px;
    height: 39px;
  }

  .contact-card .h3 {
    margin: 0;
    color: inherit;
    font-size: 1.15rem;
  }

  .contact-card p {
    display: none;
  }

  .contact-card .btn {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: inherit;
    background: none;
    color: transparent;
    font-size: 0;
    transform: none;
  }

  .contact-card .btn:focus-visible {
    outline: 3px solid var(--accent-text);
    outline-offset: -6px;
  }
}

/* ==========================================================================
   Текстовые страницы (политика)
   ========================================================================== */
.prose {
  max-width: 760px;
}

.prose h2 {
  font-size: 1.5rem;
  margin-top: 2em;
}

.prose ul {
  padding-left: 1.25em;
}

.prose li {
  margin-bottom: 0.4em;
}

.story h2:first-child {
  margin-top: 0;
}

.story .contact-buttons {
  margin-top: 16px;
}

.story__phone {
  font-weight: 600;
}

.about__lead {
  font-size: clamp(1.4rem, 2.5vw, 1.8rem);
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin-bottom: 1em;
}

.prose th,
.prose td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

/* ==========================================================================
   Статьи
   ========================================================================== */
.article-list {
  gap: 20px;
}

/* Вся карточка — ссылка: ссылка заголовка растянута на карточку */
.article-card {
  position: relative;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.article-card:hover,
.article-card:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.article-card__link {
  color: inherit;
  text-decoration: none;
}

.article-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.article-card__link:focus-visible {
  outline: none;
}

.article-card:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.article-card__meta,
.article__meta {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 0.6em;
}

.article-card .muted {
  overflow-wrap: break-word;
}

.article-card__more {
  margin-top: auto;
  padding-top: 4px;
  color: var(--accent);
  font-weight: 600;
}

.article-back {
  margin-bottom: 0.8em;
}

.article-back a {
  text-decoration: none;
}

.article-head h1 {
  margin-bottom: 0.3em;
}

.notice-draft {
  display: inline-block;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--heading);
  font-size: 0.95rem;
}

/* Текст статьи: длинная ссылка или слово не расширяют страницу */
.article {
  overflow-wrap: break-word;
  font-size: 1.08rem;
  line-height: 1.7;
}

.article h2 {
  margin-top: 1.6em;
}

.article h3 {
  margin-top: 1.4em;
}

.article > :first-child {
  margin-top: 0;
}

.article ol {
  padding-left: 1.4em;
}

.article blockquote {
  margin: 1.4em 0;
  padding: 14px 20px;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--bg-soft);
  font-family: var(--font-serif);
  font-size: 1.12rem;
  color: var(--heading);
}

/* ==========================================================================
   Подвал
   ========================================================================== */
.site-footer {
  margin-top: clamp(28px, 4.5vw, 52px);
  padding: 48px 0 32px;
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  font-size: 0.95rem;
}

@media (min-width: 901px) {
  .site-footer {
    margin-top: clamp(20px, 2.25vw, 26px);
  }
}

/* Колонки прижаты влево: справа остаётся место для облачка «Написать» */
.footer__grid {
  display: grid;
  gap: 32px clamp(24px, 3vw, 48px);
  grid-template-columns: minmax(180px, 250px) auto auto;
  justify-content: start;
}

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

.footer__title {
  font-weight: 600;
  margin-bottom: 8px;
}

.footer__links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer__links li {
  margin-bottom: 6px;
}

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

.footer__links a:hover {
  color: var(--accent);
}

.footer__legal {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

.footer__legal p {
  margin-bottom: 8px;
}

/* ==========================================================================
   Облачко «Написать» (правый нижний угол, на всех страницах):
   прижато к краю экрана, по нажатию выезжает меню со способами связи
   ========================================================================== */
.fab {
  display: none;
}

.js .fab {
  position: fixed;
  right: 0;
  bottom: 0;
  z-index: 55;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.fab__toggle {
  position: relative;
  z-index: 1;
  padding: 18px calc(22px + env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) 26px;
  border: 0;
  border-radius: 28px 0 0 0;
  pointer-events: auto;
  background: var(--accent);
  color: var(--accent-text);
  box-shadow: var(--shadow);
  font: inherit;
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.fab__toggle:hover {
  background: var(--accent-hover);
}

.fab__menu {
  display: flex;
  flex-direction: column;
  padding: 8px calc(8px + env(safe-area-inset-right)) 8px 8px;
  border-radius: 20px 0 0 20px;
  pointer-events: auto;
  background: var(--accent);
  box-shadow: var(--shadow);
  visibility: hidden;
  transform: translateX(100%);
}

/* Анимация только после первого нажатия, иначе Safari проигрывает её при загрузке */
.fab.is-animated .fab__menu {
  transition: transform 0.25s ease, visibility 0.25s;
}

.fab.is-open .fab__menu {
  visibility: visible;
  transform: none;
}

.fab__link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 8px 20px 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--accent-text);
  font-weight: 600;
  text-decoration: none;
}

.fab__link:hover {
  background: var(--accent-hover);
  color: var(--accent-text);
}

.fab__link svg {
  flex: none;
  width: 22px;
  height: 22px;
}

/* На компьютере: в полтора раза крупнее и выше панели задач Windows и Dock на Mac */
@media (min-width: 901px) {
  .js .fab {
    bottom: 72px;
  }

  .fab__toggle {
    padding: 27px 33px 27px 39px;
    border-radius: 40px 0 0 40px;
    font-size: 1.95rem;
  }

  .fab__menu {
    width: 100%;
    padding: 12px 12px 12px 12px;
    border-radius: 30px 0 0 30px;
  }

  .fab__link {
    gap: 16px;
    min-height: 66px;
    padding: 12px 24px 12px 18px;
    border-radius: 18px;
    font-size: 1.5rem;
  }

  .fab__link svg {
    width: 33px;
    height: 33px;
  }
}

/* ==========================================================================
   Плашка cookie
   ========================================================================== */
.cookie-banner {
  position: fixed;
  left: max(var(--gutter), env(safe-area-inset-left));
  right: max(var(--gutter), env(safe-area-inset-right));
  bottom: calc(var(--gutter) + env(safe-area-inset-bottom));
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 640px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  line-height: 1.25;
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-banner p {
  margin: 0;
}

.cookie-banner__actions {
  display: flex;
  flex: none;
  gap: 8px;
}

@media (max-width: 520px) {
  .cookie-banner__actions .btn {
    flex: 1;
  }
}

@media (max-width: 520px) {
  .cookie-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
}

/* ==========================================================================
   Уменьшение анимации
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* Ряд кнопок на служебных страницах (404) */
.page-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

/* ==========================================================================
   Отзывы: отзывы с сайта над лентой BrainBild и окно «Написать отзыв»
   ========================================================================== */
.reviews__head {
  margin-bottom: 8px;
}

.reviews__write {
  margin-top: 4px;
}

.reviews-site {
  margin-top: 24px;
}

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

.reviews-grid > li {
  display: flex;
}

.reviews-grid > li > * {
  flex: 1;
}

.reviews-bb {
  margin-top: 40px;
}

.reviews-site h3,
.reviews-bb h3 {
  margin: 0;
  font-size: 1.25rem;
}

.review__text p + p {
  margin-top: 0.6em;
}

.review-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.review-dialog::backdrop {
  background: rgba(34, 35, 40, 0.6);
}

.review-form {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.review-form h2 {
  margin: 0;
  font-size: 1.5rem;
}

.review-form__note {
  margin: -8px 0 0;
}

.review-form__stars {
  margin: 0;
  padding: 0;
  border: 0;
}

.review-form__stars legend,
.review-form__field > span:first-child {
  margin-bottom: 6px;
  font-weight: 600;
}

.review-form__req {
  color: #c0533f;
}

.stars {
  display: flex;
  gap: 4px;
}

.stars__star {
  position: relative;
  font-size: 2rem;
  line-height: 1;
  color: var(--border);
  cursor: pointer;
}

.stars__star input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.stars__star.is-on {
  color: #d6a64b;
}

.stars__star:has(input:focus-visible) {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.review-form__field {
  display: grid;
  gap: 4px;
}

.review-form__input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.review-form__input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.review-form__input[aria-invalid="true"] {
  border-color: #c0533f;
}

textarea.review-form__input {
  resize: vertical;
}

.review-form__consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.95rem;
}

.review-form__consent input {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--accent);
}

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

.review-form__error {
  margin: 0;
  color: #c0533f;
  font-weight: 600;
}

.review-form__error:empty {
  display: none;
}

.review-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.review-form__done[hidden] {
  display: none;
}

/* Крестик в окне отзыва */
.review-dialog {
  position: relative;
}

.review-dialog__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0 0 3px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.review-dialog__close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.review-dialog__close:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Заголовок не заезжает под крестик */
.review-form h2 {
  padding-right: 48px;
}
