/* N/ — визуальная система: тёмный фон, фиолетовый продукт, золото клуба, «стекло». */
:root {
  --bg: #0B0914;
  --ink: #F3F0FF;
  --muted: #ABA5C6;
  --violet: #7C5CFF;
  --violet-2: #9C84FF;
  --gold: #D4AF37;
  --gold-ink: #1A1405;
  --glass: rgba(30, 24, 56, .88);          /* фоллбэк без backdrop-filter */
  --glass-line: rgba(255, 255, 255, .12);
  --ok: #4ADE80;
  --bad: #FF8A98;
  --radius: 18px;
  /* Безопасные зоны: iOS + Telegram (если переменные есть) */
  --safe-t: calc(max(env(safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px)) + var(--tg-content-safe-area-inset-top, 0px));
  --safe-b: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(120% 60% at 50% -10%, rgba(124, 92, 255, .35), transparent 60%),
    radial-gradient(80% 40% at 100% 100%, rgba(212, 175, 55, .10), transparent 60%);
  background-attachment: fixed;
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Колонка: на телефоне во всю ширину, на компе ~440px по центру */
.app {
  max-width: 440px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: var(--tg-viewport-stable-height, 100dvh);
  display: flex;
  flex-direction: column;
  padding: calc(var(--safe-t) + 12px) 20px 0;
}
.screen { flex: 1; padding: 8px 0 20px; outline: none; animation: enter .28s ease both; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Верх: бренд + «Шаг N из 5» + полоска */
.top { display: flex; align-items: center; justify-content: space-between; min-height: 32px; }
.brand { font-weight: 800; font-size: 22px; letter-spacing: -.02em; }
.brand i { color: var(--gold); font-style: normal; }
.stepinfo { color: var(--gold); font-weight: 600; font-size: 14px; }
.bar { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .1); overflow: hidden; margin: 10px 0 4px; }
.bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--violet), var(--gold)); transition: width .5s ease; }

h1 { font-size: 26px; line-height: 1.2; letter-spacing: -.02em; margin: 18px 0 12px; }
h2 { font-size: 22px; line-height: 1.25; margin: 18px 0 10px; }
p { margin: 0 0 12px; }
.lead { font-size: 17px; color: #DDD8F2; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
b { color: #fff; }
ul, ol { padding-left: 20px; margin: 0 0 14px; }
li { margin-bottom: 8px; }

/* Стеклянная карточка */
.card {
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 14px 0;
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card { background: rgba(255, 255, 255, .06); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
}
.card.ok { border-color: rgba(74, 222, 128, .5); }
.card p:last-child { margin-bottom: 0; }

/* Видео: 16:9 и вертикальное 9:16 (на экране шага 2) */
.video { position: relative; width: 100%; border-radius: var(--radius); overflow: hidden; background: #000; margin: 14px 0; border: 1px solid var(--glass-line); }
.video.r169 { aspect-ratio: 16 / 9; }
.video.r916 { aspect-ratio: 9 / 16; height: min(50vh, calc((100vw - 32px) * 16 / 9)); width: auto; max-width: 100%; margin-left: auto; margin-right: auto; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Кнопки */
.actions {
  position: sticky; bottom: 0;
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px 0 calc(var(--safe-b) + 10px);
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}
.actions:empty { display: none; }
.btn {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 56px; padding: 0 20px; border-radius: 16px; border: 0;
  font: inherit; font-size: 17px; font-weight: 700; color: #fff; text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn.primary { background: linear-gradient(135deg, var(--violet), #5B3FE0); box-shadow: 0 8px 24px rgba(124, 92, 255, .35); }
.btn.gold { background: linear-gradient(135deg, #E6C458, var(--gold)); color: var(--gold-ink); box-shadow: 0 8px 24px rgba(212, 175, 55, .25); }
.btn.ghost { background: rgba(255, 255, 255, .08); border: 1px solid var(--glass-line); }
.btn.small-btn { min-height: 44px; font-size: 15px; }
.btn:active { transform: scale(.985); }
.btn[disabled] { opacity: .55; cursor: default; }

/* Ссылки-кнопки (текстовые) */
.link {
  background: none; border: 0; padding: 8px 0; font: inherit; font-size: 15px;
  color: var(--violet-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; text-align: center;
}
a { color: var(--violet-2); }
.links { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin: 6px 0; }
.links .link { text-align: left; }
.prev { font-size: 14px; padding: 4px 0; color: var(--muted); text-decoration: none; }

/* Подсказка «Где найти Trader ID?» */
details.hint summary { color: var(--violet-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 8px 0; list-style: none; }
details.hint summary::-webkit-details-marker { display: none; }
details.hint p { margin: 4px 0 8px; color: var(--muted); }

/* Промокод */
.promo { color: var(--gold); font-weight: 800; }

/* Формы */
label { display: block; font-weight: 600; margin: 8px 0 6px; }
input[type="text"], input[type="tel"], input[inputmode] {
  width: 100%; min-height: 54px; padding: 0 16px; border-radius: 14px;
  border: 1px solid var(--glass-line); background: rgba(255, 255, 255, .07);
  color: var(--ink); font: inherit; font-size: 20px; letter-spacing: .05em;
}
input::placeholder { color: #7D7898; }
.msg { margin: 10px 0; font-size: 15px; }
.msg.bad { color: var(--bad); }
.msg.good { color: var(--ok); }
.form .btn { margin-top: 14px; width: 100%; }

/* Футер */
.foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; padding: 4px 0 calc(var(--safe-b) + 18px); }
.foot .link, .foot a { font-size: 14px; color: var(--muted); }

/* Доступность */
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.btn:focus-visible { border-radius: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Загрузка */
.spinner { width: 36px; height: 36px; margin: 30vh auto 0; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .15); border-top-color: var(--violet); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (min-width: 600px) {
  .app { padding-top: 32px; }
}
