/* Палитра и свечения — как у site.medan-x.com, чтобы бренд был один. */
:root {
  --bg: #0c0c14;
  --card: rgba(255, 255, 255, .045);
  --card-hover: rgba(255, 255, 255, .07);
  --line: rgba(255, 255, 255, .08);
  --line-hover: rgba(255, 255, 255, .16);
  --accent: #7c5cfc;
  --accent-2: #a78bfa;
  --accent-glow: rgba(124, 92, 252, .35);
  --blue: #2aabee;
  --text: #ececf1;
  --text-2: #a1a1b5;
  --text-3: #6b6b80;
  --green: #34d399;
  --red: #f87171;
  --yellow: #fbbf24;
  --r: 18px;
  --r-sm: 12px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { background: var(--bg); }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
button { font: inherit; color: inherit; }

.glow { position: fixed; border-radius: 50%; filter: blur(120px); pointer-events: none; z-index: 0; }
.glow--1 { width: 420px; height: 420px; background: var(--accent); top: -140px; left: -120px; opacity: .35; }
.glow--2 { width: 360px; height: 360px; background: var(--blue); bottom: -120px; right: -100px; opacity: .18; }

/* ---------- шапка ---------- */
.top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 20px 14px;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 19px; letter-spacing: -.01em; }
.logo img { border-radius: 8px; }
.logo b {
  background: linear-gradient(135deg, var(--accent-2), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.top-link {
  font-size: 14px;
  color: var(--text-2);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
}
.top-link:hover { color: var(--text); border-color: var(--line-hover); }

.page {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 0 20px 24px;
}

/* ---------- заголовок ---------- */
.hero { text-align: center; padding: 28px 0 28px; }
.hero-badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-2);
  background: rgba(124, 92, 252, .12);
  border: 1px solid rgba(124, 92, 252, .24);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 18px;
}
.hero h1 { font-size: 34px; line-height: 1.12; font-weight: 800; letter-spacing: -.02em; }
.grad {
  background: linear-gradient(135deg, var(--accent) 10%, var(--accent-2) 55%, var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub { color: var(--text-2); margin: 14px auto 0; max-width: 400px; font-size: 15px; }

/* ---------- общие блоки ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.card--center { text-align: center; padding: 28px 20px 18px; }
.card-title { font-size: 20px; font-weight: 700; margin: 14px 0 6px; }
.section-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 28px 0 12px;
}
.muted { color: var(--text-2); font-size: 15px; }
.center { text-align: center; }
.hint { color: var(--text-3); font-size: 13px; margin-top: 14px; line-height: 1.5; }

.field { display: block; }
.label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.field input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .35);
  color: var(--text);
  font: inherit;
  font-size: 15px;
}
.field input::placeholder { color: var(--text-3); }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 92, 252, .25); }

.btn {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 15px 18px;
  border: 0;
  border-radius: 14px;
  font-weight: 700;
  font-size: 16px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, opacity .2s ease;
}
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #8b6cff, var(--accent) 55%, #6a4cf0);
  box-shadow: 0 8px 28px var(--accent-glow);
}
.btn-primary:hover { box-shadow: 0 10px 34px rgba(124, 92, 252, .5); }
.btn-primary:active { transform: scale(.985); }
.btn-primary:disabled { opacity: .55; cursor: default; box-shadow: none; }
.btn-secondary {
  margin-top: 10px;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line-hover);
}
.btn-secondary:hover { background: var(--card-hover); }
.btn-link { background: none; color: var(--text-2); font-weight: 500; font-size: 15px; margin-top: 6px; padding: 12px; }
.btn-link:hover { color: var(--text); }

/* ---------- как это работает ---------- */
.how { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.how li {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .025);
}
.how b { display: block; font-size: 14px; line-height: 1.3; }
.how small { display: block; color: var(--text-3); font-size: 12px; margin-top: 2px; line-height: 1.35; }
.how-n {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-2);
  background: rgba(124, 92, 252, .15);
}

/* ---------- карта подписки ---------- */
.pass {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 18px 20px 18px;
  min-height: 178px;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(42, 171, 238, .55) 0%, transparent 55%),
    radial-gradient(120% 120% at 0% 100%, rgba(167, 139, 250, .45) 0%, transparent 60%),
    linear-gradient(135deg, #3b2a9e 0%, #5b3fe0 45%, #2a1d72 100%);
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 18px 50px rgba(76, 52, 200, .35), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.pass::before,
.pass::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .12);
  pointer-events: none;
}
.pass::before { width: 260px; height: 260px; right: -90px; bottom: -150px; }
.pass::after { width: 180px; height: 180px; right: -40px; bottom: -110px; }
.pass--expired {
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(251, 191, 36, .28) 0%, transparent 55%),
    radial-gradient(120% 120% at 0% 100%, rgba(124, 92, 252, .35) 0%, transparent 60%),
    linear-gradient(135deg, #2b2440 0%, #3a2f63 50%, #1f1a33 100%);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.pass-top { display: flex; justify-content: space-between; align-items: center; }
.pass-brand { font-size: 12px; font-weight: 800; letter-spacing: .22em; color: rgba(255, 255, 255, .85); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .25);
  border: 1px solid rgba(255, 255, 255, .14);
}
.chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip--ok { color: #6ee7b7; }
.chip--expired { color: var(--yellow); }
.pass-caption { margin-top: auto; padding-top: 22px; font-size: 13px; color: rgba(255, 255, 255, .7); }
.pass-date { font-size: 26px; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; }
.pass-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  font-size: 13px;
  color: rgba(255, 255, 255, .8);
}
.pass-devices { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.pass-kind { letter-spacing: .12em; text-transform: uppercase; font-size: 11px; color: rgba(255, 255, 255, .55); }

/* ---------- сроки ---------- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 132px;
  padding: 14px 12px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.tile:hover { border-color: var(--line-hover); background: var(--card-hover); }
.tile:active { transform: scale(.98); }
.tile[aria-checked="true"] {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(124, 92, 252, .22), rgba(124, 92, 252, .06));
  box-shadow: 0 0 0 1px var(--accent) inset, 0 10px 28px rgba(124, 92, 252, .25);
}
.tile-months { font-size: 30px; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.tile-unit { font-size: 13px; color: var(--text-2); margin-top: 3px; }
.tile-price { margin-top: auto; padding-top: 14px; font-size: 16px; font-weight: 700; white-space: nowrap; }
.tile-month { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.tile-badge {
  position: absolute;
  top: -10px;
  right: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .35);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 7px;
  color: #0c0c14;
  background: linear-gradient(135deg, #c4b5fd, var(--accent-2));
}
.tile-badge--best { background: linear-gradient(135deg, #6ee7b7, var(--green)); }
.tile--skeleton, .pass--skeleton { cursor: default; border-color: transparent; }
.pass--skeleton { background: var(--card); box-shadow: none; margin-bottom: 38px; }
.tile--skeleton, .pass--skeleton { animation: pulse 1.4s ease-in-out infinite; }
#step-loading .muted { margin-top: 20px; }
@keyframes pulse { 50% { opacity: .45; } }

/* ---------- способы оплаты ---------- */
.methods { display: grid; gap: 8px; }
.method {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.method:hover { border-color: var(--line-hover); background: var(--card-hover); }
.method[aria-checked="true"] { border-color: var(--accent); background: rgba(124, 92, 252, .1); }
.method-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .06);
  color: var(--accent-2);
}
.method-title { flex: 1; font-weight: 600; font-size: 15px; }
.method-dot {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--line-hover);
  transition: border .15s ease;
}
.method[aria-checked="true"] .method-dot { border: 6px solid var(--accent); }

/* ---------- кнопка оплаты прилипает к низу ---------- */
.paybar {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin: 18px -20px 0;
  padding: 12px 20px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(12, 12, 20, 0), rgba(12, 12, 20, .92) 35%);
}
.paybar .btn { margin-top: 0; }

/* ---------- состояния ---------- */
.big-icon { display: inline-grid; place-items: center; width: 60px; height: 60px; border-radius: 20px; }
.big-icon--ok { color: var(--green); background: rgba(52, 211, 153, .12); box-shadow: 0 0 0 1px rgba(52, 211, 153, .25) inset; }
.big-icon--warn { color: var(--yellow); background: rgba(251, 191, 36, .12); box-shadow: 0 0 0 1px rgba(251, 191, 36, .25) inset; }
.error-text { margin: 16px 0 4px; font-size: 15px; }

.steps { list-style: none; counter-reset: s; text-align: left; margin: 18px 0 4px; display: grid; gap: 10px; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; font-size: 15px; }
.steps li::before {
  content: counter(s);
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-2);
  background: rgba(124, 92, 252, .15);
}

/* ---------- подвал ---------- */
.foot {
  position: relative;
  z-index: 1;
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
  padding: 22px 20px calc(24px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  max-width: 520px;
  width: calc(100% - 40px);
  margin: 12px auto 0;
}
.foot b { color: var(--text-2); }
.foot nav { display: flex; justify-content: center; gap: 18px; margin-top: 8px; }
.foot a { color: var(--text-2); text-decoration: none; }
.foot a:hover { color: var(--text); }
.noscript { position: relative; z-index: 1; text-align: center; color: var(--text-2); padding: 20px; }

@media (max-width: 360px) {
  .hero h1 { font-size: 29px; }
  .tile { padding: 12px 10px; }
  .tile-months { font-size: 26px; }
  .how { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.done-title { font-size: 34px; font-weight: 800; letter-spacing: -.02em; margin-top: 18px; }

/* На шагах с подпиской заголовок сжимается: главное — карта и выбор. */
body.compact .hero { padding: 6px 0 20px; }
body.compact .hero-badge,
body.compact .hero-sub { display: none; }
body.compact .hero h1 { font-size: 24px; }
