/* Палитра XTONE: #FF590D #282828 #F6F6F6 #FFFFFF #FF9A6C */
:root {
  --orange: #FF590D;
  --peach: #FF9A6C;
  --ink: #282828;
  --paper: #F6F6F6;
  --white: #FFFFFF;

  --bg: var(--paper);
  --card: var(--white);
  --text: var(--ink);
  --muted: rgba(40, 40, 40, .58);
  --line: rgba(40, 40, 40, .08);
  --field: var(--paper);
  --tint: rgba(255, 154, 108, .16);
  --radius: 26px;
}
:root[data-theme="dark"] {
  --bg: #1E1E1E;
  --card: var(--ink);
  --text: var(--paper);
  --muted: rgba(246, 246, 246, .58);
  --line: rgba(246, 246, 246, .1);
  --field: rgba(246, 246, 246, .06);
  --tint: rgba(255, 154, 108, .14);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.42 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, textarea { font: inherit; color: inherit; -webkit-appearance: none; appearance: none; }
b { font-weight: 600; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 15px; }

.wrap { max-width: 520px; margin: 0 auto; padding: 12px 14px calc(28px + env(safe-area-inset-bottom)); }

/* ---------- Шапка ---------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--ink); color: var(--white);
  border-radius: 30px; padding: 20px 22px 22px; margin-bottom: 10px;
}
.hero-glow {
  position: absolute; width: 260px; height: 260px; right: -90px; top: -110px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 89, 13, .75) 0%, rgba(255, 154, 108, .25) 45%, transparent 70%);
  filter: blur(6px); pointer-events: none;
}
.hero-top { position: relative; display: flex; justify-content: space-between; align-items: center; }
.brand { font-weight: 700; font-size: 13px; letter-spacing: .12em; color: var(--peach); }
.pill {
  font-size: 12px; font-weight: 700; padding: 5px 11px; border-radius: 99px;
  background: linear-gradient(135deg, var(--orange), var(--peach)); color: var(--white);
}
.hero h1 { position: relative; margin: 22px 0 6px; font-size: 32px; line-height: 1.05; letter-spacing: -.025em; }
.hero-sub { position: relative; margin: 0; color: rgba(255, 255, 255, .62); font-size: 15px; }
.progress { position: relative; display: flex; gap: 6px; margin-top: 18px; }
.progress span { flex: 1; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .14); transition: background .35s ease; }
.progress span.on { background: linear-gradient(90deg, var(--orange), var(--peach)); }
.progress.hidden-bar { display: none; }

/* ---------- Карточки ---------- */
.view { display: flex; flex-direction: column; gap: 10px; animation: rise .32s cubic-bezier(.2, .8, .2, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.card { background: var(--card); border-radius: var(--radius); padding: 18px; }
.card.center { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 30px 22px; }
.card.tall { padding: 40px 24px 34px; }
.title { font-weight: 650; font-size: 17px; letter-spacing: -.01em; }
.title.big { font-size: 23px; letter-spacing: -.02em; margin-top: 8px; }

/* Шаги */
.step { display: flex; gap: 14px; transition: box-shadow .3s ease; }
.step .num {
  flex: 0 0 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--tint); color: var(--orange); font-weight: 700; font-size: 15px;
  transition: background .3s ease, color .3s ease;
}
.step.done .num { background: var(--orange); color: var(--white); }
.step.done .num span { font-size: 0; }
.step.done .num span::after { content: "✓"; font-size: 16px; }
.step .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }

/* Кнопки */
.btn {
  border: 0; cursor: pointer; font-weight: 650;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .12s ease, opacity .2s ease, box-shadow .2s ease;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .6; pointer-events: none; }
.btn i { font-style: normal; }
.btn.chip {
  align-self: flex-start; margin-top: 6px; padding: 10px 15px; border-radius: 14px;
  background: var(--tint); color: var(--orange); font-size: 15px;
}
.btn.primary, .btn.dark {
  width: 100%; padding: 18px; border-radius: 22px; font-size: 17px; color: var(--white);
}
.btn.primary {
  background: linear-gradient(135deg, var(--orange) 0%, var(--peach) 130%);
  box-shadow: 0 10px 24px -10px rgba(255, 89, 13, .7);
}
.btn.primary i { transition: transform .2s ease; }
.btn.primary:hover i { transform: translateX(3px); }
.btn.dark { background: var(--ink); }
:root[data-theme="dark"] .btn.dark { background: var(--paper); color: var(--ink); }

/* Поле токена */
.field { position: relative; margin-top: 6px; }
textarea {
  display: block; width: 100%; padding: 14px 14px 46px; resize: none;
  border: 1.5px solid transparent; border-radius: 18px; background: var(--field);
  font: 13px/1.45 ui-monospace, "SF Mono", Menlo, monospace;
  transition: border-color .2s ease, box-shadow .2s ease;
}
textarea::placeholder { color: var(--muted); }
textarea:focus { outline: none; border-color: var(--peach); box-shadow: 0 0 0 4px var(--tint); }
textarea.bad { border-color: var(--orange); }
.paste {
  position: absolute; right: 10px; bottom: 10px; border: 0; cursor: pointer;
  padding: 7px 13px; border-radius: 12px; font-size: 14px; font-weight: 650;
  background: var(--ink); color: var(--white);
}
:root[data-theme="dark"] .paste { background: var(--paper); color: var(--ink); }
.error { color: var(--orange); font-size: 14px; font-weight: 500; }

/* Плашки */
.warn, .notice { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; }
.warn { background: var(--tint); }
.warn-icon, .notice-icon {
  flex: 0 0 26px; height: 26px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: var(--orange); color: var(--white); font-weight: 800; font-size: 14px;
}
.notice { border: 1.5px solid var(--peach); }
.notice-icon { background: var(--peach); }
.foot { margin: 4px 0 0; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- Ожидание ---------- */
.ring {
  width: 38px; height: 38px; border-radius: 50%;
  border: 4px solid var(--tint); border-top-color: var(--orange);
  animation: spin .9s linear infinite;
}
.ring.big { position: absolute; inset: 0; width: auto; height: auto; border-width: 5px; }
@keyframes spin { to { transform: rotate(360deg); } }
.orbit { position: relative; width: 84px; height: 84px; }
.orbit-core {
  position: absolute; inset: 14px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--orange), var(--peach)); color: var(--white); font-size: 24px;
}
.stages { list-style: none; margin: 14px 0 0; padding: 0; width: 100%; max-width: 300px; text-align: left; }
.stages li {
  position: relative; padding: 9px 0 9px 30px; color: var(--muted); font-size: 15px;
  border-top: 1px solid var(--line);
}
.stages li:first-child { border-top: 0; }
.stages li::before {
  content: ""; position: absolute; left: 4px; top: 50%; width: 12px; height: 12px; margin-top: -6px;
  border-radius: 50%; border: 2px solid var(--line);
}
.stages li.on { color: var(--text); }
.stages li.on::before { background: var(--orange); border-color: var(--orange); }
.stages li.pulse::before { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 89, 13, .5); } 50% { box-shadow: 0 0 0 7px rgba(255, 89, 13, 0); } }

/* ---------- Успех ---------- */
.check {
  width: 92px; height: 92px; border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), var(--peach));
  box-shadow: 0 0 0 10px var(--tint), 0 16px 30px -12px rgba(255, 89, 13, .8);
  display: flex; align-items: center; justify-content: center;
  animation: pop .5s cubic-bezier(.2, 1.4, .4, 1);
}
.check svg { width: 52px; height: 52px; fill: none; stroke: var(--white); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.check path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .45s .25s ease forwards; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.until {
  margin: 2px 0 4px; padding: 8px 14px; border-radius: 14px;
  background: var(--tint); color: var(--orange); font-size: 15px;
}
.until b { color: var(--text); }

.badge {
  width: 76px; height: 76px; border-radius: 50%; font-size: 34px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  background: var(--tint); color: var(--orange);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .check path { stroke-dashoffset: 0; }
}
