/* =========================================================================
   Оформление лендинга, кабинета и админки — в стиле доски
   (тёмная неоновая тема по умолчанию + светлая «лаванда» через body.light)
   ========================================================================= */
:root {
  --bg: #0a0a0f;
  --bg2: #0d0f1f;
  --card: rgba(17, 17, 26, 0.85);
  --card-solid: #11111a;
  --line: rgba(255, 255, 255, 0.09);
  --line2: rgba(255, 255, 255, 0.15);
  --text: #cbd5e1;
  --strong: #ffffff;
  --muted: #94a3b8;
  --dim: #64748b;
  --accent: #818cf8;
  --input: #0a0a0f;
  --glow: 0 0 50px rgba(99, 102, 241, 0.15);
}
body.light {
  --bg: #f8fafc;
  --bg2: #ffffff;
  --card: rgba(255, 255, 255, 0.9);
  --card-solid: #ffffff;
  --line: #e2e8f0;
  --line2: #cbd5e1;
  --text: #334155;
  --strong: #0f172a;
  --muted: #64748b;
  --dim: #94a3b8;
  --accent: #6366f1;
  --input: #f8fafc;
  --glow: 0 10px 40px rgba(99, 102, 241, 0.10);
}

html { scroll-behavior: smooth; }
body.site {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Onest', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s, color .3s;
}
.t-strong { color: var(--strong); }
.t-muted { color: var(--muted); }
.t-dim { color: var(--dim); }
.t-accent { color: var(--accent); }

.grad-text {
  background: linear-gradient(90deg, #818cf8, #c084fc 45%, #22d3ee);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
body.light .grad-text { background: linear-gradient(90deg, #4f46e5, #9333ea 50%, #0891b2); -webkit-background-clip: text; background-clip: text; }

/* Сетка-«тетрадь» на фоне */
.bg-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(99,102,241,.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(99,102,241,.07) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 75%);
}
.blob { position: absolute; border-radius: 50%; filter: blur(90px); pointer-events: none; opacity: .5; }
body.light .blob { opacity: .25; }

/* Шапка */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: rgba(10, 10, 15, .85); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
body.light .site-nav { background: rgba(255,255,255,.88); }
.nav-link { font-size: 13px; font-weight: 800; color: var(--muted); transition: color .2s; }
.nav-link:hover { color: var(--strong); }

/* Стеклянные карточки */
.glass {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 2rem;
  box-shadow: var(--glow);
  backdrop-filter: blur(14px);
}
.glass-hover { transition: transform .25s cubic-bezier(.16,1,.3,1), border-color .25s, box-shadow .25s; }
.glass-hover:hover { transform: translateY(-4px); border-color: rgba(129,140,248,.45); box-shadow: 0 0 40px rgba(99,102,241,.25); }

.icon-box {
  width: 48px; height: 48px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(99,102,241,.15); border: 1px solid rgba(129,140,248,.6);
  color: #818cf8; box-shadow: 0 0 15px rgba(99,102,241,.35);
}
.icon-box.cyan { background: rgba(6,182,212,.12); border-color: rgba(34,211,238,.55); color: #22d3ee; box-shadow: 0 0 15px rgba(6,182,212,.3); }
.icon-box.pink { background: rgba(217,70,239,.12); border-color: rgba(232,121,249,.55); color: #e879f9; box-shadow: 0 0 15px rgba(217,70,239,.3); }
.icon-box.amber { background: rgba(245,158,11,.12); border-color: rgba(251,191,36,.55); color: #fbbf24; box-shadow: 0 0 15px rgba(245,158,11,.25); }
.icon-box.emerald { background: rgba(16,185,129,.12); border-color: rgba(52,211,153,.55); color: #34d399; box-shadow: 0 0 15px rgba(16,185,129,.25); }
.icon-box.rose { background: rgba(244,63,94,.12); border-color: rgba(251,113,133,.55); color: #fb7185; box-shadow: 0 0 15px rgba(244,63,94,.25); }

.label {
  font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .14em; color: var(--accent);
}
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px;
  font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .12em;
  color: #c4b5fd; background: rgba(139,92,246,.12); border: 1px solid rgba(167,139,250,.4);
}
body.light .pill { color: #6d28d9; background: #f5f3ff; border-color: #ddd6fe; }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 16px;
  font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em;
  transition: all .2s; cursor: pointer; white-space: nowrap; border: 0;
}
.btn:active { transform: scale(.97); }
.btn-primary { color: #fff; background: linear-gradient(90deg, #6366f1, #9333ea); box-shadow: 0 0 22px rgba(99,102,241,.4); }
.btn-primary:hover { background: linear-gradient(90deg, #4f46e5, #7e22ce); box-shadow: 0 0 30px rgba(139,92,246,.55); }
.btn-ghost { color: var(--text); background: rgba(255,255,255,.05); border: 1px solid var(--line2); }
.btn-ghost:hover { color: var(--strong); background: rgba(255,255,255,.1); }
body.light .btn-ghost { background: #fff; }
body.light .btn-ghost:hover { background: #f1f5f9; }
.btn-danger { color: #fb7185; background: rgba(244,63,94,.1); border: 1px solid rgba(244,63,94,.3); }
.btn-danger:hover { background: rgba(244,63,94,.2); }
.btn-success { color: #34d399; background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.35); }
.btn-success:hover { background: rgba(16,185,129,.22); }
.btn-sm { height: 34px; padding: 0 12px; border-radius: 12px; font-size: 10.5px; }
.btn-lg { height: 54px; padding: 0 28px; border-radius: 18px; font-size: 13px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.05); border: 1px solid var(--line2); color: var(--text); transition: all .2s; cursor: pointer;
}
.icon-btn:hover { background: rgba(255,255,255,.1); color: var(--strong); }
body.light .icon-btn { background: #fff; }

/* Поля ввода */
.field {
  width: 100%; height: 48px; padding: 0 16px; border-radius: 16px;
  background: var(--input); border: 1px solid var(--line2); color: var(--strong);
  font-weight: 700; font-size: 14px; outline: none; transition: border-color .2s, box-shadow .2s;
  font-family: inherit;
}
.field:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.2); }
.field::placeholder { color: var(--dim); font-weight: 600; }
.field-label { display: block; font-size: 10.5px; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); margin-bottom: 6px; }

/* Модальные окна */
.modal-back {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(6,6,12,.8); backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
}
.modal-back.open { opacity: 1; visibility: visible; }
.modal-card {
  width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--bg2); border: 2px solid rgba(99,102,241,.55); border-radius: 2rem; padding: 28px;
  box-shadow: 0 25px 70px rgba(0,0,0,.7), 0 0 50px rgba(99,102,241,.25);
  transform: translateY(12px) scale(.97); transition: transform .3s cubic-bezier(.16,1,.3,1);
}
.modal-back.open .modal-card { transform: none; }
body.light .modal-back { background: rgba(241,245,249,.8); }
body.light .modal-card { box-shadow: 0 20px 60px rgba(99,102,241,.18); }

.seg { display: flex; gap: 6px; padding: 5px; border-radius: 16px; background: rgba(0,0,0,.3); border: 1px solid var(--line); }
body.light .seg { background: #f1f5f9; }
.seg button { flex: 1; height: 38px; border-radius: 12px; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); transition: all .2s; }
.seg button.active { color: #fff; background: linear-gradient(135deg, rgba(99,102,241,.9), rgba(168,85,247,.9)); box-shadow: 0 0 16px rgba(99,102,241,.4); }

/* Тарифы */
.plan.featured { border: 2px solid rgba(168,85,247,.7); box-shadow: 0 0 60px rgba(168,85,247,.25); }
.price { font-size: 44px; line-height: 1; font-weight: 900; color: var(--strong); letter-spacing: -.02em; }

/* Чипы тем банка задач */
.topic-chip {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px;
  background: rgba(255,255,255,.03); border: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--text);
}
body.light .topic-chip { background: #fff; }
.topic-num {
  flex-shrink: 0; min-width: 34px; height: 24px; padding: 0 6px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 900; color: #fff; background: linear-gradient(135deg, #6366f1, #a855f7);
}

/* FAQ */
details.faq { border-bottom: 1px solid var(--line); }
details.faq summary { list-style: none; cursor: pointer; padding: 20px 4px; display: flex; justify-content: space-between; align-items: center; gap: 16px; font-weight: 800; color: var(--strong); font-size: 16px; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary .chev { transition: transform .25s; color: var(--accent); flex-shrink: 0; }
details.faq[open] summary .chev { transform: rotate(180deg); }
details.faq .ans { padding: 0 4px 20px; color: var(--muted); line-height: 1.65; font-size: 15px; }

/* Карточки досок в кабинете */
.board-card { position: relative; overflow: hidden; }
.board-thumb {
  height: 120px; border-radius: 1.25rem; position: relative; overflow: hidden;
  background-color: #ffffff;
  background-image:
    linear-gradient(to right, rgba(99,102,241,.09) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(99,102,241,.09) 1px, transparent 1px),
    linear-gradient(to right, rgba(99,102,241,.18) 1.4px, transparent 1.4px),
    linear-gradient(to bottom, rgba(99,102,241,.18) 1.4px, transparent 1.4px);
  background-size: 15px 15px, 15px 15px, 75px 75px, 75px 75px;
  border: 1px solid var(--line);
}

/* Таблицы (админка) */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--text); vertical-align: middle; }
.tbl tr:hover td { background: rgba(99,102,241,.05); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 10.5px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.badge-on { color: #34d399; background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.35); }
.badge-off { color: #fb7185; background: rgba(244,63,94,.1); border: 1px solid rgba(244,63,94,.3); }
.badge-wait { color: #fbbf24; background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.3); }

/* Иконки темы */
body:not(.light) .moon-icon { display: none; }
body.light .sun-icon { display: none; }

/* Скроллбар как на основном сайте */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(139,92,246,.45); border-radius: 10px; }

/* Тосты основного сайта в светлой теме */
body.light #arena-toast-container > div { background: #fff !important; }
body.light #arena-toast-container span.text-white { color: #0f172a !important; }
body.light #arena-toast-container p { color: #475569 !important; }
#arena-toast-container { z-index: 9999 !important; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.16,1,.3,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

.btn.hidden, .icon-btn.hidden { display: none; }
@media (max-width: 639px) { #nav-try { display: none; } }
