/* Детектор: клиентская страница.
   Лаконичный тёмный дизайн, крупный код — читается и на записи экрана. */

:root {
  --bg: #0a0d13;
  --card: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.09);
  --text: #eef2f8;
  --muted: #8a93a6;
  --a1: #6c8cff;
  --a2: #38d9c9;
  --grad: linear-gradient(135deg, var(--a1), var(--a2));
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
  position: relative;
}

/* мягкое свечение фона */
body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(620px 420px at 18% -5%, rgba(108, 140, 255, 0.16), transparent 60%),
    radial-gradient(520px 420px at 95% 105%, rgba(56, 217, 201, 0.12), transparent 60%);
  pointer-events: none;
}

#app {
  max-width: 540px;
  margin: 0 auto;
  padding: 1.2rem 1rem 3rem;
  position: relative;
}

.screen { padding-top: 6vh; }
.hidden { display: none !important; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 2rem 1.5rem;
  backdrop-filter: blur(8px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.card.center { text-align: center; }

h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: .8rem; letter-spacing: -.01em; }
h2 { font-size: 1.35rem; font-weight: 700; margin-bottom: 1rem; letter-spacing: -.01em; }
p  { font-size: 1.05rem; line-height: 1.55; color: var(--text); }
.hint { color: var(--muted); font-size: 1rem; margin-bottom: 1.2rem; }

.icon-badge {
  width: 64px; height: 64px;
  margin: 0 auto 1.2rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.9rem;
  border-radius: 18px;
  background: rgba(255, 190, 90, 0.12);
  border: 1px solid rgba(255, 190, 90, 0.3);
}
.icon-badge.ok {
  background: rgba(56, 217, 160, 0.12);
  border-color: rgba(56, 217, 160, 0.35);
  color: #4be3a0;
  font-weight: 800;
}

/* ── экран генерации ── */
.spinner {
  width: 62px; height: 62px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--a1);
  animation: spin 0.85s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.gen-bar {
  width: 100%; height: 6px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  overflow: hidden;
  margin: 1.4rem 0 .9rem;
}
.gen-fill {
  height: 100%; width: 0%;
  background: var(--grad);
  border-radius: 999px;
  transition: width .35s ease;
}
.gen-status { color: var(--muted); font-size: .95rem; min-height: 1.3em; }

/* ── экран кода ── */
.clock {
  display: inline-block;
  font-size: .92rem; font-weight: 600;
  color: var(--muted);
  padding: .32rem .8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  margin-bottom: 1.4rem;
}

.code-label {
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--muted);
  font-weight: 600;
}

.code {
  font-size: clamp(3rem, 15vw, 4.6rem);
  font-weight: 800;
  letter-spacing: .05em;
  line-height: 1.05;
  margin: .6rem 0 .4rem;
  font-variant-numeric: tabular-nums;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: opacity .18s ease;
}
.code.rotating { opacity: .25; }

.code-countdown {
  font-size: .9rem; color: var(--muted);
  min-height: 1.2em; margin-bottom: 1.6rem;
  font-variant-numeric: tabular-nums;
}

.steps { list-style: none; margin: 0 0 1.4rem; }
.steps li {
  position: relative;
  padding-left: 2.2rem;
  margin-bottom: .85rem;
  font-size: 1.05rem;
  line-height: 1.5;
}
.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute; left: 0; top: .06rem;
  width: 1.55rem; height: 1.55rem;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700;
  border-radius: 50%;
  background: rgba(108, 140, 255, 0.16);
  border: 1px solid rgba(108, 140, 255, 0.4);
  color: var(--a1);
}
.steps { counter-reset: step; }

.status { font-size: 1rem; color: var(--muted); margin-top: 1rem; min-height: 1.4em; }

.note { font-size: .8rem; color: #626c80; margin: 1.2rem 0 1.4rem; line-height: 1.5; }

.footnote {
  text-align: center;
  color: #5a6377;
  font-size: .8rem;
  margin-top: 1.2rem;
  letter-spacing: .02em;
}

.deal { color: var(--muted); font-size: 1rem; margin-bottom: .9rem; }
.deal b { color: var(--text); }

/* ── кнопки ── */
.btn {
  display: block; width: 100%;
  padding: 1rem 1.2rem;
  font-size: 1.15rem; font-weight: 700;
  border: none; border-radius: 14px;
  cursor: pointer;
  touch-action: manipulation;
  margin-top: 1rem;
  transition: transform .12s ease, filter .12s ease;
}
.btn:active { transform: scale(.985); }

.btn.primary {
  background: var(--grad);
  color: #061018;
  box-shadow: 0 8px 26px rgba(88, 130, 255, 0.28);
}
.btn.primary:disabled { filter: grayscale(.4) brightness(.75); }

.btn.ghost {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 500; font-size: 1rem;
}

.btn.giant {
  min-height: 140px;
  font-size: 1.6rem;
  border-radius: 20px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.color-blue   { background: linear-gradient(135deg, #2b6cff, #1548c8); }
.color-green  { background: linear-gradient(135deg, #22c55e, #15803d); }
.color-red    { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.color-yellow { background: linear-gradient(135deg, #facc15, #d97706); color: #221503 !important; text-shadow: none; }

/* ── слово-маяк ── */
.wait-word {
  min-height: 5rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; font-weight: 800; letter-spacing: .06em;
  margin: 1rem 0;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.wait-word.visible { animation: pop .35s ease-out; }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
