/* Дизайн-токены. Тёмная тема по умолчанию для ночного режима ОС, светлая по умолчанию иначе. */
:root {
  color-scheme: light dark;
  --bg: #f6f7fb; --bg-2: #eceef7;
  --card: #ffffff; --card-2: #f3f4fb;
  --fg: #12141d; --muted: #61667d; --line: #e1e4f0;
  --accent: #5b5ef0; --accent-2: #9b5cf6; --accent-fg: #fff;
  --soft: #eceeff; --soft-fg: #4346d8;
  --ok: #15803d; --err: #dc2626; --warn-bg: #fff6e0; --warn-fg: #8a5a00;
  --shadow: 0 1px 2px rgba(20, 24, 60, .05), 0 12px 32px rgba(40, 45, 110, .09);
  --glow: rgba(91, 94, 240, .22);
  --radius: 18px; --radius-sm: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0e15; --bg-2: #12151f;
    --card: #151926; --card-2: #1b2030;
    --fg: #eef0fa; --muted: #98a0ba; --line: #262c3f;
    --accent: #7478ff; --accent-2: #b183ff; --accent-fg: #0c0e15;
    --soft: #1f2347; --soft-fg: #b5b8ff;
    --ok: #4ade80; --err: #f87171; --warn-bg: #2b2412; --warn-fg: #f2c46b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px rgba(0, 0, 0, .4);
    --glow: rgba(116, 120, 255, .22);
  }
}

* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--fg);
  background:
    radial-gradient(720px 360px at 15% -80px, var(--glow), transparent 70%),
    radial-gradient(640px 320px at 90% -60px, color-mix(in srgb, var(--accent-2) 20%, transparent), transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
}

/* Шапка */
.top {
  width: 100%; max-width: 760px; margin: 0 auto; padding: 22px 20px 0;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 750; font-size: 1.3rem; letter-spacing: -.02em; }
.logo { width: 36px; height: 36px; filter: drop-shadow(0 6px 14px var(--glow)); }
.logo rect { fill: url(#logo-grad); }
.logo path { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

main { width: 100%; max-width: 760px; margin: 0 auto; padding: 28px 20px 48px; flex: 1; }

/* Hero */
.hero { text-align: center; padding: 20px 0 32px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px; padding: 5px 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card);
  color: var(--muted); font-size: .82rem; font-weight: 500;
}
.eyebrow i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
h1 { margin: 0 0 14px; font-size: clamp(2rem, 7vw, 3.3rem); line-height: 1.08; letter-spacing: -.035em; font-weight: 800; }
.grad { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { margin: 0 auto; max-width: 520px; color: var(--muted); font-size: 1.08rem; }
h2 { margin: 0 0 6px; font-size: 1.12rem; letter-spacing: -.01em; overflow-wrap: anywhere; }
.muted { color: var(--muted); margin: 0; font-size: .92rem; }

/* Карточки */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px;
}
#login { text-align: center; }
#login-widget { margin-top: 18px; min-height: 44px; display: flex; justify-content: center; }

/* Тариф */
.plan {
  display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; align-items: center;
  margin: -6px -6px 22px; padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--card-2); border: 1px solid var(--line); font-size: .92rem;
}
.badge { padding: 3px 11px; border-radius: 999px; background: var(--soft); color: var(--soft-fg); font-weight: 650; font-size: .78rem; letter-spacing: .02em; white-space: nowrap; }
.badge.pro { background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #fff; }
.usage { grid-column: 1 / -1; }

/* Форма */
label { display: block; margin-bottom: 8px; font-weight: 600; font-size: .95rem; }
.field { display: flex; gap: 10px; }
input {
  flex: 1; min-width: 0; padding: 14px 16px; font: inherit; color: inherit;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--glow); }

button, .button {
  padding: 13px 22px; font: inherit; font-weight: 650; color: var(--accent-fg);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: 0; border-radius: var(--radius-sm); cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  box-shadow: 0 6px 18px -6px var(--accent);
  transition: transform .08s ease, filter .15s ease, box-shadow .15s ease;
}
button:hover:not(:disabled), .button:hover { filter: brightness(1.08); box-shadow: 0 8px 22px -6px var(--accent); }
button:active:not(:disabled), .button:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); padding: 8px 16px; font-weight: 500; box-shadow: none; }
button.ghost:hover:not(:disabled) { color: var(--fg); border-color: var(--muted); filter: none; box-shadow: none; }
.button { margin-top: 14px; width: 100%; padding: 15px 22px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Форматы */
.formats { margin-top: 24px; padding-top: 22px; border-top: 1px dashed var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chips button {
  background: var(--soft); color: var(--soft-fg); border: 1px solid transparent;
  padding: 10px 18px; min-width: 64px; box-shadow: none;
}
.chips button:hover:not(:disabled) { border-color: var(--accent); filter: none; box-shadow: none; }
.upsell { margin: 16px 0 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--warn-bg); color: var(--warn-fg); font-size: .9rem; }

/* Статус */
#msg { min-height: 1.5em; margin: 18px 0 0; font-size: .95rem; }
#msg:empty { min-height: 0; margin: 0; }
#msg.error { color: var(--err); font-weight: 500; }
progress {
  display: block; width: 100%; height: 10px; margin-top: 12px; appearance: none; -webkit-appearance: none;
  border: 0; border-radius: 999px; overflow: hidden; background: var(--line);
}
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .3s; }
progress::-moz-progress-bar { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.usage { height: 6px; margin: 0; }

/* Оплата */
.pay {
  margin-top: 26px; padding: 18px; border-radius: var(--radius-sm); display: flex; align-items: center;
  justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, var(--card)), color-mix(in srgb, var(--accent-2) 14%, var(--card)));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
}
.pay p { margin-top: 2px; }

/* Как это работает */
.steps { list-style: none; margin: 36px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.steps li {
  display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--card); font-size: .92rem; font-weight: 500;
}
.steps b {
  width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px;
  background: var(--soft); color: var(--soft-fg); font-size: .9rem;
}
.sites { margin: 28px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 0; list-style: none; }
.sites li { padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--muted); font-size: .82rem; }

.foot { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 20px 30px; color: var(--muted); font-size: .85rem; }
.legal { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); }
.legal h2 { margin: 0 0 8px; font-size: .95rem; color: var(--fg); }
.legal ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }

[hidden] { display: none !important; }
@media (max-width: 560px) {
  .top { padding-top: 16px; }
  main { padding: 16px 16px 36px; }
  .card { padding: 18px; }
  .field { flex-direction: column; }
  .field button { width: 100%; }
  .steps { grid-template-columns: 1fr; }
  .steps li { flex-direction: row; align-items: center; }
  .pay { flex-direction: column; align-items: stretch; }
  .pay button { width: 100%; }
  .pay-buttons { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.pay-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.pay-buttons button { white-space: nowrap; }

.levels { margin: 10px 0 0; padding-left: 18px; font-size: .88rem; color: var(--soft-fg); }
.levels li.current { color: inherit; font-weight: 650; }
.ad { margin-top: 22px; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px dashed var(--line); position: relative; }
.ad p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.ad .small { font-size: .8rem; margin-top: 6px; }
.ad-label { position: absolute; top: -9px; left: 12px; padding: 0 6px; background: var(--card); font-size: .72rem; color: var(--soft-fg); letter-spacing: .04em; text-transform: uppercase; }
