/* Токены сняты с vstack.com: фон, акцент, кнопки, карточки. */
:root {
  --bg: #0b0f17;
  --text: #ffffff;
  --muted: rgba(214, 234, 255, 0.6);
  --accent: #6690ee;
  --primary: #0a6cd0;
  --primary-hover: #1679de;
  --card: rgba(102, 144, 238, 0.05);
  --card-hover: rgba(102, 144, 238, 0.1);
  --line: rgba(214, 234, 255, 0.1);
  --line-strong: rgba(214, 234, 255, 0.2);
  --disabled-bg: rgba(214, 234, 255, 0.2);
  --ok: #3ccf91;
  --bad: #ff6b6b;
  --radius: 8px;
  --font: "TT Hoves", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Отступы под вырезы экрана и шапку Telegram (Bot API 8.0+), иначе - системные. */
  --safe-top: max(var(--tg-safe-area-inset-top, 0px), env(safe-area-inset-top, 0px));
  --safe-bottom: max(var(--tg-safe-area-inset-bottom, 0px), env(safe-area-inset-bottom, 0px));
  --content-top: var(--tg-content-safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body { min-height: var(--tg-viewport-stable-height, 100vh); overflow-x: hidden; }

[hidden] { display: none !important; }

/* Свечение и дуги, как в шапке сайта */
.glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.glow::before {
  content: "";
  position: absolute;
  top: -180px;
  left: 50%;
  width: 560px;
  height: 560px;
  transform: translateX(-35%);
  background:
    radial-gradient(closest-side at 38% 45%, rgba(18, 140, 160, 0.45), transparent 70%),
    radial-gradient(closest-side at 62% 50%, rgba(52, 52, 190, 0.7), transparent 75%),
    radial-gradient(closest-side at 50% 50%, rgba(30, 40, 120, 0.5), transparent 100%);
  filter: blur(30px);
}
.glow::after {
  content: "";
  position: absolute;
  bottom: -260px;
  left: -160px;
  width: 520px;
  height: 520px;
  background: radial-gradient(closest-side, rgba(60, 40, 170, 0.35), transparent 75%);
  filter: blur(40px);
}
.arcs {
  position: absolute;
  top: -250px;
  right: -270px;
  width: 460px;
  height: 460px;
  opacity: 0.4;
}
.arcs circle { stroke: #4a4fd6; stroke-width: 0.8; }

.app {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  min-height: var(--tg-viewport-stable-height, 100vh);
  padding: calc(16px + var(--safe-top) + var(--content-top)) 16px calc(16px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.logo { font-size: 22px; font-weight: 400; letter-spacing: -0.02em; }
.badge {
  font-size: 11px;
  line-height: 1;
  padding: 3px 5px;
  border: 1px solid var(--text);
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-top: 32px;
  animation: enter 0.28s ease-out;
}
@keyframes enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.hero { text-align: center; padding: 24px 0 8px; }

h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 8vw, 40px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.accent { color: var(--accent); margin: 0 0 12px; }
.muted { color: var(--muted); margin: 0; }

.note {
  margin: 24px 0 0;
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--muted);
  font-size: 14px;
}

/* Кнопки: заливка #0A6CD0, радиус 8px, как "Request a demo" */
.actions {
  margin-top: auto;
  padding-top: 24px;
  display: flex;
  gap: 12px;
}
.btn {
  flex: 1;
  min-height: 48px;
  padding: 14px 24px;
  border: 0;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  transition: background-color 0.15s, opacity 0.15s;
}
.btn:hover:not(:disabled) { background: var(--primary-hover); }
.btn:active:not(:disabled) { opacity: 0.85; }
.btn:disabled { background: var(--disabled-bg); color: var(--muted); cursor: default; }
.btn:focus-visible, .option:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn--ghost { flex: 0 0 auto; background: transparent; border: 1px solid var(--accent); }
.btn--ghost:hover:not(:disabled) { background: var(--card-hover); }
.btn.is-loading { position: relative; color: transparent; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.progress { margin-bottom: 24px; }
.progress-label { color: var(--accent); font-size: 14px; margin-bottom: 8px; }
.progress-track { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.3s ease;
}

.question {
  margin: 0 0 24px;
  font-size: clamp(20px, 5.5vw, 26px);
  font-weight: 400;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

/* Варианты ответа - карточки как на сайте */
.options { display: flex; flex-direction: column; gap: 12px; }
.option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
  overflow-wrap: anywhere;
}
.option:hover { background: var(--card-hover); }
.option-mark {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 13px;
  color: var(--muted);
}
.option[aria-checked="true"] { border-color: var(--accent); background: rgba(102, 144, 238, 0.12); }
.option[aria-checked="true"] .option-mark { background: var(--primary); border-color: var(--primary); color: #fff; }

.score { font-size: 72px; font-weight: 300; line-height: 1; letter-spacing: -0.03em; margin-bottom: 16px; }
.score-total { color: var(--muted); font-size: 40px; }

.review { list-style: none; margin: 32px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.review li {
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--bad);
  border-radius: var(--radius);
  background: var(--card);
}
.review li.ok { border-left-color: var(--ok); }
.review-q { margin: 0 0 8px; overflow-wrap: anywhere; }
.review-a { margin: 0; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.review-a b { font-weight: 500; color: var(--text); }

.center { text-align: center; }
.hero--compact { padding-top: 0; }
.hero--compact h1 { font-size: clamp(26px, 7vw, 34px); }

/* Колесо: секторы в фирменных цветах, белая стрелка сверху */
.wheel-wrap {
  position: relative;
  width: min(84vw, 340px);
  aspect-ratio: 1;
  margin: 16px auto 8px;
}
.wheel {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 28px rgba(102, 144, 238, 0.35));
  will-change: transform;
}
.wheel text { fill: #fff; font-family: var(--font); pointer-events: none; }
.wheel-pointer {
  position: absolute;
  top: -8px;
  left: 50%;
  z-index: 2;
  transform: translateX(-50%);
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-top: 24px solid #fff;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
}
#wheel-note { margin-top: 12px; }

.code-card {
  margin: 24px 0 16px;
  padding: 20px 16px;
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  background: var(--card);
  text-align: center;
}
.code-label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 13px; }
.code {
  display: block;
  font-size: 36px;
  font-weight: 500;
  letter-spacing: 0.2em;
  /* letter-spacing добавляет отступ и после последней буквы - компенсируем */
  margin-right: -0.2em;
  user-select: all;
}

.spinner {
  margin: auto;
  width: 36px;
  height: 36px;
  border: 3px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .screen, .progress-bar { animation: none; transition: none; }
}
