:root {
  --ink: #1f2328;
  --muted: #5b6472;
  --line: #e3e7ee;
  --bg: #f6f8fc;
  --card: #ffffff;
  --accent: #2f6fed;
  --accent-dark: #2457c4;
  --ok: #16a34a;
  --warn: #b45309;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8ecf3;
    --muted: #9aa5b8;
    --line: #2a3140;
    --bg: #0f131b;
    --card: #171c27;
    --accent: #5b8cff;
    --accent-dark: #7aa0ff;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.wrap { max-width: 980px; margin: 0 auto; padding: 0 20px; }
a { color: var(--accent); }

header.top { padding: 14px 0; border-bottom: 1px solid var(--line); background: var(--card); }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; color: var(--ink); text-decoration: none; }
.logo .mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent);
  display: grid; place-items: center; color: #fff; font-size: 18px;
}
nav a { margin-left: 6px; padding: 6px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--ink); background: rgba(127, 127, 127, .14); }

.hero { padding: 48px 0 28px; text-align: center; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.15; margin: 0 0 14px; }
.hero p.lead { font-size: 19px; color: var(--muted); max-width: 640px; margin: 0 auto 26px; }

.btn {
  display: inline-block; border: 0; border-radius: 8px; padding: 11px 22px;
  background: var(--accent); color: #fff; font-size: 16px; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--accent-dark); }
.btn.ghost { background: rgba(127, 127, 127, .14); color: var(--ink); }
.btn.ghost:hover { background: rgba(127, 127, 127, .24); }
.btn[disabled], .btn.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.hero .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero small { display: block; margin-top: 14px; color: var(--muted); }

section { padding: 38px 0; }
section h2 { font-size: 26px; margin: 0 0 18px; text-align: center; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 22px;
}
.card h3 { margin: 0 0 8px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); }

.price { text-align: center; }
.price .amount { font-size: 38px; font-weight: 800; margin: 6px 0; }
.price .amount span { font-size: 17px; font-weight: 500; color: var(--muted); }
.price ul { text-align: left; color: var(--muted); padding-left: 20px; margin: 12px 0 18px; }
.price.best { border: 2px solid var(--accent); }
.badge { display: inline-block; background: var(--accent); color: #fff; border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 600; }

.extend { margin-top: 20px; text-align: center; color: var(--muted); }
.extend input {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 10px; padding: 9px 12px; font: 15px Consolas, monospace; width: 290px; max-width: 100%;
}

.steps { counter-reset: s; list-style: none; padding: 0; display: grid; gap: 12px; }
.steps li { counter-increment: s; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 14px 56px; position: relative; }
.steps li::before {
  content: counter(s); position: absolute; left: 16px; top: 12px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700;
}

.notice { background: var(--card); border: 1px dashed var(--line); border-radius: 14px; padding: 14px 18px; color: var(--muted); font-size: 14px; }
.msg { margin-top: 14px; text-align: center; min-height: 24px; }
.msg.error { color: #dc2626; }

footer { padding: 30px 0 50px; color: var(--muted); font-size: 14px; text-align: center; border-top: 1px solid var(--line); margin-top: 20px; }
footer a { color: var(--muted); }

/* страница успеха */
.center-card { max-width: 560px; margin: 30px auto; text-align: center; }
.code {
  font: 700 24px Consolas, "Courier New", monospace; letter-spacing: 1px; background: var(--bg);
  border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 16px 0; word-break: break-all; user-select: all;
}
.spinner {
  width: 38px; height: 38px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--accent);
  margin: 10px auto 16px; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* юридические страницы */
.doc { max-width: 780px; margin: 10px auto 40px; }
.doc h1 { font-size: 30px; }
.doc h2 { font-size: 20px; text-align: left; margin: 26px 0 8px; }
.doc .fill { background: #fff3cd; color: #664d03; border-radius: 4px; padding: 0 4px; }

.grid.plans { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.price .per { color: var(--muted); font-size: 14px; margin: -2px 0 6px; min-height: 22px; }
.price .per b { color: var(--ok); }
.price .amount { font-size: 32px; }

/* цена крупно, галочка согласия рядом с текстом */
.price .amount span[data-price] { font-size: inherit; font-weight: inherit; color: inherit; }
.extend input[type="checkbox"] { width: auto; vertical-align: middle; margin-right: 6px; }

/* кнопки тарифов на одной линии */
.price { display: flex; flex-direction: column; align-items: center; }
.price ul { flex: 1; align-self: stretch; }

/* Отклик кнопок: нажатие, «Оформляем…» с крутилкой */
.btn { transition: background .15s, transform .08s, box-shadow .15s; }
.btn:active:not([disabled]):not(.disabled) { transform: scale(.95); box-shadow: inset 0 3px 8px rgba(0, 0, 0, .28); }
.btn.loading { pointer-events: none; opacity: .9; cursor: progress; }
.btn.loading::before {
  content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Ошибка в поле: красная рамка и встряска */
.field-error { outline: 2px solid #dc2626; outline-offset: 3px; border-radius: 8px; animation: shake .38s; }
@keyframes shake { 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }

@media (prefers-reduced-motion: reduce) { .btn, .field-error, .btn.loading::before { animation: none; transition: none; } }
/* Согласие: отдельный квадратик «Я согласен», пояснение строкой ниже */
.consent { margin: 14px auto 0; max-width: 580px; text-align: center; }
.consent-row {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 11px 5px 9px; cursor: pointer; user-select: none;
  border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--ink); font-size: 14px; font-weight: 500; line-height: 1.2;
  transition: border-color .15s, background .15s, color .15s;
}
.consent-row:hover { border-color: var(--accent); }
.consent-row input[type="checkbox"] { width: 16px; height: 16px; margin: 0; padding: 0; border: 0; accent-color: var(--accent); cursor: pointer; }
.consent-row.required { border-color: #dc2626; background: rgba(220, 38, 38, .07); color: #dc2626; }
.consent-row.required input[type="checkbox"] { accent-color: #dc2626; outline: 2px solid #dc2626; outline-offset: 1px; }
.consent-text { font-size: 13px; margin: 8px 0 0; color: var(--muted); }
/* Сообщение прямо под полем почты: небольшое, без рамок; пустое — не занимает места */
#buyMsg { margin: 8px auto 0; min-height: 0; font-size: 14px; max-width: 520px; }
#buyMsg:empty { display: none; }

/* Промокод: строка ввода, зачёркнутая старая цена, блок с выданным кодом */
.promo-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; align-items: center; }
.promo-row input { text-transform: uppercase; }
.promo-gift { margin-top: 12px; }
.promo-gift .notice { text-align: left; }
.price .amount .old-price { display: block; font-size: 15px; font-weight: 500; color: var(--muted); text-decoration: line-through; line-height: 1; margin-bottom: 2px; }

/* оформление главной: плавающие значки приложений и выделенный шаг */
.hero { position: relative; overflow: hidden; }
.hero .wrap { position: relative; z-index: 1; }
.hero-note { max-width: 640px; margin: 16px auto 0; font-size: 14px; color: var(--muted); }
.floaters { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.tile {
  position: absolute; width: 74px; height: 74px; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--g1), var(--g2)); color: #fff; box-shadow: 0 10px 24px rgba(30, 50, 110, .22);
  animation: floaty 6s ease-in-out infinite; opacity: .92;
}
.tile i { font-style: normal; font-size: 30px; line-height: 1; }
.tile em { font-style: normal; font-size: 11px; font-weight: 600; margin-top: 4px; letter-spacing: .2px; }
.tile:nth-child(even) { animation-duration: 7.5s; transform: rotate(-6deg); }
.tile:nth-child(odd) { transform: rotate(5deg); }
@keyframes floaty { 0%, 100% { translate: 0 0; } 50% { translate: 0 -16px; } }
@media (max-width: 860px) {
  .tile { width: 52px; height: 52px; border-radius: 13px; opacity: .55; }
  .tile i { font-size: 22px; } .tile em { display: none; }
}
@media (prefers-reduced-motion: reduce) { .tile { animation: none; } }
.steps li.key-step { border: 2px solid #ef4444; box-shadow: 0 0 0 4px rgba(239, 68, 68, .12); }
@media (max-width: 1000px) { .tile:nth-child(1), .tile:nth-child(4) { display: none; } }

/* значки с названиями приложений: текст вместо эмодзи */
.tile { width: 84px; height: 84px; }
.tile i { font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
.tile em { font-size: 9.5px; }
@media (max-width: 1000px) { .tile:nth-child(1), .tile:nth-child(2) { display: none; } .tile:nth-child(3), .tile:nth-child(4) { display: flex; } }
@media (max-width: 860px) { .tile { width: 58px; height: 58px; } .tile i { font-size: 17px; } }

@media (max-width: 1000px) { .tile:nth-child(n+5) { display: none; } }

/* значки приложений-картинки */
.tile.pic { background: none; border-radius: 22.5%; width: 88px; height: 88px; opacity: 1; box-shadow: 0 12px 26px rgba(30, 50, 110, .25); }
.tile.pic img { width: 100%; height: 100%; display: block; border-radius: 22.5%; }
@media (max-width: 1000px) { .tile.pic { display: none; } .tile.pic:nth-child(5), .tile.pic:nth-child(6) { display: block; } }
@media (max-width: 860px) { .tile.pic { width: 60px; height: 60px; opacity: .85; } }

/* телефон: значки не плавают поверх текста, а ползут бегущей строкой под ним */
.icon-strip { display: none; }
@media (max-width: 700px) {
  .floaters { display: none; }
  .icon-strip { display: block; overflow: hidden; margin: 26px -16px 4px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
  .icon-track { display: flex; gap: 14px; width: max-content; animation: strip 28s linear infinite; padding: 6px 0 14px; }
  .icon-track img { width: 56px; height: 56px; border-radius: 22.5%; box-shadow: 0 6px 14px rgba(30, 50, 110, .22); flex: none; }
  nav a { margin-left: 0; padding: 6px 8px; font-size: 14px; }
  nav a[href="#features"] { display: none; }
}
@keyframes strip { to { transform: translateX(calc(-50% - 7px)); } }
@media (prefers-reduced-motion: reduce) { .icon-track { animation: none; } }
@media (max-width: 700px) { nav a[href="#pricing"], nav a[href="#download"] { display: none; } }
