/* Общая дизайн-система: цвета, типографика, кнопки, стекло, анимированный фон.
   Фирменные цвета меняются в одном месте (переменные --a1, --a2, --a3) после появления логотипа. */

:root {
  --bg: #09070a;
  --bg-2: #120a0f;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.075);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #f7f1f3;
  --muted: #ab9aa1;
  --faint: #806d75;

  --a1: #d61b3b;
  --a2: #ff5c6c;
  --a3: #ff4d6a;
  --grad: linear-gradient(120deg, #a3132f 0%, #d61b3b 52%, #ff4d6a 100%);
  --grad-cool: linear-gradient(120deg, #ff5c6c 0%, #d61b3b 100%);
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #fb7185;

  --r-s: 10px;
  --r-m: 16px;
  --r-l: 24px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.7);
  --glow: 0 0 40px -8px rgba(214, 27, 59, 0.55);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Inter", "SF Pro Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Consolas, "Courier New", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }
::selection { background: rgba(214, 27, 59, 0.45); }
:focus-visible { outline: 2px solid var(--a2); outline-offset: 2px; border-radius: 6px; }

/* тонкие скроллбары */
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.16) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.26); }

/* ---------- живой фон ---------- */
.aurora { position: fixed; inset: 0; z-index: -2; overflow: hidden; background: var(--bg); }
.aurora i {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  will-change: transform;
}
.aurora i:nth-child(1) { width: 620px; height: 620px; left: -160px; top: -180px; background: radial-gradient(circle, #d61b3b, transparent 65%); animation: drift1 26s ease-in-out infinite alternate; }
.aurora i:nth-child(2) { width: 560px; height: 560px; right: -140px; top: 8%; background: radial-gradient(circle, #ff4d6a, transparent 65%); opacity: 0.32; animation: drift2 32s ease-in-out infinite alternate; }
.aurora i:nth-child(3) { width: 640px; height: 640px; left: 22%; bottom: -320px; background: radial-gradient(circle, #8f1230, transparent 65%); opacity: 0.4; animation: drift3 38s ease-in-out infinite alternate; }
.aurora::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 20%, transparent 75%);
}
@keyframes drift1 { to { transform: translate(180px, 140px) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-200px, 180px) scale(0.9); } }
@keyframes drift3 { to { transform: translate(220px, -120px) scale(1.2); } }

/* ---------- элементы ---------- */
.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% 100%;
  animation: shimmer-text 8s linear infinite;
}
@keyframes shimmer-text { to { background-position: 200% 0; } }

.glass {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s, border-color 0.25s, opacity 0.2s;
  user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.btn-primary {
  color: #fff;
  background: var(--grad);
  background-size: 160% 100%;
  box-shadow: 0 10px 30px -10px rgba(179, 21, 58, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  overflow: hidden;
}
.btn-primary::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  animation: shine 4.5s var(--ease) infinite;
}
@keyframes shine { 0%, 55% { left: -60%; } 100% { left: 130%; } }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -10px rgba(179, 21, 58, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.3); background-position: 100% 0; }
.btn-ghost { background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line-2); transform: translateY(-1px); }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: 14px; border-radius: 12px; }
.btn-danger { background: rgba(251, 113, 133, 0.12); border: 1px solid rgba(251, 113, 133, 0.3); color: var(--danger); }
.btn-danger:hover { background: rgba(251, 113, 133, 0.2); }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 13.5px;
  transition: all 0.2s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip.on { color: #fff; border-color: transparent; background: var(--grad); box-shadow: 0 6px 20px -8px rgba(179, 21, 58, 0.8); }

.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: #ffc7d0;
  background: rgba(214, 27, 59, 0.14);
  border: 1px solid rgba(214, 27, 59, 0.35);
}
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); animation: pulse-dot 2s infinite; }
@keyframes pulse-dot { 70% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }

.logo { display: inline-flex; align-items: center; gap: 11px; font-weight: 700; font-size: 19px; letter-spacing: -0.02em; }
.logo-mark { width: 34px; height: 34px; flex: none; border-radius: 50%; filter: drop-shadow(0 4px 14px rgba(214, 27, 59, 0.6)); }

/* появление при прокрутке */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }

/* тосты */
.toasts { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast {
  pointer-events: auto;
  max-width: min(380px, calc(100vw - 32px));
  padding: 13px 18px;
  border-radius: 14px;
  background: rgba(26, 14, 19, 0.92);
  border: 1px solid var(--line-2);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  font-size: 14.5px;
  animation: toast-in 0.45s var(--ease);
}
.toast.err { border-color: rgba(251, 113, 133, 0.5); }
.toast.ok { border-color: rgba(52, 211, 153, 0.5); }
.toast.out { opacity: 0; transform: translateY(10px); transition: all 0.3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(0.96); } }

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