/* ===== Токены ===== */
:root {
  --navy: #172554;
  --blue: #1E40AF;
  --blue-soft: #DBEAFE;
  --blue-line: #BFDBFE;
  --bg: #EFF6FF;
  --text: #172554;
  --muted: #475569;
  --body: #334155;
  --cta: #C2410C;
  --cta-hover: #9A3412;
  --focus: #F59E0B;
  --white: #fff;

  --font-head: Montserrat, "Segoe UI", system-ui, Arial, sans-serif;
  --font-body: Manrope, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --radius: 20px;
  --header-h: 68px;
  --ease: .18s ease;
}

/* ===== База ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}
h1, h2 { font-family: var(--font-head); font-weight: 800; line-height: 1.12; margin: 0; hyphens: none; overflow-wrap: normal; word-break: keep-all; text-wrap: balance; }
h2 { font-size: clamp(26px, 3.6vw, 40px); }
strong { font-weight: 800; }
.hl { color: #FDBA74; }
p { margin: 0; }
a { color: var(--blue); }
a:hover { color: var(--navy); }
img, svg { max-width: 100%; }

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

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.container--narrow { max-width: 720px; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--white); color: var(--navy); padding: 10px 16px; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 12px; }

.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon--accent { stroke: #93C5FD; }

/* ===== Кнопки ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px;
  border: 1.5px solid transparent; border-radius: 12px;
  font: 600 16px/1 var(--font-body);
  text-decoration: none; cursor: pointer;
  transition: background-color var(--ease), color var(--ease), border-color var(--ease);
}
.btn--primary { background: var(--cta); color: var(--white); }
.btn--primary:hover { background: var(--cta-hover); color: var(--white); }
.btn--ghost { background: transparent; color: var(--white); border-color: #93C5FD; }
.btn--ghost:hover { background: rgba(255, 255, 255, .14); color: var(--white); }
.btn--sm { min-height: 44px; padding: 0 18px; font-size: 15px; }
.btn--lg { min-height: 54px; padding: 0 28px; font-size: 17px; }

/* ===== Шапка ===== */
.header { position: sticky; top: 0; z-index: 50; background: var(--navy); }
.header__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--header-h); position: relative; }
.header .container { max-width: none; } /* шапка на всю ширину окна: кнопка у правого края */
.header__cta { display: none; margin-left: auto; }

.burger {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 44px; padding: 0 14px; border-radius: 10px;
  background: transparent; color: var(--white); border: 1.5px solid rgba(255, 255, 255, .35);
  font: 600 15px/1 var(--font-body); cursor: pointer;
}
.burger__bars, .burger__bars::before, .burger__bars::after { display: block; width: 20px; height: 2px; background: currentColor; border-radius: 2px; transition: transform var(--ease), opacity var(--ease); }
.burger__bars { position: relative; }
.burger__bars::before, .burger__bars::after { content: ""; position: absolute; left: 0; }
.burger__bars::before { top: -6px; }
.burger__bars::after { top: 6px; }
.burger[aria-expanded="true"] .burger__bars { background: transparent; }
.burger[aria-expanded="true"] .burger__bars::before { transform: translateY(6px) rotate(45deg); }
.burger[aria-expanded="true"] .burger__bars::after { transform: translateY(-6px) rotate(-45deg); }

.nav {
  display: none; flex-direction: column;
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--navy); padding: 8px 20px 16px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 12px 24px rgba(0, 0, 0, .25);
}
.nav.is-open { display: flex; }
.nav__link {
  display: flex; align-items: center; min-height: 48px; padding: 0 14px;
  color: #DBEAFE; text-decoration: none; border-radius: 10px; font-size: 16px;
  transition: background-color var(--ease), color var(--ease);
}
.nav__link:hover { background: rgba(255, 255, 255, .12); color: var(--white); }
.nav__link.is-active { background: rgba(255, 255, 255, .16); color: var(--white); font-weight: 600; }

/* ===== Первый экран ===== */
.hero { background: var(--navy); color: var(--white); padding: 40px 0 56px; }
.hero__inner { display: grid; gap: 32px; align-items: center; }
.hero h1 { font-size: clamp(28px, 7vw, 52px); letter-spacing: -.015em; margin-bottom: 20px; }
.hero__lead { font-size: 18px; color: #DBEAFE; max-width: 560px; margin-bottom: 12px; }
.hero__lead--big { font-size: 22px; font-weight: 800; color: var(--white); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0; }
.hero__actions .btn { flex: 1 1 200px; }

.phone { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.phone__number { display: inline-flex; align-items: center; min-height: 44px; font-size: 19px; font-weight: 600; color: var(--white); text-decoration: none; }
.phone__number[href]:hover { text-decoration: underline; color: var(--white); }

.facts { background: var(--white); color: var(--text); border-radius: var(--radius); padding: 28px; display: grid; gap: 22px; }
.fact { display: flex; gap: 16px; align-items: flex-start; }
.fact__icon { flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--blue-soft); color: var(--blue); display: inline-flex; align-items: center; justify-content: center; }
.fact__icon .icon { width: 22px; height: 22px; }
.fact__title { font-family: var(--font-head); font-weight: 800; font-size: 20px; line-height: 1.25; }
.fact__text { color: var(--muted); font-size: 15px; }

/* ===== Секции ===== */
.section { padding: 56px 0; }
.section--steps { padding-top: 16px; }
/* при переходе по ссылке заголовок секции встаёт сразу под шапкой, без пустого отступа */
#price, #apply { scroll-margin-top: -40px; }
#steps { scroll-margin-top: 0; }
.section--steps h2 { margin-bottom: 28px; }

.price { background: var(--white); border: 1.5px solid var(--blue-line); border-radius: 24px; padding: 24px 20px; display: grid; gap: 28px; align-items: center; }
.price h2 { margin-bottom: 16px; }
.price__text p { font-size: 20px; color: var(--body); }
.price__text p + p { margin-top: 10px; }
.price__tag { background: var(--blue); color: var(--white); border-radius: var(--radius); padding: 28px; text-align: center; }
.price__label, .price__note { font-size: 15px; color: #DBEAFE; line-height: 1.4; }
.price__value { font-family: var(--font-head); font-weight: 900; font-size: 60px; line-height: 1.1; margin: 4px 0; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.step { background: var(--white); border: 1.5px solid var(--blue-line); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: row; align-items: center; gap: 16px; }
.step__num { flex: none; }
.step p { font-size: 20px; line-height: 1.4; }
.step__num { width: 48px; height: 48px; border-radius: 50%; background: var(--blue); color: var(--white); display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-head); font-weight: 800; font-size: 20px; }

.section--apply { background: var(--blue-soft); }
.section--apply h2 { text-align: center; margin-bottom: 24px; }
.card { background: var(--white); border-radius: 24px; padding: 20px; }
.lead { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: 15px; }
.field input {
  width: 100%; min-height: 54px; padding: 0 16px;
  font: 500 17px var(--font-body); color: var(--text);
  background: var(--white); border: 1.5px solid #93A4C4; border-radius: 12px;
  transition: border-color var(--ease);
}
.field input:hover, .field input:focus { border-color: var(--blue); }
.field input[aria-invalid="true"] { border-color: #B91C1C; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.5; color: var(--muted); cursor: pointer; }
.check input { flex: none; width: 24px; height: 24px; margin: 0; accent-color: var(--blue); cursor: pointer; }
.lead__submit { width: 100%; }
.lead__status { font-size: 15px; line-height: 1.5; min-height: 0; }
.lead__status.is-error { color: #B91C1C; font-weight: 600; }
.lead__status a { font-weight: 700; }
.lead__done { text-align: center; padding: 16px 0; }
.lead__done strong { display: block; font-family: var(--font-head); font-size: 26px; line-height: 1.2; margin-bottom: 8px; }
.apply__alt { text-align: center; margin-top: 24px; }
.apply__alt a { display: inline-block; padding: 10px 6px; font-weight: 600; }

/* ===== Подвал ===== */
.footer { background: var(--navy); color: #DBEAFE; padding: 32px 0 calc(32px + 76px + env(safe-area-inset-bottom)); font-size: 15px; }
.footer__inner { display: flex; flex-wrap: wrap; gap: 16px 40px; align-items: center; justify-content: space-between; }
.footer__links { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.footer__links a { display: inline-flex; align-items: center; min-height: 44px; color: #BFDBFE; }
.footer__links a:hover { color: var(--white); }

/* ===== Нижняя панель (телефон) ===== */
.mobile-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; gap: 10px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--navy); border-top: 1px solid rgba(255, 255, 255, .15);
}
.mobile-bar .btn { flex: 1 1 0; padding: 0 12px; white-space: nowrap; }
.mobile-bar .btn--primary { flex-grow: 1.5; }

/* ===== Планшет и выше ===== */
@media (min-width: 640px) {
  .header__cta { display: inline-flex; }
  .card { padding: 32px; }
  .price { padding: 44px; }
  .price__tag { max-width: 320px; margin: 0 auto; width: 100%; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .step { padding: 28px; flex-direction: column; align-items: flex-start; gap: 16px; }
}

@media (min-width: 900px) {
  :root { --header-h: 72px; }
  body { font-size: 18px; }
  .footer { padding-bottom: 32px; }
  .mobile-bar { display: none; }
  .burger { display: none; }
  .nav { display: flex; flex-direction: row; position: static; background: none; padding: 0; border: 0; box-shadow: none; gap: 4px; }
  .nav__link { min-height: 44px; font-size: 15px; }
  .hero { padding: 64px 0 80px; }
  .hero__inner { grid-template-columns: 1.15fr .85fr; gap: 56px; }
  .hero__lead { font-size: 19px; }
  .hero__lead--big { font-size: 24px; }
  .hero__actions .btn { flex: 0 0 auto; }
  .facts { padding: 32px; }
  .section { padding: 80px 0; }
  .section--steps { padding-top: 24px; }
  #price, #apply { scroll-margin-top: -64px; }
  .price { grid-template-columns: 1.3fr .7fr; gap: 56px; padding: 56px; }
  .container { padding: 0 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ===== Возвраты ===== */
.section--refunds { padding-top: 24px; }
.section--refunds h2 { margin-bottom: 12px; }
.refunds__lead { font-size: 20px; color: var(--body); margin-bottom: 28px; max-width: 640px; }
.gallery__item {
  display: block; width: 100%; padding: 0; cursor: zoom-in;
  background: var(--white); border: 1.5px solid var(--blue-line); border-radius: 16px; overflow: hidden;
  transition: border-color var(--ease), transform var(--ease);
}
.gallery__item:hover { border-color: var(--blue); transform: translateY(-2px); }
.gallery__item img { display: block; width: 100%; height: auto; }

/* Коллаж: высокий кадр слева, четыре справа в два ряда; края и высоты выровнены */
.collage { display: grid; grid-template-columns: 2865fr 7135fr; gap: 8px; align-items: stretch; }
.collage__main, .collage__side { min-width: 0; }
.collage__main .gallery__item { height: 100%; }
.collage__main .gallery__item img { height: 100%; object-fit: cover; object-position: top; }
.collage__side { display: flex; flex-direction: column; gap: 8px; }
.collage__row { display: flex; gap: 8px; }
.collage__row .gallery__item { flex: 1 1 0; min-width: 0; }

.lightbox {
  position: fixed; inset: 0; margin: 0; padding: 0; border: 0;
  width: 100%; height: 100%; max-width: none; max-height: none;
  background: transparent; color: var(--white);
  align-items: center; justify-content: center;
}
.lightbox[open] { display: flex; }
.lightbox::backdrop { background: rgba(15, 23, 42, .9); }
.lightbox__img { max-width: min(92vw, 720px); max-height: 86vh; width: auto; height: auto; border-radius: 12px; background: var(--white); }
.lightbox__btn {
  position: absolute; width: 48px; height: 48px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .16); color: var(--white); border: 1.5px solid rgba(255, 255, 255, .4); cursor: pointer;
  transition: background-color var(--ease);
}
.lightbox__btn:hover { background: rgba(255, 255, 255, .3); }
.lightbox__close { top: 16px; right: 16px; }
.lightbox__prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 12px; top: 50%; transform: translateY(-50%); }
.lightbox__count { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; font-size: 15px; color: #DBEAFE; }

@media (min-width: 640px) {
  .collage, .collage__side, .collage__row { gap: 12px; }
}
@media (min-width: 900px) {
  .section--refunds { padding-top: 24px; }
  #refunds { scroll-margin-top: -8px; }
  .collage, .collage__side, .collage__row { gap: 14px; }
}

/* ===== Смартфон ===== */
@media (max-width: 639px) {
  .collage {
    display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory;
    margin: 0 -20px; padding: 0 20px 12px; scroll-padding: 0 20px;
    -webkit-overflow-scrolling: touch;
  }
  .collage__main, .collage__side, .collage__row { display: contents; }
  .collage .gallery__item {
    flex: 0 0 auto !important; height: 360px; max-width: 86vw; width: auto;
    scroll-snap-align: start;
  }
  .collage .gallery__item img, .collage__main .gallery__item img {
    height: 100%; width: auto; max-width: 100%; object-fit: contain; object-position: top left; background: var(--white);
  }
  .lightbox__img { max-height: 74vh; }
  .lightbox__prev, .lightbox__next { top: auto; bottom: 14px; transform: none; }
  .lightbox__prev { left: calc(50% - 112px); }
  .lightbox__next { right: calc(50% - 112px); }
  .lightbox__count { bottom: 28px; }
}
