/* =========================================================================
   activation-shop — клиентский портал активации
   Тёмная тема. Один акцент (бирюзово-синий). Моноширинный для кодов.
   Шрифты в проде — самохостить (см. /assets/fonts). Здесь — для превью.
   ========================================================================= */

/* ---------- Tokens ---------- */
:root {
  --bg:           #0a0c11;
  --bg-grad:      radial-gradient(1200px 700px at 50% -200px, #11161f 0%, #0a0c11 60%);
  --surface:      #12161e;
  --surface-2:    #161b25;
  --inset:        #0e121a;
  --border:       #232a36;
  --border-soft:  #1b212c;

  --text:         #e8edf4;
  --text-dim:     #98a2b3;
  --text-faint:   #5d6675;

  --accent:       #38d6c6;
  --accent-2:     #2bbcae;
  --accent-ink:   #042722;          /* текст на акцентной заливке */
  --accent-glow:  rgba(56, 214, 198, 0.16);

  --danger:       #f87171;
  --danger-bg:    rgba(248, 113, 113, 0.10);
  --danger-bd:    rgba(248, 113, 113, 0.32);
  --warn:         #f0b450;
  --warn-bg:      rgba(240, 180, 80, 0.10);
  --warn-bd:      rgba(240, 180, 80, 0.30);
  --ok:           #4ade80;
  --ok-bg:        rgba(74, 222, 128, 0.10);
  --info-bd:      rgba(56, 214, 198, 0.32);

  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;
  --r-pill: 999px;

  --shadow-card: 0 1px 0 rgba(255,255,255,0.02) inset, 0 18px 40px -20px rgba(0,0,0,0.7);
  --shadow-pop:  0 24px 60px -16px rgba(0,0,0,0.7);

  --ff-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ff-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --ease: cubic-bezier(.4,0,.2,1);
  --maxw: 460px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--ff-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-grad), var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input { font: inherit; }
a { color: inherit; }
img, svg { display: block; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.icon { width: 20px; height: 20px; stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-sm { width: 16px; height: 16px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- App shell ---------- */
.app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(10, 12, 17, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand__mark {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  box-shadow: 0 0 0 1px rgba(56,214,198,.25), 0 8px 20px -10px var(--accent);
}
.brand__mark .icon { width: 17px; height: 17px; stroke-width: 2.1; }
.brand__name { font-weight: 600; letter-spacing: .2px; font-size: 15px; }
.brand__sub { color: var(--text-faint); font-size: 12px; font-weight: 400; }

.lang {
  display: inline-flex; align-items: center;
  padding: 3px; gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
}
.lang__btn {
  padding: 5px 12px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 600; color: var(--text-dim);
  letter-spacing: .4px; transition: color .15s, background .15s;
}
.lang__btn[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent); }

.site-main {
  flex: 1;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 18px 28px;
}
.stage { width: 100%; max-width: var(--maxw); }

.site-footer {
  padding: 22px 18px 32px;
  text-align: center;
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.6;
  border-top: 1px solid var(--border-soft);
}
.site-footer a { color: var(--text-dim); text-decoration: none; border-bottom: 1px solid var(--border); }
.site-footer a:hover { color: var(--text); }
.site-footer__disclaimer { margin-top: 6px; max-width: 420px; margin-inline: auto; }

/* ---------- Screens ---------- */
.screen { display: none; }
.screen.is-active { display: block; animation: screen-in .32s var(--ease) both; }
@keyframes screen-in {
  from { opacity: .35; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Card ---------- */
.card {
  background: linear-gradient(180deg, var(--surface) 0%, #0f131b 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 26px 24px;
}
.card__head { margin-bottom: 22px; }
.card__eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
  white-space: nowrap;
}
.card__eyebrow .icon { width: 15px; height: 15px; }
.card__title { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -.3px; }
.card__lead { margin: 8px 0 0; color: var(--text-dim); font-size: 14px; }

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.field__label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--text-dim); margin-bottom: 8px;
}
.input-wrap { position: relative; display: flex; align-items: center; }
.input {
  width: 100%;
  padding: 14px 14px;
  background: var(--inset);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-family: var(--ff-mono);
  font-size: 16px; letter-spacing: 1px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder { color: var(--text-faint); letter-spacing: .5px; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.input--ro { background: var(--surface-2); color: var(--text); cursor: default; padding-right: 92px; }
.field__hint { margin: 8px 2px 0; font-size: 12.5px; color: var(--text-faint); }

/* read-only value rows (login / password) */
.value-row { display: flex; flex-direction: column; gap: 8px; }
.value-actions {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  display: flex; gap: 2px;
}
.ibtn {
  width: 38px; height: 38px; border-radius: 9px;
  display: grid; place-items: center; color: var(--text-dim);
  transition: background .15s, color .15s;
}
.ibtn:hover { background: var(--surface); color: var(--text); }
.ibtn.is-copied { color: var(--ok); }

/* ---------- Buttons ---------- */
.btn {
  --bw: 1px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%;
  min-height: 52px;
  padding: 14px 20px;
  border-radius: var(--r);
  font-size: 15.5px; font-weight: 600; letter-spacing: .2px;
  transition: transform .08s var(--ease), background .15s, border-color .15s, opacity .15s;
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn .icon { width: 19px; height: 19px; }

.btn--primary { background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 10px 26px -14px var(--accent); }
.btn--primary:hover { background: #44e1d1; }
.btn--secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn--secondary:hover { background: #1d2331; border-color: #2c3442; }
.btn--ghost { background: transparent; color: var(--text-dim); border: 1px solid transparent; }
.btn--ghost:hover { color: var(--text); background: var(--surface-2); }

.btn:disabled, .btn[aria-disabled="true"] {
  opacity: .5; cursor: not-allowed; transform: none; box-shadow: none;
}

/* loading state — JS toggles .is-loading */
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 20px; height: 20px;
  border-radius: 50%;
  border: 2.4px solid currentColor; border-top-color: transparent;
  color: var(--accent-ink);
  animation: spin .7s linear infinite;
}
.btn--secondary.is-loading::after, .btn--ghost.is-loading::after { color: var(--text); }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-row { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }

/* ---------- Steam / platform badge ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 8px; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 13px; font-weight: 500; color: var(--text);
}
.badge .icon { width: 18px; height: 18px; color: var(--accent); }

.game-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 4px; color: var(--text-dim); font-size: 14px; }
.game-line strong { color: var(--text); font-weight: 600; }

.link-inline {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent); text-decoration: none; font-size: 14px; font-weight: 500;
  border-bottom: 1px solid transparent; transition: border-color .15s;
  cursor: pointer;
}
.link-inline:hover { border-color: var(--accent); }
.link-inline .icon { width: 15px; height: 15px; }

/* ---------- Rules block ---------- */
.rules { display: grid; gap: 8px; margin: 4px 0 0; padding: 0; list-style: none; }
.rules--inline { grid-template-columns: 1fr; }
.rule {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 13px; border-radius: var(--r-sm);
  background: var(--inset); border: 1px solid var(--border-soft);
  font-size: 13.5px; color: var(--text-dim);
}
.rule .icon { width: 17px; height: 17px; color: var(--accent); }
.rule strong { color: var(--text); font-weight: 500; }

.divider { height: 1px; background: var(--border-soft); margin: 20px 0; border: 0; }

/* ---------- Inline messages (errors / status) ---------- */
.msg {
  display: none;
  align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: var(--r);
  font-size: 13.5px; line-height: 1.45;
  margin-top: 14px;
}
.msg.is-visible { display: flex; }
.msg .icon { width: 18px; height: 18px; margin-top: 1px; }
.msg--error { background: var(--danger-bg); border: 1px solid var(--danger-bd); color: #fca5a5; }
.msg--error .icon { color: var(--danger); }
.msg--warn  { background: var(--warn-bg); border: 1px solid var(--warn-bd); color: #f3c87a; }
.msg--warn .icon { color: var(--warn); }
.msg--info  { background: var(--surface-2); border: 1px solid var(--info-bd); color: var(--text-dim); }
.msg--info .icon { color: var(--accent); }
.msg__retry { margin-left: auto; align-self: center; color: inherit; font-weight: 600;
  text-decoration: underline; white-space: nowrap; }

/* ---------- 2FA code screen ---------- */
.code-stage { text-align: center; padding: 8px 0 0; }
.code-ring { position: relative; width: 168px; height: 168px; margin: 6px auto 18px; }
.code-ring svg { transform: rotate(-90deg); }
.code-ring__track { stroke: var(--border); }
.code-ring__bar {
  stroke: var(--accent); stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}
.code-ring__inner {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 2px;
}
.code-value {
  font-family: var(--ff-mono); font-weight: 600;
  font-size: 40px; letter-spacing: 8px; color: var(--text);
  padding-left: 8px; /* compensate letter-spacing */
}
.code-ring__label { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-faint); }

.code-timer { font-family: var(--ff-mono); font-size: 15px; color: var(--text-dim); }
.code-timer strong { color: var(--accent); font-weight: 600; }

.code-copy { margin: 6px auto 0; max-width: 260px; }
.code-hint { margin: 16px 0 0; color: var(--text-dim); font-size: 13.5px; }

.cooldown-note { font-size: 12.5px; color: var(--text-faint); text-align: center; margin: 8px 0 0; }

/* ---------- Instructions ---------- */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 14px; }
.step { display: grid; grid-template-columns: 34px 1fr; gap: 14px; align-items: start; }
.step__num {
  counter-increment: step;
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--accent); font-family: var(--ff-mono); font-weight: 600; font-size: 15px;
}
.step__num::before { content: counter(step); }
.step__body { padding-top: 4px; }
.step__title { font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.step__text { margin: 0; color: var(--text-dim); font-size: 13.5px; }
.step__text .link-inline { font-size: 13.5px; }
.shot {
  margin-top: 10px; aspect-ratio: 16 / 9; border-radius: var(--r-sm);
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,.012) 0 12px, transparent 12px 24px),
    var(--inset);
  border: 1px dashed var(--border); display: grid; place-content: center; gap: 4px;
  color: var(--text-faint); font-size: 12px;
}
.shot .icon { width: 22px; height: 22px; }

.rules-panel { margin-top: 22px; padding: 16px; border-radius: var(--r);
  background: var(--inset); border: 1px solid var(--border-soft); }
.rules-panel__title { display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--text); margin: 0 0 12px; }
.rules-panel__title .icon { color: var(--warn); width: 17px; height: 17px; }
.rules-panel ul { margin: 0; padding-left: 18px; display: grid; gap: 7px;
  color: var(--text-dim); font-size: 13.5px; }
.rules-panel li::marker { color: var(--accent); }

/* ---------- PoW loader ---------- */
.pow-loader {
  position: fixed; inset: 0; z-index: 80;
  display: none; align-items: center; justify-content: center;
  background: rgba(7, 9, 13, 0.72); backdrop-filter: blur(6px);
}
.pow-loader.is-visible { display: flex; animation: fade .2s var(--ease); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.pow-card {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 30px 36px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-pop); text-align: center;
}
.pow-spinner {
  width: 46px; height: 46px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
.pow-text { font-size: 14px; color: var(--text-dim); max-width: 220px; }
.pow-shield { color: var(--accent); }

/* ---------- Replace modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 70;
  display: none; align-items: flex-end; justify-content: center;
  padding: 0;
}
.modal.is-visible { display: flex; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(6, 8, 12, .66);
  backdrop-filter: blur(3px); animation: fade .2s var(--ease); }
.modal__panel {
  position: relative; width: 100%; max-width: var(--maxw);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: var(--shadow-pop);
  padding: 24px 22px calc(22px + env(safe-area-inset-bottom));
  animation: sheet-up .34s var(--ease);
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal__grip { width: 38px; height: 4px; border-radius: 99px; background: var(--border);
  margin: -8px auto 16px; }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.modal__title { margin: 0; font-size: 19px; font-weight: 600; }
.modal__close { width: 36px; height: 36px; border-radius: 9px; color: var(--text-dim);
  display: grid; place-items: center; margin: -6px -6px 0 0; }
.modal__close:hover { background: var(--surface-2); color: var(--text); }
.modal__lead { margin: 0 0 16px; color: var(--text-dim); font-size: 14px; }

.reasons { display: grid; gap: 8px; margin: 0 0 18px; }
.reason {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px; border-radius: var(--r);
  background: var(--inset); border: 1px solid var(--border);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.reason:hover { border-color: #2c3442; }
.reason input { position: absolute; opacity: 0; }
.reason__dot { width: 20px; height: 20px; border-radius: 50%; flex: none;
  border: 2px solid var(--border); display: grid; place-items: center; transition: border-color .15s; }
.reason__dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); transform: scale(0); transition: transform .15s var(--ease); }
.reason:has(input:checked) { border-color: var(--accent); background: rgba(56,214,198,.06); }
.reason:has(input:checked) .reason__dot { border-color: var(--accent); }
.reason:has(input:checked) .reason__dot::after { transform: scale(1); }
.reason__label { font-size: 14.5px; }

/* status card after submit */
.replace-status { display: none; text-align: center; padding: 6px 4px 2px; }
.replace-status.is-visible { display: block; }
.replace-status__icon {
  width: 54px; height: 54px; border-radius: 50%; margin: 0 auto 14px;
  display: grid; place-items: center;
  background: var(--accent-glow); color: var(--accent);
  position: relative;
}
.replace-status__icon::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid var(--accent-glow); animation: pulse 1.8s var(--ease) infinite;
}
@keyframes pulse { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(1.25); opacity: 0; } }
.replace-status__title { font-size: 18px; font-weight: 600; margin: 0 0 6px; }
.replace-status__text { color: var(--text-dim); font-size: 14px; margin: 0 0 18px; }
.sla {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--border);
  font-family: var(--ff-mono); font-size: 15px;
}
.sla .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn);
  box-shadow: 0 0 0 0 var(--warn); animation: blink 1.4s var(--ease) infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.sla strong { color: var(--text); }

/* ---------- Toasts ---------- */
.toast-root {
  position: fixed; z-index: 90; left: 0; right: 0; bottom: 18px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 0 16px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  max-width: 420px; width: max-content; max-width: min(420px, calc(100vw - 32px));
  padding: 12px 16px; border-radius: var(--r);
  background: #1b2230; border: 1px solid var(--border);
  box-shadow: var(--shadow-pop); font-size: 14px; color: var(--text);
  pointer-events: auto;
  animation: toast-in .26s var(--ease);
}
.toast.is-out { animation: toast-out .22s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }
.toast .icon { width: 18px; height: 18px; flex: none; }
.toast--ok .icon { color: var(--ok); }
.toast--error .icon { color: var(--danger); }
.toast--info .icon { color: var(--accent); }

/* ---------- Demo panel (только для превью — удалить в проде) ---------- */
.demo {
  position: fixed; z-index: 95; right: 14px; bottom: 14px;
  font-family: var(--ff-sans);
}
.demo__toggle {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: var(--r-pill);
  background: #1b2230; border: 1px solid var(--border);
  box-shadow: var(--shadow-pop); font-size: 12.5px; font-weight: 600; color: var(--text-dim);
}
.demo__toggle .icon { width: 15px; height: 15px; color: var(--accent); }
.demo__panel {
  display: none; position: absolute; right: 0; bottom: 46px;
  width: 244px; max-height: 70vh; overflow-y: auto;
  padding: 12px; border-radius: var(--r);
  background: #141a24; border: 1px solid var(--border); box-shadow: var(--shadow-pop);
}
.demo.is-open .demo__panel { display: block; }
.demo__group { margin-bottom: 12px; }
.demo__group:last-child { margin-bottom: 0; }
.demo__group h4 { margin: 0 0 7px; font-size: 10.5px; letter-spacing: .8px; text-transform: uppercase; color: var(--text-faint); }
.demo__btns { display: flex; flex-wrap: wrap; gap: 6px; }
.demo__b {
  padding: 6px 10px; border-radius: 7px; font-size: 12px; font-weight: 500;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim);
}
.demo__b:hover { color: var(--text); border-color: #2c3442; }

/* ---------- Responsive ---------- */
@media (min-width: 600px) {
  .site-main { padding-top: 56px; }
  .btn-row--split { flex-direction: row; }
  .modal { align-items: center; }
  .modal__panel { border-radius: var(--r-lg); margin: 0 16px; }
  .modal__grip { display: none; }
  .card { padding: 30px 30px; }
}
@media (max-width: 360px) {
  .code-value { font-size: 34px; letter-spacing: 6px; }
  .card { padding: 22px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
