/* ─────────────────────────────────────────────────────────────
   WoolBox — страница подписки
   Дизайн: Figma SkyWool → «Оплата подписки через сайт» (531:1124)
   Токены и размеры — из макета, брейкпоинты 1200 / 768 / 390.
   ───────────────────────────────────────────────────────────── */

:root {
  --text-primary: #17278f;
  --accent-blue:  #3e4fd6;
  --accent-pink:  #f85fb6;
  --nav-active:   #4959c1;

  --border:       #ece8ff;
  --tag-bg:       #dce2ff;
  --icon-bg:      #ded9ff;
  --card-pink:    #ffe1f0;
  --card-blue:    #e0f6ff;
  --card-purple:  #f6e7ff;
  --separator:    rgba(0, 0, 0, .05);

  --hero-tint:    #f2f2fe;

  --text-muted: #747dbc;
  --red:        #ff4d4f;

  --shadow-card: 0 4.122px 16.489px rgba(0, 0, 0, .06);
  --shadow-btn:  0 8px 24px rgba(92, 70, 255, .25);

  --gutter: 60px;
}

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

/* Кнопки «Подключить подписку» и ссылки меню ведут к якорям — плавно, если
   пользователь не просил убрать анимацию. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* Атрибут hidden должен побеждать display из компонентных правил
   (например у .plan, которая display: flex). */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: #fff;
  color: var(--text-primary);
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 800; }
p { margin: 0; }
/* height: auto — чтобы атрибуты width/height в разметке (они нужны против
   сдвигов при загрузке) не ломали пропорции при масштабировании. */
img { display: block; max-width: 100%; height: auto; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section { padding: 32px 0; }

/* Заголовки и подводки — 31/37 и 16/22: ширины строк совпадают с макетом. */
.section__title { font-size: 31px; line-height: 37px; }
.section__lead  { font-size: 16px; font-weight: 400; line-height: 22px; margin-top: 4px; }

/* ───── КНОПКИ ───── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;          /* все основные кнопки в макете — 38 */
  padding: 11px 18px;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, opacity .15s;
  -webkit-tap-highlight-color: transparent;
}

.btn--primary {
  background: var(--accent-blue);
  color: #fff;
  box-shadow: var(--shadow-btn);
}

.btn--primary:hover  { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(92, 70, 255, .32); }
.btn--primary:active { transform: translateY(0); opacity: .9; }

.btn:disabled {
  background: #eceefa;
  color: #59618c;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
  opacity: 1;
}

/* ───── РЕКОНСТРУКЦИЯ ───── */
.maintenance { padding: 24px 0; background: #fafaff; scroll-margin-top: 100px; }
.maintenance__card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 32px 40px;
  border: 1px solid #e0dcfb;
  border-radius: 24px;
  background: linear-gradient(115deg, #f0edff 0%, #fcebf6 65%, #eaf5ff 100%);
}
.maintenance__copy { position: relative; z-index: 1; max-width: 620px; padding-right: 100px; }
.maintenance__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 6px 12px;
  border: 1px solid #d8d4f4;
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  font-size: 12px;
  font-weight: 800;
}
.maintenance__badge span { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-blue); }
.maintenance__title { font-size: clamp(24px, 3.5vw, 36px); line-height: 1.15; }
.maintenance__text { margin-top: 12px; font-size: 16px; line-height: 1.5; }
.maintenance__art { position: absolute; width: 240px; right: 24px; top: 50%; transform: translateY(-50%) rotate(12deg); }
.plans__notice { margin-bottom: 24px; padding: 16px 20px; border: 1px solid var(--border); border-radius: 16px; background: var(--hero-tint); font-size: 15px; line-height: 1.5; }

/* ───── ШАПКА ───── */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 18px;
  padding-bottom: 18px;
  padding-left: 40px;
  padding-right: 40px;
}

.logo { display: flex; align-items: center; gap: 6px; }

.logo__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 9.375px;
  background: linear-gradient(180deg, #acb9f9, #8c9bed);
  overflow: hidden;
}

.logo__mark img { width: 40px; height: 33.2px; }
.logo__text { font-size: 24px; font-weight: 800; }

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

.nav a {
  font-size: 13px;
  font-weight: 600;
  line-height: 20px;
  white-space: nowrap;
  transition: color .15s;
}

.nav a:hover { color: var(--nav-active); }

/* Текст кнопки в шапке никогда не переносится (на 320 — см. мобильный блок). */
.header__cta { flex: none; white-space: nowrap; }

/* ───── HERO ───── */
/* Фон картинок hero — ровно #f2f2fd, поэтому края кадра не видны. */
.hero {
  position: relative;
  height: 500px;
  overflow: hidden;
  background: #f2f2fd;
}

/* Десктоп: кадр 1200×500, как в макете, по контейнеру. На 1024-1199 кадр
   сдвинут влево не больше чем на 50 px — телефон начинается правее текста
   (≈430), справа обрезается только надпись. Шире 1200 кадр не растёт:
   иначе телефон наезжает на текст. */
.hero__art {
  position: absolute;
  bottom: 0;
  left: max(-50px, calc(50% - 600px));
  width: 1200px;
  aspect-ratio: 2400 / 1000;
  background: no-repeat center / 100% 100%;
}

@media (min-width: 600px) {
  .hero__art { background-image: url("assets/landing/hero-composition-v2.webp"); }
}

.hero__inner {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  align-items: center;
}

.hero__copy {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 520px;
  max-width: 100%;
}

.hero__title { font-size: 31px; line-height: 37px; }
/* В макете подводка прижата к заголовку (8), а до кнопки — 20, как gap. */
.hero__lead  { max-width: 380px; margin-top: -12px; font-size: 16px; line-height: 22px; }

.hero__cta { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }

/* ───── ФИЧИ ───── */
/* Шесть карточек по 170 с зазором 12 — ровно 1080, ширина ряда в макете. */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.feature {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
  height: 156px;
  padding: 16px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.feature--pink   { background: var(--card-pink); }
.feature--blue   { background: var(--card-blue); }
.feature--purple { background: var(--card-purple); }

.feature__glow {
  position: absolute;
  top: -31px;
  left: 67px;
  width: 129px;
  height: 123px;
  transform: rotate(15deg);
}

.feature__icon {
  position: absolute;
  top: -27px;
  right: -21px;
  width: 131px;
  height: 131px;
  transform: rotate(10.58deg);
}

.feature__name { position: relative; font-size: 16px; }
.feature__desc { position: relative; font-size: 12px; font-weight: 400; }

/* ───── МАСТЕР-КЛАССЫ ───── */
.mk__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.mk__note {
  font-family: 'Caveat', 'Nunito', cursive;
  font-size: 25px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--accent-blue);
  text-align: center;
  max-width: 410px;
  transform: rotate(-2.59deg);
}

.mk-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12.366px;
}

.mk-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.mk-card__photo { aspect-ratio: 206.107 / 154.58; overflow: hidden; }
.mk-card__photo img { width: 100%; height: 100%; object-fit: cover; }

.mk-card__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 12px;
}

.mk-card__name { font-size: 16px; }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--tag-bg);
  color: var(--accent-blue);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* ───── ТАРИФЫ ───── */
.plans__head { margin-bottom: 20px; }

/* Шапка липкая (77 = 18 + 40 + 18 + 1 бордер): без отступа заголовок
   «Выберите тариф» после перехода по якорю уходит под неё. */
#plans { scroll-margin-top: 77px; }

/* Карточки в макете фиксированной ширины и выровнены по левому краю —
   при выключенном тарифе ряд не должен растягиваться на всю строку. */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 340px));
  justify-content: start;
  gap: 14px;
  align-items: stretch;
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
}

/* Центральная карточка (Figma «Pricing Plan Card / Chosen»): обводка 4 px
   градиентом #DAE2FF → #FFE3FD, в макете — снаружи блока. Отрицательный
   отступ съедает разницу с обычной обводкой 1.5 px, чтобы текст во всех
   карточках стоял на одной линии. Угол градиента в макете не читается —
   подобран по скриншоту. */
.plan--featured {
  margin: -2.5px;
  border: 4px solid transparent;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, #dae2ff, #ffe3fd) border-box;
}

.plan__info {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.plan__naming { display: flex; flex-direction: column; gap: 4px; }
.plan__name { font-size: 20px; line-height: 27px; }
.plan__desc { font-size: 11px; font-weight: 600; line-height: 15px; }

.plan__pricing { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }

/* Плашка над ценой (Figma «Badge / Price»): 24 px, клубок 16 px, градиент
   «Gradient/Benefit». Угол и позиции стопов в макете не читаются — розовый
   слева, оранжевый справа, как на скриншоте. */
.plan__badge {
  margin-bottom: -10px;   /* до цены — 2 */
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 99px;
  background: linear-gradient(90deg, #e985b0, #eb7476 55%, #ee8b49);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 16px;
  white-space: nowrap;
}

.plan__badge-ic { flex: none; width: 16px; height: 16px; }

/* Декор «ВАУ» (Figma «decor / wow-knit», 169×214) в правом верхнем углу
   центральной карточки, обрезан её краем. Точных смещений в макете нет —
   подобраны по скриншоту. Текст карточки лежит поверх декора. */
.plan--featured { overflow: hidden; }
.plan--featured > :not(.plan__decor) { position: relative; }

.plan__decor {
  position: absolute;
  top: -12px;
  right: -40px;
  width: 169px;
  max-width: none;
  pointer-events: none;
}

.plan__price-row { display: flex; align-items: baseline; gap: 4px; }
.plan__price { font-size: 32px; font-weight: 700; line-height: 44px; }

.plan__renew { font-size: 12px; font-weight: 400; line-height: 16px; opacity: .6; }

.plan__sep {
  height: 1px;
  margin: 0;
  border: none;
  border-radius: 9px;
  background: var(--separator);
}

.plan__list { display: flex; flex-direction: column; gap: 6px; }

.plan__list li {
  font-size: 13px;
  font-weight: 600;
  line-height: 20px;
}

.plan__list li::before { content: '✓ '; }

/* Подарок в карточках 3 и 6 месяцев (Figma «Pricing / Gift»). */
.plan__gift {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 13px;
  background: #f4f2fa;
  font-size: 13px;
  font-weight: 600;
  line-height: 20px;
}

.plan__gift-ic { flex: none; width: 22px; height: 22px; }

/* преимущества под тарифами */
.perks {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 20px;
  padding: 8px 0 16px;
}

.perk {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  line-height: 15px;
  font-weight: 600;
}

.perk__ic {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 14px;
  background: var(--icon-bg);
}

.perk__ic img { width: 16px; height: 16px; }

/* ───── СКИДКИ НА ПРЯЖУ ───── */
.promo {
  position: relative;
  overflow: hidden;
}

.promo__art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.promo__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 96px;
  padding-bottom: 104px;
  text-align: center;
}

.promo__title { font-size: 31px; line-height: 37px; }
.promo__lead  { margin: 10px 0 20px; font-size: 16px; font-weight: 400; line-height: 22px; }

.promo__cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

.promo-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 240px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .2);
  box-shadow: 0 4px 64px rgba(0, 0, 0, .06);
  font-size: 13px;
  font-weight: 800;
}

.promo-card span:last-child { font-size: 24px; line-height: 33px; color: var(--accent-pink); }

/* В макете — две строки по центру на всех ширинах. */
.promo__note { max-width: 280px; margin-top: 12px; font-size: 11px; font-weight: 400; line-height: 15px; text-wrap: balance; }

/* Мобильная россыпь декора в «Скидках» и футер-CTA (на десктопе — полосы). */
.decor { display: none; }

/* ───── БЕЗ ПОДПИСКИ ───── */
/* На десктопе иллюстрация 688×276 лежит под текстом справа и уходит к краю
   макета, текст (до 668) — поверх неё. */
.keep { position: relative; overflow: hidden; }
.keep__inner { display: flex; align-items: center; gap: 24px; }

.keep__copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1 0 0;
  flex-direction: column;
  gap: 26px;
  min-width: 0;
  max-width: 668px;
}

.keep-grid { display: flex; flex-wrap: wrap; gap: 16px; }

.keep-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 180px;
  padding: 16px;
  background: #fff;
  border-radius: 15px;
  box-shadow: var(--shadow-card);
}

.keep-card__ic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 18px;
  background: var(--card-purple);
}

.keep-card__ic img { width: 20px; height: 20px; }
.keep-card__name { font-size: 13px; }
.keep-card__desc { font-size: 12px; font-weight: 400; }

.keep__art {
  position: absolute;
  top: 0;
  right: max(0px, calc(50% - 600px));
  width: 688px;
}

/* ───── FAQ ───── */
.faq__cols { display: flex; gap: 24px; margin-top: 20px; }
.faq__col  { flex: 1 0 0; min-width: 0; }

.faq-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.faq-item h3 { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.faq-item p  { font-size: 12px; font-weight: 400; }

/* ───── ФУТЕР-CTA ───── */
.footer-cta {
  position: relative;
  overflow: hidden;
}

.footer-cta__art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.footer-cta__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding-top: 40px;
  padding-bottom: 40px;
  min-height: 280px;
  justify-content: center;
  text-align: center;
}

/* В макете 1200 и 768 — две строки «Новые идеи для вязания / уже в WoolBox»
   (перенос — <br>), на телефоне перенос убран и строки балансируются. */
.footer-cta__title { font-size: 31px; line-height: 37px; text-wrap: balance; }
.footer-cta__lead  { margin: -8px 0 0; font-size: 13px; font-weight: 400; line-height: 18px; }

/* ───── ФУТЕР ───── */
.footer { background: var(--border); }

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding-top: 32px;
  padding-bottom: 32px;
  font-size: 12px;
  line-height: 16px;
}

.footer__docs { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer__docs a { color: var(--accent-blue); text-decoration: underline; }
.footer__requisites { color: var(--text-muted); }

/* ───── ОФОРМЛЕНИЕ ПОДПИСКИ ─────
   Десктоп — модалка 480 с отступами 32, мобильный — шторка снизу (см. медиа). */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, .75);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 480px;
  max-height: 100%;
  overflow-y: auto;
  padding: 32px;
  border-radius: 24px;
  background: #fff;
  transform: translateY(24px);
  transition: transform .3s cubic-bezier(.34, 1.2, .64, 1);
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.modal__head--end { justify-content: flex-end; margin-top: -8px; }

.modal__title { font-size: 22px; font-weight: 800; line-height: 27px; }

.modal__close {
  display: flex;
  flex: none;
  padding: 0;
  border: none;
  background: none;
  color: #232323;
  cursor: pointer;
}

.modal__caption {
  font-size: 12px;
  line-height: 16px;
  color: var(--text-muted);
  text-align: center;
}

.modal__caption a { color: inherit; }

/* Тариф в шапке формы */
.checkout-plan {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border-radius: 20px;
  background: var(--border);
  font-size: 12px;
  line-height: 16px;
}

.checkout-plan__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
}

.checkout-plan__name  { font-size: 18px; font-weight: 800; line-height: 22px; }
.checkout-plan__price { font-size: 22px; font-weight: 800; line-height: 27px; color: var(--accent-blue); white-space: nowrap; }
.checkout-plan__renew { color: var(--text-muted); }

.checkout-form { display: flex; flex-direction: column; gap: 20px; }

/* Поле email */
.field { display: flex; flex-direction: column; gap: 6px; }

.field__label { font-size: 13px; font-weight: 800; line-height: 18px; }

.field__input {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 16px;
  color: var(--text-primary);
  outline: none;
  transition: border-color .2s;
}

.field__input:focus { border-color: var(--accent-blue); }
.field__input.is-error { border-color: var(--red); }

.field__error { font-size: 13px; line-height: 16px; color: var(--red); }
.field__hint  { font-size: 12px; line-height: 16px; color: var(--text-muted); }

/* Согласия */
.consents { display: flex; flex-direction: column; gap: 12px; }

.consent {
  display: flex;
  gap: 10px;
  font-size: 12px;
  line-height: 16px;
  cursor: pointer;
}

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

.consent__box {
  flex: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--text-muted);
  border-radius: 6px;
  transition: background-color .15s, border-color .15s;
}

.consent__input:checked + .consent__box {
  border-color: var(--accent-blue);
  background: var(--accent-blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}

.consent__input:focus-visible + .consent__box { outline: 2px solid var(--accent-blue); outline-offset: 2px; }
.consent__input.is-error + .consent__box { border-color: var(--red); }

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

.consent__error { margin-top: 6px; padding-left: 30px; }

.btn--block { width: 100%; height: 38px; font-size: 14px; }
.btn--primary:disabled { opacity: .6; cursor: default; transform: none; }

/* Экран успеха */
.modal--center { align-items: center; gap: 16px; text-align: center; }
.modal--center .modal__head { align-self: stretch; }

.result-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent-blue);
}

.result-body { font-size: 16px; line-height: 22px; }
.result-body strong { font-weight: 800; overflow-wrap: anywhere; }

/* Бейджи сторов на экране «Аккаунта нет» */
.store-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.store-badge { display: flex; border-radius: 8px; transition: transform .15s; }
.store-badge:hover { transform: translateY(-1px); }
.store-badge:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 2px; }
.store-badge img { display: block; width: 147px; height: auto; }
.success-new__app { display: none; }

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ───── TOAST ───── */
#toast {
  position: fixed;
  bottom: calc(32px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: #1f2937;
  color: #fff;
  padding: 13px 22px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), opacity .3s;
  pointer-events: none;
  z-index: 300;
  max-width: 90vw;
  text-align: center;
  line-height: 1.4;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}

#toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ─────────────────────────────────────────────────────────────
   ПЛАНШЕТ (макет 768)
   ───────────────────────────────────────────────────────────── */
@media (max-width: 1023px) {
  :root { --gutter: 24px; }

  .header__inner { padding-left: 24px; padding-right: 24px; }
  .nav { display: none; }

  .hero { height: 460px; }
  /* Планшет, как в макете 768: тот же кадр во всю высоту hero (460), справа
     обрезан по 84 % ширины — обе модели видны целиком, рукописная надпись
     остаётся за краем. Заголовок слегка заходит на телефон, как в макете.
     Уже 768 кадр уменьшается вместе с экраном, чтобы модели не обрезались,
     а слева его прикрывает затухание в цвет фона — текст остаётся читаемым. */
  .hero__art {
    --hero-art-w: min(137.5vw, 1056px);
    width: var(--hero-art-w);
    left: calc(100% - 0.84 * var(--hero-art-w));
  }
  .hero__copy { width: 340px; }
  .hero__title { font-size: 28px; }
  .hero__lead  { font-size: 15px; }

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

  /* В макете 768 и 390 ряд МК не переносится: карточки по 206 уходят за
     правый край, рукописной подписи нет. */
  .mk__note { display: none; }
  .mk-grid {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 206px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    /* Скроллер во всю ширину экрана, иначе overflow обрезает тени карточек. */
    margin: -8px calc(-1 * var(--gutter)) -16px;
    padding: 8px var(--gutter) 16px;
    scroll-padding: 0 var(--gutter);
  }
  .mk-grid::-webkit-scrollbar { display: none; }
  .mk-card { scroll-snap-align: start; }

  /* Три равные колонки (≈229 на 768, «Pricing Plan Card Mobile»). Поля по
     бокам 18 — чтобы «Успеете связать несколько изделий» влезло в строку. */
  .plan-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .plan { padding: 20px 18px; }
  .plan__badge { white-space: normal; }   /* на 600-700 «Цена на старте запуска» шире карточки */
  .plan__gift { gap: 8px; padding: 10px 12px; font-size: 12px; line-height: 16px; }
  .perks { grid-template-columns: repeat(2, 1fr); }

  .keep__inner { flex-direction: column; align-items: stretch; }
  .keep__copy  { max-width: none; }
  .keep__art   { position: static; width: 100%; max-width: 100%; }

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

/* Узкий планшет (макета нет): текст заходит на телефон сильнее, чем на 768,
   поэтому левая часть кадра уходит в цвет фона. */
@media (min-width: 600px) and (max-width: 767px) {
  .hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #f2f2fd 0, #f2f2fd 40%, rgba(242, 242, 253, 0) 68%);
    pointer-events: none;
  }
}

/* В карточке планшета («Pricing Plan Card Mobile») декора «ВАУ» нет. */
@media (min-width: 600px) and (max-width: 1023px) {
  /* Подводка уже, чтобы не заходить на телефон (в макете 768 она до него не доходит). */
  .hero__lead { max-width: 270px; }
  .plan__decor { display: none; }
}

/* ─────────────────────────────────────────────────────────────
   МОБИЛЬНЫЙ (макет 390)
   ───────────────────────────────────────────────────────────── */
@media (max-width: 599px) {
  :root { --gutter: 16px; }

  .maintenance { padding: 16px 0; }
  .maintenance__card { padding: 24px; border-radius: 20px; }
  .maintenance__copy { padding-right: 0; }
  .maintenance__badge { margin-right: 50px; }
  .maintenance__title { max-width: 240px; }
  .maintenance__art { width: 100px; right: -16px; top: 0; transform: rotate(12deg); z-index: -1; opacity: .65; }
  .maintenance__text { font-size: 15px; }

  .header__inner { padding-left: 16px; padding-right: 16px; gap: 12px; }
  .logo__text    { font-size: 20px; }

  /* Мобильный hero (макет 390, «new bg mobile»): отдельный кадр — только
     телефон, снизу он сам растворяется в фоне; людей и надписи нет. Кадр
     431.5 px на 390 (телефон в макете вылезает за край), уже — пропорционально. */
  .hero {
    display: block;
    height: auto;
    min-height: 544px;
  }

  .hero__art {
    top: 0;
    bottom: auto;
    left: 0;
    width: min(431.5px, 110.64vw);
    aspect-ratio: 863 / 1204;
    background-image: url("assets/landing/hero-phone-v2.webp");
  }

  .hero__inner { padding-top: 269px; padding-bottom: 32px; align-items: flex-start; }
  .hero__copy  { width: 100%; max-width: 350px; gap: 20px; }
  .hero__title { font-size: 31px; }

  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .perks        { grid-template-columns: repeat(2, 1fr); gap: 10px 20px; }

  .plan-grid { grid-template-columns: minmax(0, 340px); justify-content: center; }


  /* Высоты карточек FAQ в макете 390 сходятся при строках 18 / 16. */
  .faq-item h3 { line-height: 18px; }
  .faq-item p  { line-height: 16px; }

  /* «Скидки» и футер-CTA: вместо обрезанных десктопных полос — фон и
     россыпь предметов, координаты из макета 390 (540:3130, 540:3208). */
  .promo__art, .footer-cta__art { display: none; }
  .promo      { background: #fdf1fc; }
  .footer-cta { background: #f2faff; }

  .decor { display: block; position: absolute; inset: 0; pointer-events: none; }
  .decor__item { position: absolute; max-width: none; }

  .promo__d-button { left: calc(50% - 63px); top: -81px;  width: 196px; }
  .promo__d-yarn   { left: -103px;           top: 406px;  width: 247px; }
  .promo__d-heart  { right: -46px;           top: 423px;  width: 206px; }

  .cta__d-heart-1  { left: -63px;            top: 14px;   width: 156px; }
  .cta__d-heart-2  { left: calc(50% - 98px); top: 332px;  width: 156px; }
  .cta__d-button-1 { left: calc(50% - 112px); top: -69px; width: 150px; }
  .cta__d-button-2 { right: -11px;           top: -25px;  width: 150px; }
  .cta__d-button-3 { left: -67px;            top: 224px;  width: 150px; }
  .cta__d-yarn     { right: -96px;           top: 264px;  width: 189px; }

  .promo__inner { padding-bottom: 96px; }
  .promo__cards { flex-direction: column; align-items: center; }

  .footer-cta__inner { padding: 90px 30px; min-height: 380px; }
  .footer-cta__br    { display: none; }

  /* Оформление подписки — шторка снизу, отступы 16 */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal {
    max-width: none;
    max-height: calc(100% - 24px);
    padding: 24px 16px calc(32px + env(safe-area-inset-bottom));
    border-radius: 24px 24px 0 0;
  }

  /* «Аккаунта нет» на телефоне: вместо бейджей — кнопка (макет 540:5596) */
  .store-badges     { display: none; }
  .success-new__app { display: flex; }
}

/* Узкие телефоны (iPhone SE 1-го поколения, 320): логотип и полная надпись
   «Подключить подписку» помещаются в одну строку. */
@media (max-width: 374px) {
  .header__inner { gap: 8px; }
  .logo__mark    { width: 34px; height: 34px; }
  .logo__mark img { width: 34px; height: 28.2px; }
  .logo__text    { font-size: 18px; }
  .header__cta   { padding-left: 12px; padding-right: 12px; }
  .plan__decor   { right: -56px; }    /* спица не задевает «изделий» */
}
