/* Morphyx — общая основа: токены, типографика, liquid glass.
   Используется и лендингом, и личным кабинетом. */

@font-face { font-family: 'MorphyxDigits'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('/fonts/jbmono-digits.woff2') format('woff2'); unicode-range: U+0030-0039; }

:root {
  --bg: #0A0909;
  --bg-2: #100F0E;
  --ink: #F2EFEA;
  --ink-2: rgba(242, 239, 234, .64);
  --ink-3: rgba(242, 239, 234, .54);
  --ink-4: rgba(242, 239, 234, .18);
  --line: rgba(242, 239, 234, .08);
  --line-2: rgba(242, 239, 234, .14);
  --red: #D0313F;
  --red-ink: #FF5A66;
  --red-wash: rgba(208, 49, 63, .12);
  --ok: #7FD1A3;
  --warn: #E2B866;

  --sans: 'Onest', 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  /* Мелкие подписи и цифры — тем же гротеском с табличными цифрами; моноширинный только для ключей/ссылок */
  --mono: 'Onest', 'Manrope', system-ui, sans-serif;
  --code: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --r-s: 12px; --r-m: 20px; --r-l: 28px; --r-xl: 36px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.34, 1.4, .5, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--sans);
  font-size: 16px; line-height: 1.55; letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01', 'cv11';
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
img, svg { display: block; }
::selection { background: var(--red); color: #fff; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; letter-spacing: -.01em; }
.code, .keybox input, .shop-key, .ps-key, .acode { font-family: var(--code) !important; letter-spacing: 0; }
.hidden { display: none !important; }
.x { color: var(--red); }

/* Зерно — убирает «пластиковость» тёмного фона */
.grain { position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ───────── Liquid glass ─────────
   Слой 1: размытие + насыщенность фона (+ преломление в Chromium, см. glass.js)
   Слой 2: внутренние блики — верхний край светлее, нижний ловит отражение
   Слой 3: ::before — тонкий ободок с градиентом, имитирует толщину стекла */
.glass {
  position: relative; isolation: isolate;
  background: linear-gradient(165deg, rgba(255,255,255,.085) 0%, rgba(255,255,255,.025) 42%, rgba(255,255,255,.04) 100%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
  box-shadow:
    inset 0 1px 0 0 rgba(255,255,255,.22),
    inset 0 -1px 0 0 rgba(255,255,255,.05),
    inset 1px 0 0 0 rgba(255,255,255,.06),
    inset -1px 0 0 0 rgba(255,255,255,.04),
    0 1px 1px rgba(0,0,0,.25),
    0 24px 60px -24px rgba(0,0,0,.7);
}
.glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; z-index: 1;
  background: linear-gradient(150deg, rgba(255,255,255,.42) 0%, rgba(255,255,255,.06) 28%, rgba(255,255,255,0) 50%, rgba(255,255,255,.05) 72%, rgba(255,255,255,.24) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.glass.thin { -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
  background: linear-gradient(165deg, rgba(255,255,255,.07), rgba(255,255,255,.02)); }
.glass.dense { background: linear-gradient(165deg, rgba(30,28,27,.72), rgba(16,15,14,.66)); }

/* Блик, следующий за курсором (glass.js выставляет --mx/--my) */
.glass[data-sheen]::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0;
  background: radial-gradient(420px circle at var(--mx, 30%) var(--my, -20%), rgba(255,255,255,.07), transparent 45%);
  transition: opacity .4s var(--ease); opacity: var(--sheen-o, 0);
}
.glass[data-sheen]:hover { --sheen-o: 1; }

/* ───────── Кнопки ───────── */
.btn {
  --h: 52px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--h); padding: 0 26px; border-radius: 999px; white-space: nowrap;
  font-weight: 560; font-size: 15px; letter-spacing: -.01em;
  transition: transform .5s var(--spring), background .3s var(--ease), color .3s var(--ease), box-shadow .3s var(--ease), opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-primary { background: var(--ink); color: #0A0909; }
.btn-primary:hover { background: #fff; box-shadow: 0 10px 30px -10px rgba(255,255,255,.35); }
.btn-red { background: var(--red); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), inset 0 -1px 0 rgba(0,0,0,.2); }
.btn-red:hover { background: #DC3B49; }
.btn-glass { color: var(--ink); }
.btn-glass:hover { background-color: rgba(255,255,255,.06); }
.btn .arr { width: 16px; height: 16px; transition: transform .45s var(--spring); }
.btn:hover .arr { transform: translateX(3px); }
.btn.sm { --h: 40px; padding: 0 18px; font-size: 14px; }
.btn.block { width: 100%; }

/* ───────── Поля ───────── */
.field {
  width: 100%; height: 54px; padding: 0 18px; border-radius: 16px; outline: none;
  background: rgba(0,0,0,.35); border: 1px solid var(--line-2); color: var(--ink); font-size: 16px;
  transition: border-color .25s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease);
}
.field::placeholder { color: var(--ink-4); }
.field:focus { border-color: rgba(242,239,234,.36); background: rgba(0,0,0,.5); box-shadow: 0 0 0 4px rgba(242,239,234,.06); }
.field.err { border-color: rgba(255,90,102,.6); box-shadow: 0 0 0 4px rgba(255,90,102,.10); }

.label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 10px; }
.eyebrow { font-family: var(--sans); font-size: 14px; font-weight: 500; letter-spacing: -.005em; color: var(--ink-2); display: inline-flex; align-items: center; gap: 10px; }
.eyebrow b { font-weight: 600; color: var(--red-ink); font-variant-numeric: tabular-nums; }

/* ───────── Логотип ───────── */
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 640; font-size: 17px; letter-spacing: -.03em; }
.logo svg { width: 24px; height: 22px; }

.chip { display: inline-flex; align-items: center; height: 30px; padding: 0 13px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--ink-2); border: 1px solid var(--line-2); background: rgba(255,255,255,.02); white-space: nowrap; }

/* ───────── Индикаторы ───────── */
.spin { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--ink);
  animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pulse-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex-shrink: 0; }
.pulse-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--ok);
  animation: ping 2.2s var(--ease-out) infinite; }
@keyframes ping { 0% { transform: scale(.6); opacity: .9 } 100% { transform: scale(2.2); opacity: 0 } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
