/* ============================================================================
   Happ Plus — лендинг оплаты подписки
   Белый фон, зелёный акцент и Golos Text в стиле myxavpn.net.
   Первый экран: заголовок по центру, тарифы в ряд, форма под ними.
   Порядок: токены · база · кнопки · шапка · герой · секции · чекаут · motion
   ========================================================================= */

/* --- Токены --------------------------------------------------------------- */
:root {
  /* Native landing aliases for the copied Myxa theme and type scale. */
  --bg: var(--background);
  --bg-raise: var(--surface);
  --text: var(--foreground);
  --heading: var(--foreground);
  --faint: var(--muted);
  --line: var(--separator);
  --line-soft: var(--border);
  --accent-hover: color-mix(in oklch, var(--accent) 92%, var(--foreground));
  --accent-deep: var(--accent-foreground);
  --accent-soft: color-mix(in oklab, var(--accent) 8%, var(--background));
  --happ: var(--accent);
  --incy: var(--accent);
  --sale: var(--danger);
  --error: var(--danger);
  --gap-pair: 12px;
  --gap-note: 18px;
  --gap-block: 30px;
  --r-sm: var(--field-radius);
  --r-md: var(--radius);
  --r-lg: 28px;
  --font: var(--font-sans);
  --ease: var(--ease-out-strong);
  /* Myxa's 1040 px content area plus two 16 px gutters. */
  --shell: 1072px;
  --gutter: 16px;
  color-scheme: light;
}

/* --- База ----------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Шапка прижата к верху и перекрывает цель перехода — отступ для якорей */
  scroll-padding-top: 84px;
  /* Не допускаем горизонтальную прокрутку, сохраняя sticky у шапки */
  overflow-x: clip;
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--text-body);
  line-height: var(--text-body--line-height);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* overflow-x здесь не ставить: он делает body контейнером прокрутки,
     и position: sticky у шапки перестаёт работать. */
}

h1,
h2,
h3,
p,
ul,
ol,
figure {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 700;
  text-wrap: balance;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 0.25em;
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 6px;
}

::selection {
  background: var(--accent);
  color: var(--accent-deep);
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-deep);
  border-radius: var(--r-sm);
  transition: top 0.2s var(--ease);
}

.skip-link:focus-visible {
  top: 12px;
}

/* --- Кнопки --------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 24px;
  border: 0;
  border-radius: 24px;
  background-color: transparent;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 150ms var(--ease), box-shadow 150ms var(--ease);
}

.btn:active {
  opacity: 0.9;
}

.btn--primary {
  height: 48px;
  color: var(--accent-foreground);
}

.btn--primary:hover {
  background-color: var(--accent-hover);
}

.btn--lg {
  min-height: 48px;
  padding: 0 28px;
  font-size: 16px;
  font-weight: 600;
}

.btn__arrow {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.15s;
}

.btn:hover .btn__arrow {
  transform: translateX(3px);
}

.btn--block {
  width: 100%;
  min-width: 0;
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: var(--disabled-opacity);
  box-shadow: none;
}

.btn[disabled] { pointer-events: none; }
.btn[aria-disabled="true"] { cursor: not-allowed; transform: none; }

/* --- Шапка ---------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--line-soft);
  transition: box-shadow 0.2s var(--ease);
}

.topbar.is-stuck {
  box-shadow: 0 1px 0 var(--line-soft);
}

.topbar__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 32px;
  height: 72px;
}

.wordmark {
  width: fit-content;
  color: var(--heading);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
}

.topbar__nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.topbar__nav a {
  font-size: 14px;
  font-weight: 400;
  transition: color 0.15s;
}

.topbar__nav a:hover {
  color: var(--accent);
}

.topbar__right {
  display: flex;
  justify-content: flex-end;
}

.topbar__link {
  padding: 10px 0;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}

.topbar__link:hover {
  text-decoration: underline;
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-weight: 700;
}

.wordmark > span {
  color: var(--accent);
  font-size: inherit;
  font-weight: 500;
}

/* --- 01 · Герой ----------------------------------------------------------- */
.hero {
  overflow: hidden;
}

.hero__copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: clamp(24px, 3vw, 44px);
  padding-bottom: 44px;
}

.hero__title {
  max-width: 1000px;
  color: var(--heading);
  font-size: clamp(28px, 3.65vw, 48px);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.hero__clients { white-space: nowrap; }
.brand--happ, .wordmark > .brand--happ { color: var(--happ); }
.brand--incy, .wordmark > .brand--incy { color: var(--incy); }
.wordmark > .wordmark__join { color: var(--muted); font-size: 16px; }
.wordmark > .brand--happ, .wordmark > .brand--incy { font-weight: 600; }
.app-selector {
  display: flex;
  gap: 24px;
  margin-bottom: 16px;
}
.app-selector__button {
  min-height: 44px;
  padding: 8px 2px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.app-selector__button[aria-pressed="true"] { border-bottom-color: currentColor; }
.app-selector__button[aria-pressed="false"] { color: var(--muted); }
.app-selector__button:hover { border-bottom-color: currentColor; }

/* Факты строкой через точки. Факты сгруппированы парами: на узком экране
   каждая пара встаёт своей строкой, и точка не повисает в начале переноса. */
.hero__lead {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 0;
  max-width: 800px;
  margin-top: 16px;
  color: var(--muted);
  font-size: clamp(16px, 1.4vw, 19px);
  font-weight: 400;
  line-height: 1.5;
}

.hero__pair > span + span::before,
.hero__pair + .hero__pair::before {
  content: "·";
  margin: 0 10px;
  color: var(--faint);
}

.hero__lead b {
  font-weight: 600;
  color: var(--text);
}

/* Статус и клиентская отметка времени, обновляемая по шагу из конфига. */
.status {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 10px;
  margin-top: var(--gap-pair);
  font-size: 13.5px;
  color: var(--muted);
}

.status__checked { white-space: nowrap; }

.status b {
  font-weight: 500;
  color: var(--accent);
}

.status__dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 22px;
  max-width: 920px;
  margin-top: 20px;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--muted);
}

/* Пункт — обычная строка, не флекс: во флексе пробелы между <b> и текстом
   схлопываются в gap, и «2 устройства в подписке» разъезжается. */
.hero__meta li::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-right: 8px;
  vertical-align: middle;
  border-radius: 50%;
  background: var(--accent);
}

.hero__meta b {
  font-weight: 400;
  color: var(--text);
}

.platforms { display: grid; grid-template-columns: repeat(6, 1fr); padding-block: 24px; color: var(--muted); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.platforms a { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 36px; font-size: 13px; transition: color 0.15s; }
.platforms a:hover { color: var(--accent); }
.platforms svg { width: 32px; height: 32px; }

/* --- Секции --------------------------------------------------------------- */
.section {
  padding-block: 40px;
}

.features {
  margin-top: 0;
}

/* Разделители основных секций */
.devices {
  border-top: 0;
}

.places,
.faq {
  padding-top: 16px;
}

.section__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  margin-bottom: 16px;
}

.section__title {
  max-width: 760px;
  color: var(--heading);
  font-size: var(--text-title);
  font-weight: var(--text-title--font-weight);
  line-height: var(--text-title--line-height);
  letter-spacing: var(--text-title--letter-spacing);
}

.section__lead {
  max-width: 340px;
  color: var(--muted);
  font-size: var(--text-body);
  line-height: var(--text-body--line-height);
}

/* Раскрывающиеся строки — «Возможности» и FAQ */
.rows {
  padding: 4px 24px;
  border-radius: 22px;
  background: var(--surface);
}

.row {
  border-bottom: 1px solid var(--line);
}

.row summary {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 21px 4px;
  list-style: none;
  cursor: pointer;
}

.row summary::-webkit-details-marker {
  display: none;
}


.row h3 {
  flex: 1;
  font-size: var(--text-headline);
  font-weight: var(--text-headline--font-weight);
  line-height: var(--text-headline--line-height);
  letter-spacing: var(--text-headline--letter-spacing);
}

.row summary:hover h3 {
  color: var(--heading);
}

/* ChevronIcon from Solar, as in Myxa's Row and landing FAQ. */
.row:last-child { border-bottom: 0; }
.row__chevron {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--muted);
  transform: rotate(90deg);
  transition: transform 150ms var(--ease);
}
.row[open] .row__chevron { transform: rotate(-90deg); }

.row__body {
  padding: 0 4px 26px;
}

.row__body p {
  max-width: 760px;
  color: var(--muted);
  font-size: var(--text-body);
  line-height: var(--text-body--line-height);
}

.row__body a {
  color: var(--accent);
  cursor: pointer;
}

.row__body a:hover {
  text-decoration: underline;
}

.row__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 24px;
  font-size: 14px;
  color: var(--accent);
}

/* У вопросов нет иконки слева — текст тела не нужно сдвигать под неё */
.qa .row__body {
  padding-left: 4px;
}

/* 03 · Локации — сетка стран */
.places__list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 32px;
}

/* Ячейка — обычный поток, не флекс: во флексе длинное название
   («Великобритания» на 390 px) уезжает строкой ниже флага. */
.places__list > li {
  padding: 22px 0;
  border-top: 1px solid var(--line);
  color: var(--heading);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.places__flag {
  margin-right: 10px;
  font-size: 19px;
  line-height: 1;
}

.places__list > li.is-special {
  color: var(--accent);
}

.places__list > li > b {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
}

/* 04 · Устройства — карточки загрузки */
.downloads {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.download {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 92px;
  padding: 20px 22px;
  border: 0;
  border-radius: 22px;
  background: var(--surface);
  transition: background-color 150ms var(--ease);
}

.download:hover {
  background: var(--default);
}

.download__icon {
  flex: none;
  width: 32px;
  height: 32px;
}

.download > span {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.download b {
  color: var(--heading);
  font-size: var(--text-headline);
  font-weight: var(--text-headline--font-weight);
  letter-spacing: var(--text-headline--letter-spacing);
}

.download small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.download__out {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--accent);
}

.downloads__note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
  margin-top: 24px;
  font-size: 14px;
  color: var(--muted);
}

.downloads__note a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
}

.downloads__note a:hover {
  text-decoration: underline;
}

.downloads__note svg {
  width: 14px;
  height: 14px;
}

/* 05 · Покупка — три шага и факты */
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 32px;
}

.steps > li {
  padding: 30px 0 34px;
  border-top: 1px solid var(--line);
}

.steps__num {
  display: block;
  margin-bottom: 18px;
  font-size: 14px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.steps h3 {
  color: var(--heading);
  font-size: var(--text-headline);
  font-weight: var(--text-headline--font-weight);
  line-height: var(--text-headline--line-height);
  letter-spacing: var(--text-headline--letter-spacing);
}

.steps p {
  max-width: 360px;
  margin-top: 8px;
  color: var(--muted);
  font-size: var(--text-body);
  line-height: var(--text-body--line-height);
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 40px;
}

.facts > li {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.facts > li > b {
  color: var(--heading);
  font-size: 16px;
  font-weight: 600;
}

.facts > li > span {
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 400;
  line-height: 1.55;
}

.facts a {
  color: var(--accent);
  cursor: pointer;
}

.facts a:hover {
  text-decoration: underline;
}

/* 07 · Финальный CTA */
.closing {
  position: relative;
  padding-block: 64px;
  text-align: center;
  overflow: hidden;
}

.closing { background: var(--accent-soft); }

.closing__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.closing__title {
  color: var(--heading);
  font-size: var(--text-display);
  font-weight: var(--text-display--font-weight);
  line-height: var(--text-display--line-height);
  letter-spacing: var(--text-display--letter-spacing);
}

.closing__lead {
  max-width: 560px;
  margin: 16px 0 24px;
  color: var(--muted);
  font-size: var(--text-body);
  line-height: var(--text-body--line-height);
}

/* --- Подвал --------------------------------------------------------------- */
.footer {
  padding-block: 48px;
  border-top: 1px solid var(--line);
}

.footer__top,
.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
}

.footer__top nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 14px;
  color: var(--muted);
}

.footer__top nav a {
  cursor: pointer;
}

.footer__top nav a:hover {
  color: var(--accent);
}

.footer__bottom {
  margin-top: 40px;
  font-size: 13px;
  color: var(--muted);
}

.footer__credits {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.footer__credits a:hover { text-decoration: underline; }

/* --- Липкая кнопка на мобильном ------------------------------------------- */
.sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 35;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-top: 1px solid var(--line);
  transform: translateY(120%);
  visibility: hidden;
  transition:
    transform 0.32s var(--ease),
    visibility 0s linear 0.32s;
}

.sticky.is-visible {
  transform: translateY(0);
  visibility: visible;
  transition-delay: 0s;
}

.sticky__row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sticky__price {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 861px) {
  .sticky {
    display: none;
  }
}

/* --- Чекаут --------------------------------------------------------------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgb(16 27 21 / 40%);
  opacity: 0;
  transition: opacity 0.26s var(--ease);
}

.backdrop.is-open {
  opacity: 1;
}

.sheet {
  position: relative;
  width: min(480px, 100%);
  max-height: min(88svh, 760px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 26px 26px 22px;
  border-radius: 22px;
  background: var(--bg);
  border: 1px solid var(--line);
  box-shadow: var(--overlay-shadow);
  transform: translateY(14px) scale(0.975);
  opacity: 0;
  transition:
    transform 0.34s var(--ease),
    opacity 0.24s var(--ease);
}

.backdrop.is-open .sheet {
  transform: none;
  opacity: 1;
}

.sheet__grab {
  display: none;
}

.sheet__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.sheet__close:hover {
  background: var(--line);
}

.sheet__close svg {
  width: 24px;
  height: 24px;
}

/* Видимого заголовка у окна нет, но разметке он нужен для aria-labelledby */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --- Форма заказа: первый экран и окно -------------------------------------- */
.hero__order {
  width: 100%;
  max-width: 1040px;
  margin-top: 28px;
  text-align: left;
}

.hero__fallback {
  text-align: center;
  font-size: 20px;
  color: var(--heading);
}

/* Выбор устройств над тарифами */
.stepper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 18px;
  margin-bottom: 20px;
}

.stepper__label {
  font-size: 15px;
  color: var(--muted);
}

.stepper__control {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
}

.stepper__btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--default);
  color: var(--text);
  cursor: pointer;
  transition: background-color 150ms var(--ease), opacity 150ms var(--ease);
}

.stepper__btn:hover {
  background: color-mix(in oklch, var(--default) 70%, var(--background));
}

.stepper__btn:active {
  opacity: 0.9;
}

.stepper__btn[disabled] {
  opacity: 0.35;
  pointer-events: none;
}

.stepper__btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.stepper__value {
  min-width: 116px;
  text-align: center;
  color: var(--heading);
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Сроки: в ряд на компьютере, 2×2 на телефоне и в окне */
.terms {
  display: grid;
  grid-template-columns: repeat(var(--terms, 4), minmax(0, 1fr));
  gap: 12px;
}

.term {
  position: relative;
  display: block;
  padding: 20px 12px 18px;
  border: 1px solid transparent;
  border-radius: var(--r-lg);
  background: var(--surface);
  text-align: center;
  cursor: pointer;
  transition: box-shadow 150ms var(--ease), background-color 150ms var(--ease);
}

.term input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.term__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.term__label {
  font-size: var(--text-headline);
  font-weight: 600;
  color: var(--text);
}

.term__price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}

.term__total {
  color: var(--heading);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.term__per {
  font-size: 13px;
  color: var(--faint);
}

.term__month {
  font-size: var(--text-caption);
  line-height: var(--text-caption--line-height);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}


.term:hover {
  background: var(--default);
}

.term.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.term:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Почта и кнопка: в первом экране — в одну строку, в окне — столбцом */
.order {
  display: grid;
  gap: 8px 12px;
  margin-top: 20px;
}

.order--row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  max-width: 780px;
  margin-inline: auto;
}

.order--row .field__note {
  grid-column: 1 / -1;
}

.field__label {
  display: block;
  margin: 0 0 7px 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.field__input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  font: inherit;
  font-size: 16px;
  color: var(--field-foreground);
  background: var(--field-background);
  border: 1px solid var(--field-border);
  border-radius: var(--field-radius);
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}

.field__input::placeholder {
  color: var(--faint);
}

.field__input:focus {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.field__input.is-invalid {
  border-color: var(--error);
  outline-color: var(--error);
}

.field__note {
  margin-left: 0;
  font-size: var(--text-caption);
  line-height: var(--text-caption--line-height);
  color: var(--muted);
}

.field__note.is-error {
  color: var(--error);
}

.field__note.is-shaking {
  animation: email-warning-shake 400ms ease-out;
}

@keyframes email-warning-shake {
  0%, 100% { transform: translateX(0); }
  15%, 45% { transform: translateX(-4px); }
  30%, 60% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
  90% { transform: translateX(2px); }
}

/* In stacked forms, show the warning directly beneath the email field. */
.order:not(.order--row) .field__note.is-error { grid-row: 2; }
@media (max-width: 600px) {
  .order--row .field__note.is-error { grid-row: 2; }
  .hero .status { column-gap: 6px; font-size: 12px; }
}
@media (max-width: 359px) {
  .hero .status { font-size: 11px; }
}

.pay-btn {
  white-space: nowrap;
  font-weight: 600;
}

.pay-btn [data-pay-label] {
  font-variant-numeric: tabular-nums;
  transition:
    opacity 0.14s var(--ease),
    transform 0.14s var(--ease);
}

.pay-btn [data-pay-label].is-changing {
  opacity: 0;
  transform: translateY(-4px);
}

/* В окне всё компактнее: плитки 2×2, кнопка во всю ширину */
.sheet__title {
  margin: 2px 40px 18px 0;
  color: var(--heading);
  font-size: 22px;
  letter-spacing: -0.03em;
}

.sheet .stepper {
  justify-content: space-between;
  margin-bottom: 22px;
}

.sheet .terms {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 10px;
}

.sheet .term {
  padding: 18px 10px 14px;
}

.sheet .term__total {
  font-size: 26px;
}

.sheet .pay-btn {
  width: 100%;
}

/* --- Адаптив -------------------------------------------------------------- */
@media (max-width: 1100px) {
  .places__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .topbar__inner {
    grid-template-columns: 1fr auto;
    height: 72px;
  }

  .topbar__nav {
    display: none;
  }

  .section {
    padding-block: 28px;
  }

  .places,
  .faq {
    padding-top: 8px;
  }

  .section__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
  }

  .section__lead {
    max-width: 560px;
  }

  .platforms {
    grid-template-columns: repeat(3, 1fr);
    row-gap: 8px;
  }

  .downloads {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .steps,
  .facts {
    grid-template-columns: 1fr;
  }

  .steps > li {
    padding: 24px 0;
  }

  .steps__num {
    margin-bottom: 10px;
  }

  .facts {
    margin-top: 16px;
    gap: 10px;
  }
}

@media (max-width: 600px) {
  :root {
    --gap-block: 26px;
  }

  .topbar__inner {
    height: 64px;
  }

  .wordmark {
    font-size: 24px;
  }

  .hero__lead {
    margin-top: 10px;
    font-size: 14.5px;
  }

  .hero__lead {
    flex-direction: column;
    align-items: center;
  }



  .status {
    margin-top: 8px;
    font-size: 12.5px;
  }

  /* Форма в первом экране на телефоне: всё плотнее, чтобы почта и кнопка
     поместились в экран вместе с выбором */
  .hero__order {
    margin-top: 20px;
  }

  .stepper {
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 18px;
  }

  .stepper__label {
    font-size: 14px;
  }

  .stepper__btn {
    width: 34px;
    height: 34px;
  }

  .stepper__value {
    min-width: 100px;
    font-size: 15px;
  }

  .terms,
  .sheet .terms {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 8px;
  }

  .term,
  .sheet .term {
    padding: 14px 6px 11px;
    border-radius: var(--r-md);
  }

  .term__body {
    gap: 3px;
  }

  .term__label {
    font-size: 13px;
  }

  .term__total,
  .sheet .term__total {
    font-size: 24px;
  }

  .term__month {
    font-size: 12px;
  }


  .order {
    margin-top: 14px;
  }

  .order--row {
    grid-template-columns: 1fr;
  }

  .field__label {
    display: none;
  }

  .field__input {
    height: 50px;
  }

  .pay-btn {
    width: 100%;
    min-height: 50px;
  }



  .platforms {
    padding-block: 20px;
  }

  .platforms a {
    justify-content: flex-start;
    gap: 12px;
    font-size: 14px;
  }

  .platforms svg {
    width: 28px;
    height: 28px;
  }

  .features {
    margin-top: 8px;
  }

  .section {
    padding-block: 28px;
  }

  .row summary {
    gap: 16px;
    padding: 22px 0;
  }

  .row h3 {
    font-size: var(--text-headline);
  }

  .row__body {
    padding: 0 0 26px;
  }

  .qa .row__body {
    padding-left: 0;
  }

  .row__body p {
    font-size: var(--text-body);
  }

  .places__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 20px;
  }

  .places__list > li {
    padding: 20px 0;
    font-size: 17px;
  }

  .places__flag {
    margin-right: 8px;
    font-size: 18px;
  }

  .downloads {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .download {
    min-height: 88px;
    padding: 20px;
  }

  .closing {
    padding-block: 56px;
  }

  .footer__top,
  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .footer__bottom {
    margin-top: 28px;
    gap: 6px;
  }

  /* Чекаут на телефоне — шторка снизу */
  .backdrop {
    padding: 0;
    align-items: flex-end;
  }

  .sheet {
    width: 100%;
    max-height: 92svh;
    border-radius: 22px 22px 0 0;
    border-bottom: 0;
    padding: 12px 20px calc(20px + env(safe-area-inset-bottom));
    transform: translateY(100%);
    transition: transform 0.36s var(--ease);
  }

  .backdrop.is-open .sheet {
    transform: translateY(0);
  }

  .sheet__grab {
    display: block;
    width: 38px;
    height: 4px;
    margin: 0 auto 14px;
    border-radius: 8px;
    background: var(--line);
  }

  .sheet__close {
    top: 12px;
    right: 12px;
  }
}

@media (max-width: 359px) {
  .term__total,
  .sheet .term__total {
    font-size: 21px;
  }

  .stepper__label {
    font-size: 13px;
  }

  .stepper__value {
    min-width: 92px;
    font-size: 14px;
  }

  .stepper__btn {
    width: 30px;
    height: 30px;
  }

  .places__list > li {
    font-size: 15px;
  }
}

/* --- Компактная форма на телефоне ----------------------------------------- */
@media (max-width: 600px) {
  .topbar__inner { height: 56px; }
  .hero__copy { padding-top: 20px; padding-bottom: 30px; }
  .hero__title { font-size: 28px; line-height: 1.08; }
  .hero__lead { font-size: 13px; line-height: 1.5; }
  .hero__pair + .hero__pair::before { display: none; }
  .hero__pair > span + span::before { margin-inline: 7px; }
  .hero__order { margin-top: 20px; }
  .stepper { margin-bottom: 14px; }
  .stepper__control { padding: 3px; }
  .stepper__btn { width: 32px; height: 32px; }
  .stepper__label { font-size: 13px; }
  .stepper__value { min-width: 96px; font-size: 14px; }
  .term, .sheet .term { padding: 12px 8px; }
  .term__body { gap: 4px; }
  .term__total, .sheet .term__total { font-size: 26px; }
  .term__month { font-size: 13px; }
  .field__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); display: block; }
  .field__input { height: 56px; }
  .btn--primary { height: 56px; }
  .pay-btn { min-height: 56px; font-size: 17px; }
  .field__note { font-size: 13px; }
  .rows { padding-inline: 20px; }
  .hero__meta { margin-top: 18px; gap: 5px 14px; font-size: 11px; }
  .platforms a { justify-content: center; gap: 8px; }
}
@media (max-width: 359px) {
  :root { --gutter: 16px; }
  .hero__title { font-size: 24px; }
  .hero__lead { font-size: 12px; }
  .hero__copy { padding-top: 12px; }
  .hero__order { margin-top: 10px; }
  .stepper { margin-bottom: 10px; }
  .stepper__btn { width: 30px; height: 30px; }
  .terms, .sheet .terms { gap: 8px; }
  .term, .sheet .term { padding: 8px; }
  .term__total, .sheet .term__total { font-size: 24px; }
  .hero__order .field__input, .hero__order .pay-btn { height: 48px; min-height: 48px; }
}

@media (min-width: 360px) and (max-width: 600px) and (max-height: 680px) {
  .hero__copy { padding-top: 16px; }
  .hero__order { margin-top: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }



  .sticky {
    transition: none;
  }
}
