/* =========================================================
   ДОСААФ Магнитогорск — стили лендинга
   Макет: десктоп 1440, мобильный 390
   ========================================================= */

:root {
  --primary: #223E7F;
  --primary-hover: #2E4F9A;
  --primary-active: #1A3168;
  --primary-border: #3A5598;
  --text: #020A14;
  --gray: #8F9297;
  --label: #BBC3D5;
  --line: #D9DBDC;
  --bg: #FCFDFD;
  --white: #FFFFFF;
  --dark-badge: #252726;

  --radius-xl: 24px;
  --radius-l: 16px;
  --radius-m: 12px;
  --radius-s: 8px;

  --shadow-card: 0 12px 32px rgba(34, 62, 127, .08);
  --shadow-card-hover: 0 22px 48px rgba(34, 62, 127, .16);

  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-io: cubic-bezier(.77, 0, .18, 1);

  --gutter: 40px;
  --section-gap: 64px;
  --header-h: 116px;

  --font: "Fira Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.2;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, p, dl, dd, figure { margin: 0; }
em { font-style: italic; font-weight: 600; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }

.ico { width: 20px; height: 20px; flex: none; fill: currentColor; display: block; }

.container {
  width: 100%;
  max-width: calc(1360px + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.container--narrow { max-width: calc(1280px + 80px * 2); padding: 0 80px; }
.text-center { text-align: center; }

.section { padding-top: var(--section-gap); }

/* ---------- Typography ---------- */
.eyebrow {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .5em;
  text-transform: uppercase;
  color: var(--label);
  text-align: center;
  margin-bottom: 40px;
}
.eyebrow--left { text-align: left; }
.h1 { font-size: 32px; line-height: 1.2; font-weight: 500; }
.h2 { font-size: 24px; line-height: 29px; font-weight: 600; }
.lead { font-size: 16px; margin-top: 20px; }
.link {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: rgba(34, 62, 127, .45);
  text-underline-offset: 2px;
  transition: color .25s var(--ease), text-decoration-color .25s var(--ease);
}
.link:hover { color: var(--primary-hover); text-decoration-color: currentColor; }

/* ---------- Buttons ---------- */
.btn {
  --h: 44px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: var(--h);
  padding: 0 20px;
  border-radius: var(--radius-s);
  border: 1px solid transparent;
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease),
              transform .15s var(--ease);
  /* слой создаётся сразу, чтобы текст не «прыгал» при старте анимации (Safari) */
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.btn .ico { transition: color .3s var(--ease); }
.btn::before, .btn::after { will-change: transform; }
.btn:active { transform: translateZ(0) scale(.98); }

.btn--primary {
  background: var(--primary);
  border-color: var(--primary-border);
  color: var(--white);
}
/* блик, пробегающий по кнопке при наведении */
.btn--primary::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .22) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .7s var(--ease);
}
.btn--primary:hover { background: var(--primary-hover); }
.btn--primary:hover::after { transform: translateX(120%); }
.btn--primary:active { background: var(--primary-active); }

.btn--outline {
  color: var(--text);
  border-color: var(--primary);
  background: transparent;
}
.btn--outline .ico { color: var(--primary); }
.btn--outline::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s var(--ease);
}
.btn--outline:hover { color: var(--white); }
.btn--outline:hover::before { transform: scaleX(1); }
.btn--outline:hover .ico { color: var(--white); }

.btn--sm { padding: 0 16px; }
.btn--sm.header__phone { font-size: 15px; }
.btn--lg { --h: 44px; font-size: 18px; }
.btn--block { display: flex; width: 100%; }
.btn--cta { gap: 12px; }

.round-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .3s var(--ease), background-color .3s var(--ease), box-shadow .3s var(--ease), color .3s var(--ease);
}
.round-btn .ico { width: 22px; height: 22px; }
.round-btn--primary { background: var(--primary); color: var(--white); box-shadow: 0 4px 12px rgba(34, 62, 127, .3); }
.round-btn--primary:hover { background: var(--primary-hover); transform: scale(1.06); }
.round-btn--outline { border: 1.5px solid var(--primary); color: var(--primary); }
.round-btn--outline:hover { background: var(--primary); color: var(--white); }
.round-btn--ghost { border: 1.5px solid rgba(255, 255, 255, .75); color: #C9CDD6; }
.round-btn--ghost:hover { background: rgba(255, 255, 255, .12); color: var(--white); }

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background-color .35s var(--ease), box-shadow .35s var(--ease), backdrop-filter .35s;
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 20px;
  padding-bottom: 24px;
  transition: padding .35s var(--ease);
}
.header__logo img { width: 204px; height: 72px; transition: width .35s var(--ease), height .35s var(--ease); }
.header__logo { flex: none; transition: opacity .25s; }
.header__logo:hover { opacity: .85; }

.header.is-scrolled {
  background: rgba(252, 253, 253, .85);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: 0 6px 24px rgba(2, 10, 20, .06);
}
.header.is-scrolled .header__inner { padding-top: 10px; padding-bottom: 10px; }
.header.is-scrolled .header__logo img { width: 159px; height: 56px; }

.nav { display: flex; gap: 80px; margin-left: 40px; }
.nav__link {
  position: relative;
  font-size: 16px;
  font-weight: 400;
  padding: 6px 0;
  transition: color .25s var(--ease);
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transition: transform .35s var(--ease);
}
.nav__link:hover, .nav__link.is-active { color: var(--primary); }
.nav__link:hover::after, .nav__link.is-active::after { transform: scaleX(1); }

.header__actions { display: flex; align-items: center; gap: 12px; }
.header__phone-m, .burger { display: none; }

/* burger */
.burger__lines { position: relative; width: 20px; height: 14px; display: block; }
.burger__lines span {
  position: absolute; left: 0; width: 100%; height: 2px; border-radius: 2px; background: currentColor;
  transition: transform .35s var(--ease), opacity .2s, top .35s var(--ease);
}
.burger__lines span:nth-child(1) { top: 0; }
.burger__lines span:nth-child(2) { top: 6px; }
.burger__lines span:nth-child(3) { top: 12px; }
.burger__lines.is-open span:nth-child(1) { top: 6px; transform: rotate(45deg); }
.burger__lines.is-open span:nth-child(2) { opacity: 0; }
.burger__lines.is-open span:nth-child(3) { top: 6px; transform: rotate(-45deg); }

/* ---------- Mobile menu ---------- */
.mmenu {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: rgba(18, 20, 24, .88);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  color: var(--white);
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s var(--ease), visibility 0s .4s;
}
.mmenu.is-open { opacity: 1; visibility: visible; transition: opacity .4s var(--ease), visibility 0s; }
.mmenu__head { display: flex; justify-content: space-between; align-items: center; padding-top: 16px; padding-bottom: 16px; }
.mmenu__head .header__logo img { width: 159px; height: 56px; }
.mmenu__nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding-bottom: 40px;
}
.mmenu__nav a, .mmenu__divider {
  font-size: 24px;
  font-weight: 300;
  letter-spacing: .02em;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .45s var(--ease), transform .45s var(--ease), color .25s;
}
.mmenu__nav a:hover { color: var(--label); }
.mmenu__divider { width: 40px; height: 1px; background: rgba(255, 255, 255, .5); }
.mmenu.is-open .mmenu__nav > * { opacity: 1; transform: none; }
.mmenu.is-open .mmenu__nav > *:nth-child(1) { transition-delay: .08s; }
.mmenu.is-open .mmenu__nav > *:nth-child(2) { transition-delay: .13s; }
.mmenu.is-open .mmenu__nav > *:nth-child(3) { transition-delay: .18s; }
.mmenu.is-open .mmenu__nav > *:nth-child(4) { transition-delay: .23s; }
.mmenu.is-open .mmenu__nav > *:nth-child(5) { transition-delay: .28s; }
.mmenu.is-open .mmenu__nav > *:nth-child(6) { transition-delay: .33s; }
.mmenu__bottom { padding: 0 31px 40px; }
.mmenu__close { box-shadow: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 650px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: #0b0b0c;
  color: var(--white);
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(708px, 56%);
  grid-template-rows: 1fr auto;
  column-gap: 40px;
  padding: 44px 40px 40px;
}
.hero__bg, .hero__bg img {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.hero__bg img { object-fit: cover; object-position: center; animation: heroZoom 1.8s var(--ease) both; }
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, .35) 0%, rgba(0, 0, 0, 0) 55%);
  pointer-events: none;
}
@keyframes heroZoom { from { transform: scale(1.08); } to { transform: scale(1); } }

.hero__content {
  position: relative; z-index: 1;
  grid-column: 1 / -1; grid-row: 1 / 3;
  display: flex; flex-direction: column;
}
.hero__title { font-size: 64px; line-height: 72px; font-weight: 500; letter-spacing: -.005em; }
.hero__subtitle {
  margin-top: 24px;
  font-size: 24px;
  line-height: 28px;
  font-weight: 300;
  color: rgba(255, 255, 255, .85);
  max-width: 420px;
}
.hero__subtitle em { color: var(--white); }
.hero__info { margin-top: auto; display: grid; gap: 16px; font-size: 16px; }
.hero__info-row { display: flex; }
.hero__info dt { width: 160px; flex: none; display: flex; align-items: center; gap: 6px; color: rgba(255, 255, 255, .7); }
.hero__info dt .ico { color: rgba(255, 255, 255, .7); }
.hero__info dd { color: var(--white); }

.hero__form { position: relative; z-index: 1; grid-column: 2; grid-row: 2; }

/* ---------- Glass ---------- */
.glass {
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  backdrop-filter: blur(24px) saturate(1.2);
}

/* ---------- Forms ---------- */
.form { border-radius: var(--radius-l); padding: 24px; }
.form__title { font-size: 24px; line-height: 29px; font-weight: 600; margin-bottom: 24px; }
.form__grid { display: grid; gap: 10px; }
.form__grid--hero {
  grid-template-columns: minmax(0, 400px) minmax(0, 250px);
  grid-template-areas:
    "name date"
    "phone time"
    "agree submit";
}
.form__grid--hero .field--name { grid-area: name; }
.form__grid--hero .field--date { grid-area: date; }
.form__grid--hero .field--phone { grid-area: phone; }
.form__grid--hero .field--time { grid-area: time; }
.form__grid--hero .field--agree { grid-area: agree; }
.form__grid--hero .form__submit { grid-area: submit; margin-top: 2px; }
.form__grid--stack { gap: 16px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form__submit { width: 100%; }

.form--dark {
  background: rgba(40, 40, 42, .45);
  border: 1px solid rgba(255, 255, 255, .28);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, .25);
}
.form--light {
  background: rgba(240, 242, 246, .62);
  border: 1px solid rgba(255, 255, 255, .6);
  box-shadow: 0 20px 40px rgba(2, 10, 20, .15);
}

.field { position: relative; display: block; }
.field__input {
  width: 100%;
  height: 40px;
  padding: 0 44px 0 16px;
  border-radius: var(--radius-s);
  font-size: 14px;
  font-weight: 400;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .25s var(--ease), background-color .25s var(--ease), box-shadow .25s var(--ease);
}
.field__select { cursor: pointer; }
.field__input[readonly] { cursor: pointer; }
.field__ico {
  position: absolute;
  right: 12px; top: 50%;
  translate: 0 -50%;
  pointer-events: none;
  transition: color .25s var(--ease), transform .3s var(--ease), opacity .25s var(--ease);
}
.field__ico--done { opacity: 0; transform: scale(.4); }
.field.is-valid .field__ico--done { opacity: 1; transform: scale(1); }
.field--select:focus-within .field__ico--dd, .field.is-open .field__ico--dd { transform: rotate(180deg); }

/* тёмная форма (hero) */
.form--dark .field__input {
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .45);
  color: var(--white);
}
.form--dark .field__input::placeholder { color: rgba(255, 255, 255, .55); }
.form--dark .field__select:invalid { color: rgba(255, 255, 255, .55); }
.form--dark .field__select option { color: var(--text); }
.form--dark .field__ico { color: rgba(255, 255, 255, .55); }
.form--dark .field__ico--done { color: var(--white); }
.form--dark .field__input:hover { border-color: rgba(255, 255, 255, .8); background: rgba(255, 255, 255, .08); }
.form--dark .field__input:focus { border-color: var(--white); background: rgba(0, 0, 0, .2); box-shadow: 0 0 0 3px rgba(255, 255, 255, .15); }
.form--dark .field.is-filled .field__input { border-color: var(--white); background: rgba(0, 0, 0, .2); }

/* светлая форма (контакты) */
.form--light .field__input {
  background: rgba(255, 255, 255, .45);
  border: 1px solid rgba(255, 255, 255, .7);
  color: var(--text);
}
.form--light .field__input::placeholder { color: var(--gray); }
.form--light .field__select:invalid { color: var(--gray); }
.form--light .field__ico { color: var(--gray); }
.form--light .field__ico--done, .form--light .field__ico--dd { color: var(--primary); }
.form--light .field__input:hover { border-color: rgba(34, 62, 127, .45); background: rgba(255, 255, 255, .65); }
.form--light .field__input:focus { border-color: var(--primary); background: rgba(255, 255, 255, .75); box-shadow: 0 0 0 3px rgba(34, 62, 127, .15); }
.form--light .field.is-filled .field__input { border-color: var(--primary); background: rgba(255, 255, 255, .6); }

/* ошибки */
.field.is-error .field__input { border-color: #E5484D !important; box-shadow: 0 0 0 3px rgba(229, 72, 77, .18) !important; }
.field.is-error { animation: shake .45s var(--ease); }
@keyframes shake {
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

/* ---------- Switch ---------- */
.switch { display: flex; align-items: center; gap: 16px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.switch__track {
  position: relative;
  flex: none;
  width: 44px; height: 24px;
}
.switch__track::before {
  content: "";
  position: absolute; top: 1px; left: 2px;
  width: 40px; height: 22px; border-radius: 11px;
  background: #8F9297;
  transition: background-color .3s var(--ease);
}
.switch__track::after {
  content: "";
  position: absolute; top: 0; left: 0;
  width: 24px; height: 24px; border-radius: 50%;
  background: #F9F9FB;
  z-index: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
  transition: transform .35s cubic-bezier(.34, 1.56, .64, 1), width .2s var(--ease);
}
.switch input:checked + .switch__track::before { background: var(--primary); }
.switch input:checked + .switch__track::after { transform: translateX(20px); }
.switch:active .switch__track::after { width: 28px; }
.switch input:checked:active + .switch__track::after,
.switch:active input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 12px; }
.switch:hover .switch__track::before { background: #9EA1A6; }
.switch:hover input:checked + .switch__track::before { background: var(--primary-hover); }
.switch__text { font-size: 12px; line-height: 14px; font-weight: 400; }
.form--dark .switch__text { color: var(--white); }
.form--dark .switch__text .link { color: var(--label); text-decoration-color: rgba(187, 195, 213, .6); }
.form--dark .switch__text .link:hover { color: var(--white); }
.switch--reverse { flex-direction: row-reverse; justify-content: space-between; margin-top: 6px; margin-bottom: 4px; }
.switch.is-error .switch__track::before { background: #E5484D; }
.switch.is-error { animation: shake .45s var(--ease); }

/* ---------- Cards (тир) ---------- */
.section--tir .h2 { margin-top: 0; }
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 31px;
  margin: 40px 0;
}
.card {
  background: var(--white);
  border-radius: var(--radius-l);
  padding: 12px 12px 32px;
  box-shadow: var(--shadow-card);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
.card__img { border-radius: var(--radius-m); overflow: hidden; aspect-ratio: 382 / 250; background: #e8eaee; }
.card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease), filter .8s var(--ease); }
.card__title { font-size: 24px; line-height: 29px; font-weight: 500; margin: 18px 4px 8px; transition: color .3s var(--ease); }
.card__text { padding: 0 4px; font-size: 16px; line-height: 19px; }
.card:hover { transform: translateY(-8px); box-shadow: var(--shadow-card-hover); }
.card:hover .card__img img { transform: scale(1.07); filter: saturate(1.1); }
.card:hover .card__title { color: var(--primary); }

/* ---------- Автошкола ---------- */
#autoschool { padding-top: var(--section-gap); }
.school {
  position: relative;
  min-height: 300px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  padding: 16px;
  display: flex;
  align-items: stretch;
}
.school__bg, .school__bg img { position: absolute; inset: 0; width: 100%; height: 100%; }
.school__bg img { object-fit: cover; object-position: center 60%; transition: transform 1.2s var(--ease); }
.school__panel {
  position: relative;
  width: 612px;
  max-width: 100%;
  padding: 20px 24px 24px;
  border-radius: var(--radius-l);
  background: rgba(255, 255, 255, .62);
  border: 1px solid rgba(255, 255, 255, .5);
  display: flex; flex-direction: column; align-items: flex-start;
}
.school__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.badge {
  display: inline-flex; align-items: center;
  height: 28px; padding: 0 16px;
  border-radius: var(--radius-s);
  background: var(--dark-badge);
  color: var(--white);
  font-size: 12px; font-weight: 400;
}
.school__panel p { font-size: 16px; line-height: 19px; max-width: 540px; }
.school__panel p + p { margin-top: 16px; }
.school__panel .btn { margin-top: 24px; }
.nowrap-d { white-space: nowrap; }

/* ---------- О нас ---------- */
.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 600px;
  gap: 40px 120px;
  align-items: start;
}
.about__title { max-width: 640px; }
.about__body { margin-top: 24px; max-width: 640px; }
.about__body p { font-size: 16px; line-height: 19px; }
.about__body p + p { margin-top: 19px; }

/* слайдер */
.slider { position: relative; }
.slider__viewport {
  position: relative;
  aspect-ratio: 600 / 330;
  border-radius: var(--radius-l);
  overflow: hidden;
  background: #111;
  touch-action: pan-y;
}
/* смена фото — плавный кроссфейд */
.slider__slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; }
.slider__slide img { width: 100%; height: 100%; object-fit: cover; }
.slider__slide.is-entering { opacity: 0; }
.slider__slide.is-active { opacity: 1; visibility: visible; z-index: 2; transition: opacity .8s var(--ease); }
.slider__slide.is-leaving { opacity: 1; visibility: visible; z-index: 1; }

.slider__controls {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  height: 20px; margin-top: 17px;
}
.slider__dots { display: flex; gap: 14px; }
.slider__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--line);
  transition: background-color .3s var(--ease), transform .3s var(--ease);
}
.slider__dot:hover { background: var(--label); transform: scale(1.3); }
.slider__dot.is-active { background: var(--primary); transform: scale(1.15); }
.slider__arrows { position: absolute; right: 38px; top: 0; display: flex; gap: 20px; }
.slider__arrow { color: var(--primary); width: 22px; height: 20px; display: flex; align-items: center; justify-content: center; transition: color .25s, transform .3s var(--ease); }
.slider__arrow .ico { width: 22px; height: 22px; }
.slider__arrow--next .ico { transform: scaleX(-1); }
.slider__arrow--prev:hover { transform: translateX(-4px); color: var(--primary-hover); }
.slider__arrow--next:hover { transform: translateX(4px); color: var(--primary-hover); }
.slider__arrow:active { transform: scale(.85); }

/* ---------- Приоритеты ---------- */
.section--prio .eyebrow { margin-bottom: 32px; }
.prio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 31px; }
.prio__item {
  display: flex; align-items: flex-start; gap: 24px;
  min-height: 150px;
  padding: 32px 24px;
  background: var(--white);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-card);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
.prio__ico { width: 80px; height: auto; flex: none; margin-top: 4px; transition: transform .5s cubic-bezier(.34, 1.56, .64, 1); }
.prio__title { font-size: 16px; line-height: 19px; font-weight: 600; margin: 4px 0 12px; }
.prio__item p { font-size: 16px; line-height: 19px; }
.prio__item:hover { transform: translateY(-6px); box-shadow: var(--shadow-card-hover); }
.prio__motto { margin-top: 64px; }

/* ---------- Контакты ---------- */
.contacts {
  display: grid;
  grid-template-columns: 480px minmax(0, 1fr);
  gap: 60px;
  align-items: stretch;
}
.contacts__info { display: flex; flex-direction: column; align-items: flex-start; }
.contacts__info .map { align-self: stretch; flex: 1 0 283px; }
.contacts .eyebrow { margin-bottom: 40px; }
.contacts__addr { line-height: 29px; }
.route-link {
  display: inline-flex; align-items: center; gap: 12px;
  margin-top: 10px;
  font-size: 14px; font-weight: 600;
  color: var(--primary);
  transition: color .25s;
}
.route-link .ico { width: 18px; height: 18px; transform: scaleX(-1); transition: transform .35s var(--ease); }
.route-link:hover { color: var(--primary-hover); }
.route-link:hover .ico { transform: scaleX(-1) translateX(-6px); }
.contacts__list { margin-top: 32px; display: grid; gap: 16px; font-size: 16px; line-height: 19px; }
.contacts__list > div { display: flex; }
.contacts__list dt { width: 160px; flex: none; color: var(--gray); }
.contacts__list dd a { transition: color .25s; }
.contacts__list dd a:hover { color: var(--primary); }

.map {
  position: relative;
  display: block;
  margin-top: 32px;
  min-height: 283px;
  border-radius: var(--radius-l);
  overflow: hidden;
  background: #eceeef;
}
.map > img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease), filter .5s; }
.map__pin {
  position: absolute; left: 23.5%; top: 66%;
  width: 40px; height: 40px;
  translate: -50% -50%;
  border-radius: 50%;
}
.map__pin img { position: relative; z-index: 1; width: 40px; height: 40px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .25)); }
.map__pin::before, .map__pin::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: rgba(34, 62, 127, .35);
  animation: pulse 2.4s var(--ease) infinite;
}
.map__pin::after { animation-delay: 1.2s; }
@keyframes pulse { from { transform: scale(1); opacity: .9; } to { transform: scale(2.6); opacity: 0; } }
.map__hint {
  position: absolute; right: 16px; bottom: 16px;
  padding: 8px 14px; border-radius: var(--radius-s);
  background: var(--primary); color: var(--white);
  font-size: 14px; font-weight: 400;
  opacity: 0; transform: translateY(8px);
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.map:hover > img { filter: saturate(1.2); }
.map:hover .map__hint { opacity: 1; transform: none; }

.contacts__form-wrap {
  position: relative;
  margin-top: 54px;
  min-height: 500px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  padding: 32px;
  display: flex;
}
.contacts__bg, .contacts__bg img { position: absolute; inset: 0; width: 100%; height: 100%; }
.contacts__bg img { object-fit: cover; transition: transform 1.4s var(--ease); }
.contacts__form { position: relative; width: 448px; max-width: 100%; }

/* ---------- Footer ---------- */
.footer { padding: 63px 0 34px; }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.footer__brand { display: flex; align-items: center; gap: 24px; color: var(--gray); }
.footer__brand img { width: 56px; height: 56px; }
.footer__name { font-weight: 600; font-size: 16px; line-height: 19px; }
.footer__year { font-size: 16px; line-height: 19px; margin-top: 4px; }
.footer__links { display: flex; gap: 64px; margin-left: 40px; }
.footer__links .link { font-size: 16px; }
.footer__made { color: var(--gray); font-size: 16px; }

/* ---------- Date picker ---------- */
.dp {
  position: absolute;
  z-index: 110;
  width: 288px;
  padding: 14px;
  border-radius: var(--radius-l);
  background: var(--white);
  color: var(--text);
  box-shadow: 0 20px 50px rgba(2, 10, 20, .22);
  animation: dpIn .25s var(--ease);
}
.dp[hidden] { display: none; }
@keyframes dpIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.dp__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dp__month { font-weight: 600; font-size: 15px; text-transform: capitalize; }
.dp__nav { width: 32px; height: 32px; border-radius: 50%; color: var(--primary); display: flex; align-items: center; justify-content: center; transition: background-color .2s; }
.dp__nav .ico { width: 18px; height: 18px; }
.dp__nav--next .ico { transform: scaleX(-1); }
.dp__nav:hover { background: #EEF1F7; }
.dp__nav:disabled { opacity: .3; pointer-events: none; }
.dp__week, .dp__days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.dp__week span { font-size: 12px; color: var(--gray); padding: 4px 0; font-weight: 400; }
.dp__day {
  height: 36px; border-radius: var(--radius-s);
  font-size: 14px; font-weight: 400;
  transition: background-color .2s, color .2s, transform .2s;
}
.dp__day:hover:not(:disabled) { background: #EEF1F7; color: var(--primary); }
.dp__day.is-today { box-shadow: inset 0 0 0 1px var(--label); }
.dp__day.is-selected { background: var(--primary); color: var(--white); }
.dp__day:disabled { color: #C9CDD6; cursor: default; }

/* ---------- Кастомные выпадающие списки ---------- */
.cselect__native {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: 0;
  overflow: hidden; clip: rect(0 0 0 0); border: 0; opacity: 0; pointer-events: none;
}
.cselect__btn {
  display: flex; align-items: center;
  text-align: left;
  cursor: pointer;
}
.cselect__value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form--dark .cselect__btn.is-placeholder { color: rgba(255, 255, 255, .55); }
.form--light .cselect__btn.is-placeholder { color: var(--gray); }
.form--dark .field.is-open .field__input { border-color: var(--white); background: rgba(0, 0, 0, .2); box-shadow: 0 0 0 3px rgba(255, 255, 255, .15); }
.form--light .field.is-open .field__input { border-color: var(--primary); background: rgba(255, 255, 255, .75); box-shadow: 0 0 0 3px rgba(34, 62, 127, .15); }

.dd {
  position: absolute;
  z-index: 110;
  padding: 8px;
  border-radius: var(--radius-l);
  background: var(--white);
  color: var(--text);
  box-shadow: 0 20px 50px rgba(2, 10, 20, .22);
  animation: ddIn .25s var(--ease);
  transform-origin: top center;
  max-height: 340px;
  overflow-y: auto;
}
.dd.is-above { transform-origin: bottom center; animation-name: ddInUp; }
.dd[hidden] { display: none; }
@keyframes ddIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
@keyframes ddInUp { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.dd__item {
  border-radius: var(--radius-s);
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
  outline: none;
  transition: background-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.dd__item:hover:not(:disabled), .dd__item:focus-visible { background: #EEF1F7; color: var(--primary); }
.dd__item:active:not(:disabled) { transform: scale(.96); }
.dd__item.is-selected { background: var(--primary); color: var(--white); }
.dd__item.is-selected:hover, .dd__item.is-selected:focus-visible { background: var(--primary-hover); color: var(--white); }
.dd__item:disabled { color: #C9CDD6; cursor: default; }

.dd--grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 10px; }
.dd--grid .dd__item { height: 42px; text-align: center; }
.dd--list { display: flex; flex-direction: column; gap: 2px; }
.dd--list .dd__item { padding: 12px 12px; text-align: left; }
.dd--list .dd__item:hover:not(:disabled):not(.is-selected) { transform: translateX(4px); }

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 120;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  visibility: hidden;
  transition: visibility 0s .4s;
}
.modal.is-open { visibility: visible; transition: none; }
.modal__overlay {
  position: absolute; inset: 0;
  background: rgba(14, 16, 20, .72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  opacity: 0;
  transition: opacity .4s var(--ease);
}
.modal.is-open .modal__overlay { opacity: 1; }
.modal__box {
  position: relative;
  width: 100%; max-width: 400px;
  padding: 24px 20px;
  border-radius: var(--radius-l);
  background: var(--white);
  text-align: center;
  opacity: 0;
  transform: translateY(24px) scale(.96);
  transition: opacity .4s var(--ease), transform .5s cubic-bezier(.34, 1.4, .64, 1);
}
.modal.is-open .modal__box { opacity: 1; transform: none; }
.modal__logo { width: 80px; height: 80px; margin: 0 auto; }
.modal.is-open .modal__logo { animation: pop .7s .15s cubic-bezier(.34, 1.56, .64, 1) both; }
@keyframes pop { from { transform: scale(.4) rotate(-30deg); opacity: 0; } }
.modal__title { margin-top: 32px; font-size: 32px; line-height: 38px; font-weight: 600; }
.modal__text { margin-top: 12px; font-size: 16px; line-height: 17px; padding: 0 20px; }
.modal__box .btn { margin-top: 40px; }
.modal__close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 50%;
  transition: background-color .25s, transform .35s var(--ease);
}
.modal__close span {
  position: absolute; left: 7px; top: 15px; width: 18px; height: 2px; border-radius: 2px;
  background: var(--label);
}
.modal__close span:first-child { transform: rotate(45deg); }
.modal__close span:last-child { transform: rotate(-45deg); }
.modal__close:hover { background: #EEF1F7; }
.modal__close:hover span { background: var(--primary); }

/* ---------- Reveal on scroll ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s var(--ease) var(--d, 0s), transform .8s var(--ease) var(--d, 0s);
}
.js .reveal.is-visible { opacity: 1; transform: none; }
/* у карточек свой hover-transform: после появления отдаём управление им */
.js .card.reveal.is-visible, .js .prio__item.reveal.is-visible { transition: opacity .8s var(--ease) var(--d, 0s), transform .45s var(--ease), box-shadow .45s var(--ease); }

/* =========================================================
   Адаптив
   ========================================================= */
@media (max-width: 1360px) {
  .nav { gap: 48px; }
  .about { column-gap: 64px; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); }
}

@media (max-width: 1279px) {
  .hero { grid-template-columns: 1fr; grid-template-rows: auto auto; row-gap: 40px; }
  .hero__content { grid-row: 1; }
  .hero__info { margin-top: 48px; }
  .hero__form { grid-column: 1; grid-row: 2; max-width: 708px; }
  .hero::after { background: linear-gradient(180deg, rgba(0, 0, 0, .2), rgba(0, 0, 0, .55)); }
}

@media (max-width: 1199px) {
  :root { --gutter: 24px; }
  .container--narrow { padding: 0 var(--gutter); }
  .nav { gap: 28px; margin-left: 0; }
  .header__phone { display: none; }
  .header__phone-m { display: inline-flex; }

  .cards, .prio { gap: 20px; }
  .prio__item { flex-direction: column; gap: 16px; }

  .about { grid-template-columns: 1fr; }
  .slider { max-width: 720px; }

  .contacts { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 32px; }
  .contacts__form-wrap { padding: 24px; }

  .footer__inner { flex-wrap: wrap; }
  .footer__links { margin-left: 0; gap: 32px; }
}

@media (max-width: 991px) {
  .nav { display: none; }
  .burger { display: inline-flex; }
  .header__cta { display: none; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .prio { grid-template-columns: 1fr; }
  .prio__item { flex-direction: row; min-height: 0; }
  .contacts { grid-template-columns: 1fr; }
  .contacts__form-wrap { margin-top: 0; }
}

/* ----- мобильная версия (макет 390) ----- */
@media (max-width: 767px) {
  :root { --gutter: 12px; --section-gap: 56px; }
  body { font-size: 14px; }

  .header__inner { padding-top: 16px; padding-bottom: 16px; }
  .header__logo img, .header.is-scrolled .header__logo img { width: 159px; height: 56px; }
  .header.is-scrolled .header__inner { padding-top: 8px; padding-bottom: 8px; }
  .header__actions { gap: 12px; }

  .eyebrow { font-size: 11px; letter-spacing: .5em; margin-bottom: 20px; }
  .h1 { font-size: 24px; }
  .h2 { font-size: 18px; line-height: 22px; }
  .br-d { display: none; }
  .lead { font-size: 14px; margin-top: 16px; }

  /* hero */
  .hero { min-height: 798px; padding: 20px 16px 12px 16px; row-gap: 0; display: flex; flex-direction: column; }
  .hero::after { background: linear-gradient(180deg, rgba(0, 0, 0, .45) 0%, rgba(0, 0, 0, 0) 45%); }
  .hero__title { font-size: 40px; line-height: 48px; }
  .hero__subtitle { margin-top: 12px; font-size: 18px; line-height: 22px; max-width: 320px; }
  .hero__info { display: none; }
  .hero__form { margin: auto -4px 0; }
  .form { padding: 20px; }
  .form__title { margin-bottom: 20px; }
  .form__grid--hero {
    grid-template-columns: 1fr;
    grid-template-areas: "name" "phone" "date" "time" "agree" "submit";
  }
  .form__grid--hero .form__submit { margin-top: 12px; }
  .form__grid--stack { gap: 10px; }
  .form__row { grid-template-columns: 1fr; gap: 10px; }
  .switch { gap: 16px; }
  .switch__text { font-size: 12px; }
  .switch--reverse { flex-direction: row; justify-content: flex-start; margin: 14px 0 10px; }
  .form .btn--block, .form__submit { --h: 44px; font-size: 16px; }

  /* тир */
  .section--tir { padding-top: 48px; }
  .cards { grid-template-columns: 1fr; gap: 12px; margin: 24px 0 12px; }
  .card { padding: 12px 12px 24px; }
  .card__img { aspect-ratio: 342 / 250; }
  .card__title { font-size: 18px; line-height: 22px; font-weight: 600; margin: 18px 0 8px; }
  .card__text { padding: 0; font-size: 14px; line-height: 17px; }
  .card:hover { transform: none; }
  .btn--cta { width: 100%; font-size: 16px; }
  .section--tir .btn--cta { margin-top: 12px; }

  /* автошкола */
  #autoschool { padding-top: 40px; }
  .school { min-height: 500px; padding: 12px; align-items: flex-start; }
  .school__bg img { object-position: center bottom; }
  .school__panel { width: 100%; padding: 16px; }
  .school__head { flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
  .school__panel p { font-size: 14px; line-height: 17px; }
  .school__panel p + p { margin-top: 12px; }
  .school__panel .btn { width: 100%; margin-top: 20px; }
  .nowrap-d { white-space: normal; }

  /* о нас */
  .section--about { padding-top: 40px; }
  .about { gap: 24px; }
  .about__title { font-size: 18px; line-height: 22px; }
  .about__body { margin-top: 10px; }
  .about__body p { font-size: 14px; line-height: 17px; }
  .about__body p + p { margin-top: 17px; }
  .slider__viewport { aspect-ratio: 366 / 300; }
  .slider__arrows { right: 0; gap: 16px; }
  .slider__controls { margin-top: 12px; }

  /* приоритеты */
  .section--prio { padding-top: 48px; }
  .section--prio .eyebrow { margin-bottom: 16px; }
  .prio { gap: 12px; }
  .prio__item { padding: 24px 16px; gap: 20px; }
  .prio__ico { width: 72px; }
  .prio__title { font-size: 18px; line-height: 22px; margin: 0 0 8px; }
  .prio__item p { font-size: 14px; line-height: 17px; }
  .prio__motto { margin-top: 32px; font-size: 18px; line-height: 22px; }

  /* контакты */
  .section--contacts { padding-top: 48px; }
  .contacts { gap: 24px; }
  .contacts .eyebrow { margin-bottom: 28px; }
  .contacts__addr { font-size: 24px; line-height: 29px; }
  .contacts__list { margin-top: 24px; gap: 16px; font-size: 16px; }
  .map { height: 250px; flex: none; margin-top: 24px; }
  .map__pin { left: 19.3%; top: 66%; }
  .map__hint { display: none; }
  .contacts__form-wrap { min-height: 0; padding: 12px; }
  .contacts__form { width: 100%; }

  /* footer */
  .footer { padding: 40px 0 32px; }
  .footer__inner { flex-direction: column; text-align: center; gap: 40px; }
  .footer__brand { flex-direction: column; gap: 16px; }
  .footer__links { flex-direction: column; align-items: center; gap: 18px; }
  .footer__made { display: none; }

  .dp {
    position: fixed;
    left: 50% !important; top: 50% !important;
    translate: -50% -50%;
    width: min(340px, calc(100vw - 32px));
    box-shadow: 0 0 0 100vmax rgba(10, 12, 16, .45), 0 20px 50px rgba(2, 10, 20, .3);
  }
  .dp__day { height: 40px; }
  .modal { padding: 24px; }
  .modal__box { max-width: 342px; }
}

@media (min-width: 768px) {
  .br-m { display: none; }
}

@media (hover: none) {
  .card:hover, .prio__item:hover { transform: none; box-shadow: var(--shadow-card); }
  .card:hover .card__img img { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

/* якоря с учётом липкой шапки */
section[id], form[id] { scroll-margin-top: 90px; }
