/* Пульсуй_2026 — вёрстка по макету Figma (node 2001:465).
   Поточная вёрстка: секции, flex/grid, адаптивные размеры.
   Эталонная ширина макета — 1920px, размеры переведены в clamp()/проценты. */

/* ---------- Шрифты ---------- */
@font-face {
  font-family: "Intro";
  src: url("fonts/INTRO-REGULAR.OTF") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Intro";
  src: url("fonts/INTRO-BOLD.OTF") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Open Sans";
  src: url("fonts/OpenSans-VariableFont_wdth,wght.ttf") format("truetype-variations");
  font-weight: 300 800;
  font-stretch: 75% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Open Sans";
  src: url("fonts/OpenSans-Italic-VariableFont_wdth,wght.ttf") format("truetype-variations");
  font-weight: 300 800;
  font-stretch: 75% 125%;
  font-style: italic;
  font-display: swap;
}

/* ---------- Токены ---------- */
:root {
  --red: #bf2c23;
  --ink: #000;
  --gutter: clamp(16px, 4.16vw, 80px);
  --content: 1760px;

  /* Единица мобильного макета: 1px макета (эталон — 390px) в реальных px.
     Размеры мобильной вёрстки пишутся как calc(N * var(--px)), поэтому на
     390px они попадают в макет один в один, ниже — пропорционально сжимаются,
     а выше 430px перестают расти. Вне мобильного брейкпоинта --px = 1px. */
  --px: 1px;

  --intro: Intro, Inter, system-ui, sans-serif;
  --os: "Open Sans", system-ui, sans-serif;
  --inter: Inter, system-ui, sans-serif;

  /* типографика: clamp(мин, доля от 1920px, макет) */
  --fs-lead: clamp(20px, 2.4vw, 46px);
  --fs-h2: clamp(22px, 2.92vw, 56px);
  --fs-num: clamp(38px, 7.29vw, 140px);
  --fs-body: clamp(15px, 1.25vw, 24px);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: var(--intro);
  overflow-x: hidden;
}

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

p { margin: 0; }

a { color: inherit; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

.container {
  width: min(100% - var(--gutter) * 2, var(--content));
  margin-inline: auto;
}

.accent { color: var(--red); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Картинка, вписанная в блок заданных пропорций */
.pic {
  position: relative;
  overflow: hidden;
}
.pic > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

/* ---------- Шапка ---------- */
.header {
  position: relative;
  padding-block: clamp(20px, 2.66vw, 51px) clamp(18px, 1.72vw, 33px);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(16px, 2vw, 40px);
}

.header__logo img { height: clamp(50px, 5.61vw, 108px); width: auto; }

.header__help {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.82vw, 35px);
  font-family: var(--intro);
  font-size: clamp(18px, 2.08vw, 40px);
  line-height: 1.2;
  text-decoration: none;
}
.header__help img { width: clamp(60px, 7.19vw, 138px); height: auto; }

/* Кардиограмма прижата базовой линией к нижней границе шапки */
.header__pulse {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: auto;
  transform: translateY(35.25%);
  pointer-events: none;
}

/* ---------- Первый экран ---------- */
.hero {
  margin-top: clamp(48px, 8.45vw, 162px);
  text-align: left;
}

.hero__title {
  margin: 0 auto;
  width: clamp(240px, 55.6vw, 1067.79px);
}
.hero__title img { width: 100%; height: auto; }

.hero__lead {
  max-width: 1025px;
  margin: clamp(24px, 3.83vw, 73px) auto 0;
  font-size: var(--fs-lead);
  line-height: 1.3;
}

.hero__heart {
  display: inline-block;
  width: clamp(26px, 2.69vw, 51.64px);
  height: auto;
  margin-left: -0.05em;
  vertical-align: -0.1em;
  transform: rotate(12.78deg);
}

.hero__sub {
  margin: clamp(56px, 10vw, 192px) auto 0;
  font-size: var(--fs-lead);
  line-height: 1.3;
  text-align: center;
}

/* ---------- Шаги ---------- */
.steps {
  margin-top: clamp(40px, 4.16vw, 80px);
}

.steps__list {
  max-width: 1500px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(20px, 4.79vw, 92px);
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

/* Разворачивающийся заголовок инструкции — только в мобильной версии */
.steps__toggle { display: none; }

.step {
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 0.72vw, 14px);
}

.step__head {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.2vw, 23px);
  min-height: clamp(28px, 3.98vw, 76px);
}

.step__num {
  font-family: var(--os);
  font-weight: 600;
  font-size: clamp(20px, 1.62vw, 31.09px);
  line-height: 1.3;
}

.step__clock { width: clamp(34px, 3.09vw, 59.27px); height: auto; }

.step__hint {
  font-family: var(--os);
  font-weight: 600;
  font-size: clamp(13px, 1.08vw, 20.73px);
  line-height: 1.3;
  color: var(--red);
  white-space: nowrap;
}

/* Иллюстрации шагов выровнены по нижнему краю */
.step__pic {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: clamp(70px, 6.89vw, 132.2px);
}
/* .step__figure задаёт размер иллюстрации и служит системой координат
   для дорисованных поверх неё элементов */
.step__figure {
  position: relative;
  display: block;
}
.step__figure > img { width: 100%; height: auto; }

.step__pic--1 .step__figure { width: clamp(120px, 12.09vw, 232.2px); }
.step__pic--2 .step__figure { width: clamp(118px, 11.68vw, 224.24px); }
.step__pic--3 .step__figure { width: clamp(118px, 11.64vw, 223.54px); }

/* Дорисованная стрелка поверх иллюстрации 3-го шага */
.step__figure > img.step__doodle {
  position: absolute;
  left: 21.33%;
  top: 27.58%;
  width: 39.18%;
  height: auto;
  transform: rotate(6.08deg);
}

.step__text {
  padding-top: clamp(8px, 0.9vw, 17px);
  font-family: var(--os);
  font-size: clamp(13px, 1.08vw, 20.73px);
  line-height: 1.3;
}

/* 4-й шаг: счётчик и кнопка */
.step--timer { align-items: stretch; }

.step__ring {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(100px, 9.4vw, 180px);
  height: clamp(100px, 9.4vw, 180px);
  margin: 0 auto;
}

.step__ring-svg {
  display: none;
  width: 100%;
  height: 100%;
  transform: scaleX(-1) rotate(-90deg);
}

.step__ring.is-running .step__ring-svg { display: block; }
.step__ring.is-running .step__ring-value { display: none; }

.step__ring-track,
.step__ring-progress {
  fill: none;
  stroke-width: 14;
}

.step__ring-track { stroke: #e2d3d3; }

.step__ring-progress {
  stroke: var(--red);
  stroke-linecap: round;
  stroke-dasharray: 314.159;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
}

.step__ring-value {
  font-family: var(--os);
  font-weight: 700;
  font-size: clamp(36px, 4vw, 76px);
  line-height: 1;
  color: var(--red);
}

/* Подпись «секунд» рядом с числом есть только в мобильном макете —
   на десктопе число живёт внутри кольца, места под неё нет */
.step__ring-unit { display: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  padding: clamp(14px, 1.69vw, 32.4px) clamp(16px, 2.3vw, 44px);
  font-family: var(--os);
  font-weight: 600;
  font-size: clamp(14px, 1.35vw, 25.91px);
  line-height: 1.3;
  color: #fff;
  text-align: center;
  background: var(--red);
  border: 2.591px solid var(--red);
  border-radius: clamp(10px, 1.08vw, 20.73px);
  transition: background-color .2s, border-color .2s;
}
.btn:hover { background: #a32118; border-color: #a32118; }
.btn[disabled] { opacity: .6; cursor: default; }
.btn--wide { width: min(100%, 571px); }
.btn--ghost {
  color: var(--red);
  background: #fff;
  border-color: var(--red);
}
.btn--ghost:hover { color: #fff; background: var(--red); }

.link-btn {
  padding: 0;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.step__reset {
  margin-top: clamp(8px, 0.9vw, 16px);
  font-family: var(--os);
  font-weight: 600;
  font-size: clamp(13px, 1.04vw, 20px);
  line-height: 1.3;
  color: var(--red);
}
.step__reset:hover { color: #a32118; }

.step__status {
  margin-top: clamp(8px, 0.9vw, 17px);
  font-family: var(--os);
  font-size: clamp(12px, 0.94vw, 18px);
  line-height: 1.35;
  color: var(--red);
}
.step__status:empty { display: none; }

@media (prefers-reduced-motion: reduce) {
  .step__ring-progress { transition: none; }
  .steps__toggle-icon { transition: none; }
}

/* ---------- Форма ---------- */
.form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(16px, 1.3vw, 25px);
  margin-top: clamp(40px, 4.9vw, 94px);
}

.field-wrap { flex: 0 1 clamp(280px, 29.74vw, 571px); }

.field {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-block: clamp(12px, 1.3vw, 25px) clamp(10px, 1.09vw, 21px);
  /* Отступ по горизонтали одинаковый у всех полей и с обеих сторон:
     справа в нём помещается иконка календаря, слева он держит подчёркивания
     полей на одной вертикали */
  padding-inline: calc(clamp(12px, 1.5vw, 30px) + clamp(26px, 2vw, 34px) + 12px);
  border: 2px solid #bfbfbf;
  border-radius: 16px;
  transition: border-color .2s;
}
.field:focus-within { border-color: var(--red); }
.field.is-invalid { border-color: #d13c33; background: #fff6f5; }

.field__input {
  width: 100%;
  padding: 0 0 clamp(3px, 0.26vw, 5px);
  font-family: var(--os);
  font-weight: 600;
  font-size: var(--fs-body);
  line-height: 1.3;
  color: #4a4a4a;
  text-align: center;
  background: none;
  border: 0;
  border-bottom: 2px solid var(--red);
  border-radius: 0;
  outline-offset: 4px;
  -webkit-appearance: none;
  appearance: none;
}
.field__input::placeholder { color: #4a4a4a; opacity: .35; }

/* Иконка календаря с нативным date-инпутом поверх неё */
.field__picker {
  position: absolute;
  top: 50%;
  right: clamp(10px, 1vw, 18px);
  width: clamp(26px, 2vw, 34px);
  transform: translateY(-50%);
}
.field__picker > img { width: 100%; height: auto; opacity: .55; }
.field__native {
  position: absolute;
  inset: -8px;
  width: calc(100% + 16px);
  height: calc(100% + 16px);
  opacity: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  background: none;
}
.field__native::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.field__hint,
.field__error {
  margin-top: 8px;
  padding-inline: clamp(12px, 1.5vw, 30px);
  text-align: center;
  font-family: var(--os);
  font-size: clamp(12px, 0.94vw, 18px);
  line-height: 1.35;
}
.field__hint { color: #7a7a7a; }
.field__error { color: #d13c33; font-weight: 600; }
.field__error:empty { display: none; }

.form__submit {
  flex: 0 0 100%;
  display: flex;
  justify-content: center;
  margin-top: clamp(8px, 1vw, 18px);
}

/* ---------- Красный счётчик ---------- */
.counter {
  position: relative;
  width: 100%;
  margin-top: clamp(48px, 5.2vw, 100px);
  padding: clamp(28px, 3.02vw, 58px) clamp(90px, 9vw, 170px) clamp(24px, 2.76vw, 53px);
  color: #fff;
  text-align: center;
  background: var(--red);
  border-radius: 16px;
}

.counter__num,
.lifetime__num {
  font-weight: 700;
  font-size: var(--fs-num);
  line-height: 1.3;
  white-space: nowrap;
}

.counter__num sup,
.lifetime__num sup {
  font-size: clamp(16px, 2.08vw, 40px);
  /* top, а не super: super сдвигает на фиксированную долю от базовой линии
     и не совпадает с верхним краем цифр при таком масштабе шрифта */
  vertical-align: top;
  line-height: 1;
}

/* Толчок в такт удару (см. beat() в script.js) применяется только к самой
   цифре, не к звёздочке. inline-block нужен, чтобы transform вообще
   применялся — на inline-элементах он игнорируется браузером.
   Точка опоры — правый верхний угол, вплотную к звёздочке: цифра растёт
   влево и вниз, от звёздочки, а не в её сторону */
.counter__value {
  display: inline-block;
  transform-origin: 100% 0;
}

.counter__caption {
  font-weight: 700;
  font-size: var(--fs-h2);
  line-height: 1.3;
}

.counter__share {
  position: absolute;
  top: 50%;
  right: clamp(12px, 2.34vw, 45px);
  width: clamp(56px, 6.46vw, 124px);
  transform: translateY(-50%);
}
.counter__share img { width: 100%; height: auto; }

/* ---------- Девочка + факт ---------- */
.fact {
  max-width: 1500px;
  display: flex;
  align-items: center;
  flex-direction: row;
  gap: clamp(24px, 5.47vw, 105px);
  margin-top: clamp(48px, 5.68vw, 109px);
}

.fact__pic {
  flex: 0 0 clamp(180px, 27.92vw, 536px);
  aspect-ratio: 536 / 528;
  border-radius: 8px;
}

.fact__side {
  flex-grow: 1;
}

.fact__text {
  font-size: var(--fs-lead);
  line-height: 1.3;
}

/* ---------- Результат ---------- */
.result {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  width: 100%;
}

.progress,
.donate,
[data-type='mixplat-stat'] {
  width: min(100%, 813px);
  border-radius: clamp(14px, 1.25vw, 24px);
}

.progress {
  padding: 5px;
  background: #f6ddde;
}

.progress__track {
  position: relative;
  overflow: hidden;
  border-radius: clamp(12px, 1.09vw, 21px);
  background: #ffedef;
}

.progress__bar {
  display: flex;
  align-items: center;
  width: var(--value, 42%);
  min-width: max-content;
  padding: clamp(12px, 2.24vw, 43px) clamp(14px, 1.35vw, 26px);
  font-family: var(--inter);
  font-size: clamp(15px, 1.54vw, 29.6px);
  line-height: 1;
  color: #fff;
  white-space: nowrap;
  background: var(--red);
  border-radius: clamp(12px, 1.09vw, 21px);
}
.progress__bar b { font-weight: 600; padding-left: .3em; }

.result__pulse {
  margin-top: clamp(24px, 3.12vw, 60px);
  font-weight: 700;
  font-size: clamp(20px, 2.5vw, 48px);
  line-height: 1.3;
  color: var(--red);
  text-align: center;
}

.donate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(12px, 1.5vw, 30px);
  margin-top: clamp(16px, 1.61vw, 31px);
  padding: clamp(12px, 1.77vw, 34px) clamp(14px, 1.82vw, 35px);
  background: #fff;
}

.donate__label {
  display: block;
  flex: 1;
  margin-top: 0;
  font-size: clamp(16px, 1.67vw, 32px);
  line-height: 1.2;
  text-align: center;
}

.donate__btn { flex: 0 0 auto; width: clamp(38px, 3.33vw, 64px); }
.donate__btn img { width: 100%; height: auto; }
.donate__btn[disabled] { opacity: .35; cursor: default; }

/* ---------- Спасибо ---------- */
.thanks {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: clamp(48px, 5.83vw, 112px);
  margin-bottom: clamp(48px, 5.83vw, 112px);
}

.thanks__art { width: min(100%, 1125px); }
.thanks__art img { width: 100%; height: auto; }

.thanks__card {
  position: relative;
  width: min(100%, 1043px);
  margin-top: max(-107px, -5.58vw);
  padding: clamp(16px, 1.75vw, 33.6px) clamp(16px, 2vw, 40px) clamp(18px, 2.6vw, 50px);
  text-align: center;
  background: rgba(255, 255, 255, .3);
  border: 1.05px solid var(--red);
  border-radius: clamp(14px, 1.31vw, 25.19px);
  backdrop-filter: blur(2px);
}

.thanks__title {
  font-weight: 700;
  font-size: clamp(26px, 2.62vw, 50.38px);
  line-height: 1;
  color: var(--red);
}

.thanks__text {
  margin-top: clamp(10px, 1.2vw, 23px);
  font-size: clamp(13px, 1.31vw, 25.19px);
  line-height: 1.2;
}

.thanks__link {
  display: inline-block;
  margin-top: clamp(12px, 1.4vw, 27px);
  font-weight: 700;
  font-size: clamp(14px, 1.31vw, 25.19px);
  line-height: 1.2;
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.thanks__back {
  display: inline-flex;
  margin-top: clamp(16px, 1.6vw, 32px);
}

/* ---------- Карточки-факты ---------- */
.facts {
  position: relative;
  margin-top: clamp(48px, 5.2vw, 100px);
  padding-bottom: clamp(60px, 10.4vw, 200px);
}

.facts__stage { position: relative; }

/* Декоративная волна за карточками */
.facts__wave {
  position: absolute;
  left: 5.47%;
  top: min(84px, 4.4vw);
  width: 81.82%;
  height: auto;
  transform: scaleX(-1);
  pointer-events: none;
}

.facts__wave img {
  display: block;
  width: 100%;
  height: 100%;
}

.facts__track {
  position: relative;
  z-index: 1;
  display: flex;
  gap: clamp(24px, 5.1vw, 98px);
  margin: 0;
  padding: 0 clamp(16px, 6.63vw, 127px);
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: clamp(16px, 6.63vw, 127px);
  scrollbar-width: none;
}
.facts__track::-webkit-scrollbar { display: none; }

.card {
  /* Все размеры внутри карточки — доли её ширины (макет 615.989 × 440.403).
     Именно от --card-w, а не в % и не в cqw: проценты паддинга считаются
     от контейнера-трека, а cqw — от content-box, которую этот паддинг и задаёт. */
  --card-w: min(615.99px, 88vw);
  position: relative;
  flex: 0 0 var(--card-w);
  aspect-ratio: 615.989 / 440.403;
  padding: calc(var(--card-w) * .1493) calc(var(--card-w) * .0732) 0;
  overflow: hidden;
  background: #fcfcfc;
  border-radius: 23.03px;
  box-shadow: 0 6px 28px rgba(191, 44, 35, .10);
  scroll-snap-align: start;
}
/* Последняя карточка прижимается к правому краю, а не к левому:
   иначе после неё остаётся паддинг-«хвост», в который можно проскроллить
   мимо снап-точки — карусель на свайпе перелетает и дёргается назад */
.facts__track > .card:last-child {
  scroll-snap-align: end;
}

/* Декор карточек: доли от размеров карточки, поэтому масштабируется вместе с ней */
.card__deco {
  position: absolute;
  pointer-events: none;
}
.card__deco > img {
  width: 100%;
  height: 100%;
  max-width: none;
}
/* повёрнутый декор: снаружи bbox, внутри — невращённый слой по центру */
.card__rot {
  display: flex;
  align-items: center;
  justify-content: center;
}
.card__rot > img {
  flex: none;
  max-width: none;
}

.card__title {
  position: relative;
  margin: 0;
  font-family: var(--intro);
  font-weight: 700;
  font-size: calc(var(--card-w) * .053);
  line-height: 1;
  color: #171717;
}

/* доли из макета: 385 / 362 / 309 / 341 / 366 px при ширине карточки 616 */
#fact-2 { --text-w: .588; }
#fact-3 { --text-w: .502; }
#fact-4 { --text-w: .554; }
#fact-5 { --text-w: .594; }

.card__text {
  position: relative;
  max-width: calc(var(--card-w) * var(--text-w, .625));
  margin-top: calc(var(--card-w) * .0283);
  font-family: var(--os);
  font-size: calc(var(--card-w) * .0296);
  line-height: 1.632;
  color: #202020;
}

/* Пагинация */
.facts__nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.3vw, 25px);
  margin-top: clamp(24px, 2.08vw, 40px);
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: clamp(38px, 3.18vw, 61px);
  aspect-ratio: 1;
  border-radius: 50%;
}
.nav-btn img { width: 36%; height: auto; }
.nav-btn--prev { background: #fff; border: 1px solid rgba(0, 0, 0, .24); }
.nav-btn--prev img { transform: scaleX(-1); }
.nav-btn--next { background: var(--red); }
.nav-btn[disabled] { cursor: default; }

/* Точки-индикаторы: только в мобильном макете, на десктопе достаточно стрелок */
.facts__dots { display: none; }

.facts__dot {
  width: calc(7 * var(--px));
  height: calc(7 * var(--px));
  padding: 0;
  background: #f0c5c2;
  border-radius: 50%;
  transition: background-color .2s;
}
.facts__dot.is-active { background: var(--red); }

/* Декор возле пагинации */
.facts__heart,
.facts__girl {
  position: absolute;
  pointer-events: none;
}
.facts__heart {
  top: min(39px, 2.03vw);
  right: 9.63%;
  width: 4.49%;
  transform: rotate(3.6deg);
}
.facts__heart img { width: 100%; height: auto; }
.facts__girl {
  top: min(61px, 3.18vw);
  right: 3.9%;
  width: 7.34%;
  aspect-ratio: 141 / 198;
  overflow: hidden;
  transform: scaleX(-1);
}
.facts__girl img {
  position: absolute;
  left: -90.25%;
  top: -108.9%;
  width: 292.81%;
  height: 208.9%;
  max-width: none;
}

/* ---------- Красный блок «за всю жизнь» ---------- */
.lifetime {
  position: relative;
  padding: clamp(28px, 2.4vw, 46px) clamp(16px, 4vw, 76px) clamp(32px, 3.4vw, 65px);
  overflow: hidden;
  color: #fff;
  text-align: center;
  background: var(--red);
}

.lifetime__hearts {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.lifetime__hearts img {
  position: absolute;
  width: 5.27%;
  height: auto;
  mix-blend-mode: multiply;
}
/* левая и правая колонки декоративных сердец */
.lifetime__hearts img:nth-child(1) { left: 3.77%; top: 6.5%; }
.lifetime__hearts img:nth-child(2) { left: 0.21%; top: 29.3%; }
.lifetime__hearts img:nth-child(3) { left: 3.77%; top: 52.1%; }
.lifetime__hearts img:nth-child(4) { left: 0.21%; top: 74.8%; }
.lifetime__hearts img:nth-child(5) { right: 3.77%; top: 7.4%; }
.lifetime__hearts img:nth-child(6) { right: 0.21%; top: 30.2%; }
.lifetime__hearts img:nth-child(7) { right: 3.77%; top: 53%; }
.lifetime__hearts img:nth-child(8) { right: 0.21%; top: 75.7%; }

.lifetime > *:not(.lifetime__hearts) { position: relative; }

.lifetime__title {
  font-weight: 700;
  font-size: var(--fs-h2);
  line-height: 1.3;
}

.lifetime__text {
  margin-top: clamp(12px, 1.35vw, 26px);
  font-size: clamp(20px, 2.5vw, 48px);
  line-height: 1.1;
}

.lifetime__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 1.8vw, 35px);
  margin: clamp(20px, 2.55vw, 49px) auto 0;
  padding: 6px 10px;
  font-weight: 700;
  font-size: var(--fs-h2);
  line-height: 1.3;
  text-align: left;
  border-radius: 12px;
  transition: background-color .2s;
}
.lifetime__cta:hover { background: rgba(255, 255, 255, .12); }
.lifetime__hash { font-weight: 400; }
.lifetime__cta img { width: clamp(44px, 4.48vw, 86px); height: auto; }

/* ---------- Финальный блок ---------- */
.outro {
  display: grid;
  grid-template-areas: "stack";
  align-items: center;
  padding-top: clamp(40px, 6vw, 116px);
}
.outro > * { grid-area: stack; }

.outro__girl {
  justify-self: start;
  align-self: end;
  width: min(56%, 980px);
  aspect-ratio: 980 / 635;
}

/* текст с логотипом лежат поверх иллюстрации: .outro__girl позиционирован,
   поэтому без z-index он перекрывал бы их */
.outro__row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(24px, 4.9vw, 94px);
  width: 100%;
  padding-left: 21.25%;
}

.outro__text {
  max-width: min(724px, 37.7vw);
  font-weight: 700;
  font-size: var(--fs-h2);
  line-height: 1.3;
  color: var(--red);
}

.outro__logo { width: clamp(160px, 20.36vw, 391px); }
.outro__logo img { width: 100%; height: auto; }

/* ---------- Подвал ---------- */
/* Кардиограмма на кромке подвала — одна фигура (assets/rectangle17.svg,
   viewBox 1922x688): всплеск уходит вверх от кромки, а следом за ним
   отрицательный выступ врезается вниз, в тело подвала.
   Проценты ниже — доли от ширины подвала, поэтому фигура и полоса под
   вырез масштабируются вместе:
     базовая линия  87.586 / 1922 = 4.557%
     низ выреза    135.634 / 1922 = 7.0569%
     глубина выреза 48.048 / 1922 = 2.4999%  */
.footer {
  position: relative;
  /* Полоса, в которую опускается вырез. Собственный фон подвала сюда не
     заходит (background-clip: content-box) — иначе он закрасил бы вырез */
  padding-top: 2.4999%;
  padding-bottom: 0;
  color: #fff;
  background: var(--red);
  background-clip: content-box;
}

/* Отступы подвала переехали внутрь, т.к. падинги самого .footer теперь
   отведены под вырез и вырезаны из фона */
.footer > .container {
  padding-block: clamp(28px, 3.85vw, 74px) clamp(28px, 2.86vw, 55px);
}

.footer::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  /* высота полосы = вся высота волны, от вершины всплеска до дна выреза */
  padding-top: 7.0569%;
  /* поднимаем так, чтобы базовая линия фигуры легла ровно на кромку */
  margin-top: -4.557%;
  background: url("assets/rectangle17.svg") top left / 100% auto no-repeat;
}

.footer__head {
  font-weight: 700;
  font-size: var(--fs-body);
  line-height: 1.3;
}
.footer__head + .footer__lead { margin-top: 1.3em; }
.footer__head strong { font-size: clamp(17px, 1.46vw, 28px); }

.footer__lead {
  font-size: var(--fs-body);
  line-height: 1.3;
}
.footer__lead + .footer__lead { margin-top: 1.3em; }
.footer__lead strong { font-size: clamp(17px, 1.46vw, 28px); }

.footer__note {
  margin-top: clamp(20px, 3.33vw, 64px);
  font-family: var(--os);
  font-weight: 300;
  font-size: clamp(11px, 1.04vw, 20px);
  line-height: 1.3;
  color: #f6ddde;
}

/* ---------- Подвал detis.ru (footernew) — перенесён с detis.ru со стилями ---------- */
.footernew {
  width: 100%;
  background: #f3f3f3;
  display: block;
  vertical-align: top;
  margin: 50px auto 0;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-size: 14px;
  color: #000;
  line-height: 1.4;
}
.footernew .inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  display: table;
  table-layout: fixed;
}
.footernew .cell {
  display: table-cell;
  vertical-align: top;
  padding: 30px 35px;
  width: 38%;
}
.footernew .cell.soc {
  width: 26%;
}
.footernew .cell ul {
  list-style: none;
  margin-top: 16px;
  padding: 0;
}
.footernew .cell div {
  margin-bottom: 20px;
}
.footernew .cell p {
  margin: 0 0 10px;
}
.footernew .cell li {
  margin-bottom: 6px;
}
.footernew .cell a {
  color: #000;
  text-decoration: none;
}
.footernew .cell a:hover {
  text-decoration: underline;
}
.footernew .phone,
.footernew .fphone {
  text-decoration: none;
  display: inline;
}
.footernew .social {
  position: relative;
  margin: 0;
}
.footernew .social a {
  display: inline-block;
  width: 30px;
  height: 30px;
  margin-right: 5px;
  vertical-align: top;
  text-decoration: none;
  border: 0;
  background-repeat: no-repeat;
  background-position: left top;
  background-size: cover;
}
.footernew .social a.vk_new {
  background-image: url("assets/footer-vk.svg");
}
.footernew .social a.tg_new {
  background-image: url("assets/footer-tg.svg");
}
.footernew .social a.ok_new {
  background-image: url("assets/footer-ok.svg");
}

@media screen and (max-width: 1024px) {
  .footernew .cell,
  .footernew .cell.soc {
    width: 33%;
  }
}
@media screen and (max-width: 780px) {
  .footernew .cell {
    display: block;
    padding: 10px 20px;
    width: 87%;
  }
  .footernew .cell.soc {
    width: 87%;
  }
  .footernew .cell div {
    margin-bottom: 0;
  }
  .footernew .inner {
    display: block;
  }
}

/* ---------- Адаптив ---------- */
@media (max-width: 1100px) {
  .facts__wave,
  .facts__heart,
  .facts__girl { display: none; }

  .facts { padding-bottom: clamp(40px, 6vw, 80px); }

  .outro {
    grid-template-areas: "girl" "row";
    justify-items: center;
    gap: 24px;
    /* запас под всплеск кардиограммы на кромке подвала */
    padding-bottom: calc(24px + 4.6%);
  }
  .outro__girl { grid-area: girl; width: min(80%, 620px); justify-self: center; }
  .outro__row {
    grid-area: row;
    justify-content: center;
    padding-left: 0;
    flex-wrap: wrap;
    text-align: center;
  }
  .outro__text { max-width: none; text-align: center; }
}

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

  .fact { flex-direction: column; text-align: center; }
  .fact__pic { flex: 0 0 auto; width: min(80%, 420px); }

  .counter { padding-inline: clamp(16px, 5vw, 60px); }
  .counter__share {
    position: static;
    margin: 20px auto 0;
    transform: none;
  }
}

/* ================================================================== */
/* Мобильный макет (Figma, эталон 390 × 4098)                          */
/* Все размеры — calc(N * var(--px)), где N — число из макета.          */
/* Кегли, которые в макете уже на пределе читаемости (12px и мельче),   */
/* заданы фиксированно, чтобы не уезжать вниз на узких экранах.         */
/* ================================================================== */
@media (max-width: 640px) {
  :root {
    --px: calc(min(100vw, 430px) / 390);
    --gutter: calc(24 * var(--px));
    --fs-lead: calc(20 * var(--px));
  }

  .br-lg { display: none; }

  /* ---------- Шапка ---------- */
  /* У шапки поля уже, чем у остального контента: 16px против 24px */
  .header {
    --gutter: calc(16 * var(--px));
    padding-block: calc(15 * var(--px)) 0;
  }
  .header__logo img { height: calc(39 * var(--px)); width: auto; }

  .header__help { gap: calc(20 * var(--px)); }
  .header__help span {
    display: inline;
    font-size: calc(14 * var(--px));
  }
  .header__help img { width: calc(36 * var(--px)); }

  /* Кардиограмма встаёт в поток: отрицательный margin поднимает её так,
     чтобы горизонтальная линия фигуры (64.75% её высоты) легла на кромку
     шапки. Растягиваем по высоте — в SVG стоит preserveAspectRatio="none" */
  .header__pulse {
    position: static;
    width: 102%;
    height: calc(48 * var(--px));
    margin-left: -1%;
    margin-top: calc(-18 * var(--px));
    transform: none;
  }

  /* ---------- Первый экран ---------- */
  .hero { margin-top: calc(20 * var(--px)); }
  .hero__title { width: calc(290 * var(--px)); margin-inline: 0; }
  .hero__lead {
    margin-top: calc(28 * var(--px));
    line-height: 1.2;
  }
  .hero__heart { width: calc(21 * var(--px)); }
  .hero__sub {
    margin-top: calc(48 * var(--px));
    line-height: 1.2;
    text-align: left;
  }

  /* ---------- Шаги: каждый шаг — отдельная карточка ---------- */
  .steps { margin-top: calc(44 * var(--px)); }

  .steps__list {
    grid-template-columns: minmax(0, 1fr);
    /* Отступ между карточками задаётся не через gap, а margin-bottom
       у самой карточки (см. .step ниже) — так у схлопывающихся шагов
       отступ анимируется вместе с высотой и не «дёргает» соседей */
    gap: 0;
  }

  .step:not(:last-child) { margin-bottom: calc(12 * var(--px)); }

  /* Заголовок-переключатель: по умолчанию инструкция (шаги 1-3) свёрнута */
  .steps__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: calc(6 * var(--px));
    margin: 0 auto calc(16 * var(--px));
    font-family: var(--os);
    font-size: calc(13 * var(--px));
    color: #7a7a7a;
  }
  .steps__toggle-icon {
    width: calc(10 * var(--px));
    height: auto;
    transition: transform .2s ease;
  }
  .steps__toggle[aria-expanded="true"] .steps__toggle-icon {
    transform: rotate(180deg);
  }

  /* Схлопывающиеся карточки шагов 1-3: высота, отступы и прозрачность
     анимируются из JS (steps-toggle); здесь только свёрнутое состояние
     по умолчанию — на случай, если скрипт не выполнится */
  .step.step--collapsible {
    display: none;
    overflow: hidden;
    transition:
      height .3s ease,
      opacity .3s ease,
      margin-bottom .3s ease,
      padding-top .3s ease,
      padding-bottom .3s ease;
  }

  /* Колонки карточки: бейдж | иллюстрация | текст.
     Первая строка нужна только третьему шагу (часы и «60 секунд» над
     иллюстрацией); у остальных она схлопывается в ноль, и иллюстрация
     центрируется по всей высоте карточки, как в макете. */
  .step {
    display: grid;
    grid-template-columns: calc(45 * var(--px)) calc(112 * var(--px)) minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    gap: 0;
    min-height: calc(109 * var(--px));
    padding: calc(5 * var(--px)) calc(16 * var(--px)) calc(12 * var(--px)) calc(5 * var(--px));
    background: #fff;
    border: 1px solid #f0eeed;
    border-radius: calc(16 * var(--px));
  }

  /* .step__head — не бокс, а «прозрачная» обёртка: её дети становятся
     ячейками сетки самой карточки */
  .step__head { display: contents; }

  .step__num {
    grid-area: 1 / 1 / 3 / 2;
    align-self: start;
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(32 * var(--px));
    height: calc(32 * var(--px));
    font-family: var(--os);
    font-weight: 700;
    font-size: calc(16 * var(--px));
    line-height: 1;
    color: var(--red);
    background: #fbecef;
    border-radius: 50%;
  }

  /* Часы и подпись делят одну ячейку сетки, разойдясь по её краям */
  .step__clock {
    grid-area: 1 / 2 / 2 / 3;
    justify-self: start;
    width: calc(28 * var(--px));
    margin-left: calc(28 * var(--px));
  }
  .step__hint {
    grid-area: 1 / 2 / 2 / 3;
    justify-self: end;
    font-size: calc(10 * var(--px));
  }

  .step__pic {
    grid-area: 2 / 2 / 3 / 3;
    justify-content: flex-end;
    min-height: 0;
  }
  .step__pic--1 .step__figure { width: calc(112 * var(--px)); }
  .step__pic--2 .step__figure { width: calc(103 * var(--px)); }
  .step__pic--3 .step__figure { width: calc(101 * var(--px)); }

  .step__text {
    grid-area: 1 / 3 / 3 / 4;
    align-self: center;
    margin-top: 0;
    padding-top: 0;
    padding-left: calc(31 * var(--px));
    font-size: 12px;
    line-height: 1.25;
  }

  /* ---------- Шаг 4: отсчёт минуты ---------- */
  /* Боковые колонки одинаковой ширины — «60 секунд» стоит по центру
     карточки, а бейдж прижат к её левому верхнему углу */
  .step--timer {
    grid-template-columns: calc(45 * var(--px)) minmax(0, 1fr) calc(45 * var(--px));
    row-gap: calc(6 * var(--px));
    min-height: 0;
    padding-bottom: calc(17 * var(--px));
  }

  .step__ring {
    grid-area: 1 / 2 / 2 / 3;
    align-items: baseline;
    gap: calc(6 * var(--px));
    width: auto;
    height: auto;
    margin: 0;
  }
  .step__ring.is-running {
    align-items: center;
    height: calc(100 * var(--px));
  }
  .step__ring.is-running .step__ring-svg {
    width: calc(100 * var(--px));
    height: calc(100 * var(--px));
  }

  .step__ring-value {
    font-family: var(--intro);
    font-weight: 400;
    font-size: calc(100 * var(--px));
  }
  .step__ring-unit {
    display: block;
    font-weight: 700;
    font-size: calc(24 * var(--px));
    line-height: 1;
    color: var(--red);
  }
  .step__ring.is-running .step__ring-unit { display: none; }

  /* Кнопка отбита от краёв карточки одинаково слева и справа: слева
     добавляем разницу между узким полем под бейдж и правым полем */
  .step--timer .btn {
    grid-column: 1 / -1;
    margin-left: calc(12 * var(--px));
  }
  .step__reset,
  .step__status { grid-column: 1 / -1; }

  .btn {
    padding: calc(13 * var(--px)) calc(16 * var(--px));
    font-size: calc(14 * var(--px));
    border-width: 1px;
    border-radius: calc(10 * var(--px));
  }

  /* ---------- Форма ---------- */
  /* Поля занимают всю ширину. Важно не переключать .form в column:
     в колонке flex-basis у .field-wrap читается как высота */
  .form {
    margin-top: calc(29 * var(--px));
    gap: calc(11 * var(--px));
  }
  .field-wrap { flex: 0 0 100%; }

  .field {
    padding-block: calc(17 * var(--px));
    padding-inline: calc(40 * var(--px));
    border-width: 1px;
    border-color: #eae5e2;
    border-radius: calc(16 * var(--px));
  }
  /* В мобильном макете у поля нет красной подчёркивающей линии */
  .field__input {
    padding-bottom: 0;
    font-size: calc(12 * var(--px));
    border-bottom: 0;
  }
  .field__input::placeholder { color: #b6aeaa; opacity: 1; }
  .field__picker { width: calc(20 * var(--px)); right: calc(14 * var(--px)); }

  .form__submit { margin-top: calc(4 * var(--px)); }
  .form__submit .btn { width: 100%; }

  /* ---------- Красный счётчик ---------- */
  /* Число и кнопка «поделиться» — одна центрированная строка, подпись под
     ними на всю ширину: сетка вместо абсолютного позиционирования */
  .counter {
    display: grid;
    grid-template-columns: auto auto;
    justify-content: center;
    align-items: center;
    column-gap: calc(14 * var(--px));
    row-gap: calc(7 * var(--px));
    margin-top: calc(48 * var(--px));
    padding: calc(45 * var(--px)) var(--gutter) calc(38 * var(--px));
    border-radius: 0;
  }
  .counter__num {
    grid-area: 1 / 1 / 2 / 2;
    font-size: calc(42 * var(--px));
    line-height: 1;
  }
  .counter__num sup { font-size: calc(16 * var(--px)); }
  .counter__share {
    grid-area: 1 / 2 / 2 / 3;
    position: static;
    width: calc(36 * var(--px));
    margin: 0;
    transform: none;
  }
  .counter__caption {
    grid-area: 2 / 1 / 3 / 3;
    max-width: calc(230 * var(--px));
    margin-inline: auto;
    font-size: calc(16 * var(--px));
    line-height: 1.125;
  }

  /* ---------- Факт про детское сердце ---------- */
  /* В мобильном макете девочки нет — текст лежит поверх розового сердца */
  .fact {
    gap: calc(24 * var(--px));
    margin-top: calc(47 * var(--px));
    text-align: center;
  }
  .fact__pic { display: none; }
  .fact__text {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(224 * var(--px));
    padding: calc(36 * var(--px)) calc(12 * var(--px));
    line-height: 1.2;
    text-align: center;
    background: url(assets/fact-heart.png) center / contain no-repeat;
  }

  /* ---------- Результат ---------- */

  .progress { padding: 0; background: none; }
  .progress__track { background: #f7dcde; border-radius: calc(16 * var(--px)); }
  .progress__bar {
    padding: calc(21 * var(--px)) calc(18 * var(--px));
    font-size: calc(13 * var(--px));
    border-radius: calc(16 * var(--px));
  }

  .result__pulse {
    margin-top: calc(26 * var(--px));
    font-size: calc(18 * var(--px));
  }

  .donate {
    flex-wrap: nowrap;
    gap: calc(9 * var(--px));
    margin-top: 0;
    padding: 22px 0;
    background: none;
  }
  .donate__btn { width: calc(31 * var(--px)); padding: 0; }
  .donate__label {
    padding: calc(22 * var(--px)) calc(8 * var(--px));
    font-size: calc(13 * var(--px));
    line-height: 1.15;
    border-radius: calc(14 * var(--px));
  }

  /* ---------- Спасибо ---------- */
  .thanks { margin-top: calc(39 * var(--px)); }
  /* Иллюстрация в макете чуть шире экрана — выпускаем её за поля контейнера */
  .thanks__art {
    width: calc(100% + var(--gutter) * 2 + 8 * var(--px));
    margin-inline: calc(-1 * var(--gutter) - 4 * var(--px));
  }
  .thanks__card {
    width: calc(341 * var(--px));
    margin-top: calc(-50 * var(--px));
    padding: calc(11 * var(--px)) calc(16 * var(--px)) calc(14 * var(--px));
    border-radius: calc(14 * var(--px));
  }
  .thanks__title { font-size: calc(25 * var(--px)); }
  .thanks__text {
    margin-top: calc(8 * var(--px));
    font-size: calc(12 * var(--px));
    line-height: 1.25;
  }
  .thanks__link { margin-top: calc(10 * var(--px)); font-size: calc(12 * var(--px)); }
  .thanks__back { margin-top: calc(14 * var(--px)); }

  /* ---------- Карточки-факты ---------- */
  .facts {
    margin-top: calc(48 * var(--px));
    padding-bottom: calc(22 * var(--px));
  }

  /* Волна в мобильном макете лежит не за карточками, а под ними —
     ставим её в поток колонкой, без абсолютного позиционирования */
  .facts__stage { display: flex; flex-direction: column; }
  .facts__track { order: 1; }
  .facts__wave {
    display: block;
    order: 2;
    position: static;
    width: 100%;
    height: calc(67 * var(--px));
    margin-top: calc(6 * var(--px));
  }

  /* Видна кромка следующей карточки — блок читается как листаемый */
  .facts__track {
    gap: calc(11 * var(--px));
    padding-inline: var(--gutter);
    scroll-padding-inline: var(--gutter);
  }
  .card {
    --card-w: calc(341 * var(--px));
    aspect-ratio: auto;
    min-height: calc(244 * var(--px));
  }
  /* На узком экране пропорции макета дали бы нечитаемый кегль */
  .card__text {
    max-width: none;
    font-size: 12px;
    line-height: 1.55;
  }

  /* Пагинация: боковые колонки одинаковой ширины держат стрелки с точками
     по центру, а сердце-декор живёт в правой колонке и не сдвигает их */
  .facts__nav {
    display: grid;
    grid-template-columns: 1fr auto auto auto 1fr;
    gap: 0;
    margin-top: calc(7 * var(--px));
  }
  .nav-btn--prev { grid-column: 2; }
  .nav-btn--next { grid-column: 4; }
  .nav-btn { width: calc(34 * var(--px)); }

  .facts__dots {
    grid-column: 3;
    display: flex;
    align-items: center;
    gap: calc(6 * var(--px));
    margin-inline: calc(30 * var(--px));
  }

  .facts__heart {
    grid-column: 5;
    display: block;
    position: static;
    justify-self: start;
    width: calc(23 * var(--px));
    margin-left: calc(40 * var(--px));
    transform: rotate(37.26deg);
  }

  /* ---------- Красный блок «за всю жизнь» ---------- */
  .lifetime {
    padding: calc(34 * var(--px)) var(--gutter) calc(29 * var(--px));
  }
  .lifetime__hearts { display: none; }
  .lifetime__title { font-size: calc(18 * var(--px)); line-height: 1.2; }
  .lifetime__num {
    margin-top: calc(6 * var(--px));
    font-size: calc(46 * var(--px));
    line-height: 1;
  }
  .lifetime__num sup { font-size: calc(18 * var(--px)); }
  .lifetime__text {
    margin-top: calc(8 * var(--px));
    font-size: calc(16 * var(--px));
    line-height: 1.2;
  }
  .lifetime__cta {
    justify-content: space-between;
    gap: calc(12 * var(--px));
    width: 100%;
    margin-top: calc(34 * var(--px));
    padding: 0;
    font-size: calc(18 * var(--px));
  }
  .lifetime__cta img { width: calc(38 * var(--px)); }

  /* ---------- Финальный блок ---------- */
  .outro {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding-top: calc(32 * var(--px));
    padding-bottom: calc(96 * var(--px));
  }
  .outro__girl { width: calc(383 * var(--px)); }
  .outro__row { gap: calc(37 * var(--px)); }
  .outro__text { font-size: calc(24 * var(--px)); line-height: 1.1; }
  .outro__logo { width: calc(184 * var(--px)); }

  /* ---------- Подвал ---------- */
  .footer > .container {
    padding-block: calc(33 * var(--px)) calc(48 * var(--px));
  }
  .footer__lead { font-size: calc(14 * var(--px)); line-height: 1.2; }
  .footer__lead strong { font-size: inherit; }
  .footer__note {
    margin-top: calc(26 * var(--px));
    font-size: calc(10 * var(--px));
    line-height: 1.3;
  }
}

/* ================================================================== */
/* Экраны, которые открываются после расчёта                           */
/* ================================================================== */

/* hidden должен побеждать display у секций (.result/.counter/.thanks) */
[hidden] { display: none !important; }

/* Мягкое появление разблокированных экранов */
.counter,
.result,
.thanks,
.lifetime { animation: reveal .5s ease both; }

@keyframes reveal {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

.nav-btn[disabled] { opacity: .4; }

/* ================================================================== */
/* Модальные окна                                                      */
/* ================================================================== */
body.is-modal-open { overflow: hidden; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
}

.modal__dialog {
  position: relative;
  width: min(100%, 560px);
  max-height: 100%;
  margin: auto;
  padding: clamp(24px, 3vw, 44px) clamp(18px, 2.4vw, 36px) clamp(20px, 2.4vw, 34px);
  overflow-y: auto;
  text-align: center;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .28);
  animation: reveal .3s ease both;
}

.modal__close {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 44px;
  height: 44px;
  font-size: 32px;
  line-height: 1;
  color: #8a8a8a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal__close:hover { color: var(--red); background: #f6f0f0; }

.modal__title {
  padding-inline: 34px;
  font-weight: 700;
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.2;
  color: var(--red);
}

.modal__lead {
  margin-top: 12px;
  font-family: var(--os);
  font-size: clamp(14px, 1.6vw, 17px);
  line-height: 1.5;
  color: #3a3a3a;
}
.modal__lead b { color: var(--red); white-space: nowrap; }

/* Варианты минут: 1 минута — 72 ₽, 2 минуты — 144 ₽, 3, 5, 10 минут */
.minutes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: clamp(18px, 2.2vw, 26px);
}

.minutes__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 10px;
  font-family: var(--os);
  background: #fff;
  border: 2px solid #e2d3d3;
  border-radius: 14px;
  transition: border-color .2s, background-color .2s;
}
.minutes__item:hover { border-color: var(--red); }
.minutes__item.is-active { border-color: var(--red); background: #fdf1f0; }

.minutes__count { font-size: 15px; line-height: 1.2; color: #3a3a3a; }
.minutes__sum {
  font-weight: 700;
  font-size: 20px;
  line-height: 1.2;
  color: var(--red);
  white-space: nowrap;
}

/* У «выбрать время» нет суммы — центрируем надпись по высоте соседних плиток */
.minutes__item--custom { justify-content: center; }
.minutes__item--custom .minutes__count {
  /* font-weight: 600; */
  color: #3a3a3a;
}

/* Поле своего значения раскрывается под плитками */
.custom-time {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 12px 16px;
  font-family: var(--os);
  background: #fdf1f0;
  border-radius: 14px;
}

.custom-time__label {
  font-size: 15px;
  line-height: 1.3;
  color: #3a3a3a;
}

.custom-time__input {
  width: 96px;
  padding: 6px 10px;
  font-family: var(--os);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.2;
  color: #3a3a3a;
  text-align: center;
  background: #fff;
  border: 2px solid #e2d3d3;
  border-radius: 10px;
  transition: border-color .2s;
}
.custom-time__input:focus { border-color: var(--red); outline: none; }

.modal__sum {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: clamp(18px, 2.2vw, 26px);
  padding: 14px 18px;
  font-family: var(--os);
  font-size: 16px;
  background: #f8f2f2;
  border-radius: 14px;
}
.modal__sum b {
  font-family: var(--intro);
  font-size: clamp(22px, 3vw, 28px);
  color: var(--red);
  white-space: nowrap;
}

.pay-slot {
  margin-top: 16px;
  padding: 16px;
  font-family: var(--os);
  font-size: 15px;
  line-height: 1.4;
  color: #6a6a6a;
  background: #f6f6f6;
  border: 1px dashed #c9c9c9;
  border-radius: 14px;
}

#mixplat_widget { margin-top: 18px; }

.modal__note {
  margin-top: 14px;
  font-family: var(--os);
  font-size: 13px;
  line-height: 1.5;
  color: #8a8a8a;
}

/* ---------- Share-карточка ---------- */
.modal__dialog--share { width: min(100%, 480px); }

/* Заголовок «Ваша карточка» — на одном уровне с крестиком.
   Крестик: absolute, top 8px, высота 44px → центр на 30px от края диалога.
   Диалогу убираем верхний паддинг, а .modal__scroll даёт свои 8px —
   заголовок с min-height 44px и flex-центровкой попадает ровно в тот же центр. */
.modal__dialog--share { padding-top: 0; }
.modal__dialog--share .modal__title {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding-inline: 48px;
}

/* Прокрутка вынесена во внутренний контейнер, чтобы скруглённые углы
   попап-окна оставались нетронутыми (иначе в Firefox полоса прокрутки
   «съедает» угол). */
.modal__dialog--share {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal__scroll {
  overflow-y: auto;
  min-height: 0;
  overscroll-behavior: contain;
  padding: 8px;
}
.modal__scroll::-webkit-scrollbar {
  width: 8px;
}
.modal__scroll::-webkit-scrollbar-track {
  margin: 20px 0;
  background: transparent;
}
.modal__scroll::-webkit-scrollbar-thumb {
  background: rgba(191, 44, 35, .55);
  border-radius: 999px;
}
.modal__scroll::-webkit-scrollbar-thumb:hover {
  background: var(--red);
}
/* Firefox (не Chromium: там scrollbar-width отключает ::-webkit-scrollbar) */
@supports (-moz-orient: inline) {
  .modal__scroll {
    scrollbar-width: thin;
    scrollbar-color: rgba(191, 44, 35, .55) transparent;
  }
}

.share-preview {
  /* Карточка вертикальная (1080×1920), поэтому ограничиваем её по высоте:
     ширину высчитает aspect-ratio, и превью не распирает поп-ап */
  margin: 18px auto 0;
  height: min(56vh, 460px);
  max-width: 100%;
  background: #f4f4f4;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 1080 / 1920;
}
.share-preview img { width: 100%; height: 100%; object-fit: contain; }

.share-text {
  margin-top: 16px;
  font-family: var(--os);
  font-size: 15px;
  line-height: 1.5;
  color: #3a3a3a;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}
.share-actions .btn {
  flex: 1 1 150px;
  margin-top: 0;
  padding: 14px 18px;
  font-size: 15px;
  text-decoration: none;
}

.share-status {
  margin-top: 12px;
  font-family: var(--os);
  font-size: 14px;
  color: var(--red);
  min-height: 1.2em;
}

@media (max-width: 640px) {
  .modal { align-items: flex-end; padding: 0; }
  .modal__dialog {
    width: 100%;
    max-height: 92vh;
    border-radius: 20px;
  }
  .minutes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .share-actions .btn { flex: 1 1 100%; }
}
