/* ============================================================================
   Тайный проводник — дизайн-система «луч во тьме».
   Тёмная база, тёплый луч-проводник + холодный свет, стекло и глубина.
   Без внешних зависимостей (CSP-friendly): только системные шрифты, CSS-свет.
   ========================================================================== */
:root {
  --bg:        #f3f4f6;   /* светлая база, в тон лендингу */
  --bg-2:      #e9eaec;
  --surface:   #ffffff;   /* карточки/панели */
  --surface-2: #ffffff;
  --fg:        #111111;
  --muted:     #5f6470;
  --beam:      #3a3a3a;   /* тёмный акцент (градиент кнопок) */
  --accent:    #1f6feb;   /* ссылки/фокус — читаемый синий на белом */
  --accent-2:  #6b46ff;
  --ok:        #15803d;
  --danger:    #dc2626;
  --line:      rgba(0, 0, 0, 0.10);
  --line-2:    rgba(0, 0, 0, 0.16);
  --radius:    16px;
  --shadow:    0 20px 60px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.06);
  --font:      ui-sans-serif, system-ui, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  --mono:      ui-monospace, SFMono-Regular, "JetBrains Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--fg);
  font-family: var(--font);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1000px 700px at 50% -10%, #ffffff, transparent 60%),
    linear-gradient(180deg, #f6f7f9, var(--bg) 40%);
  background-attachment: fixed;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #0b4fc0; }
code { font-family: var(--mono); }

/* Декорации тёмной темы (луч/фонарик) скрыты — сайт перешёл на светлую тему. */
.beam, .lantern { display: none; }

/* --- Кнопки (пилюли, в тон лендингу) --- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: opacity .2s ease, background-color .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.btn-primary {
  color: #ffffff;
  background: linear-gradient(to bottom, #3a3a3a, #111111);
  box-shadow: 0 10px 26px rgba(0,0,0,.22);
}
.btn-primary:hover { opacity: .9; color: #ffffff; }
.btn-ghost {
  color: #222222;
  border-color: #222222;
  background: transparent;
}
.btn-ghost:hover { background: rgba(0,0,0,.05); color: #222222; }

/* --- Бренд / логотип --- */
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo svg { width: 30px; height: 30px; }
.logo-text {
  font-weight: 650; letter-spacing: -.01em; font-size: 1.05rem;
  color: #111111;
}

/* --- Карточки (вход/2FA) --- */
.card {
  position: relative;
  z-index: 1;
  max-width: 430px;
  margin: 11vh auto 0;
  padding: 36px 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  text-align: center;
}
.card-title { font-size: 1.7rem; margin: 6px 0 18px; font-weight: 700; color: #111111; }
.muted { color: var(--muted); }
.muted-link { margin-top: 18px; }
.muted-link a:hover { text-decoration: underline; }

/* --- Формы --- */
.form { display: flex; flex-direction: column; gap: 15px; text-align: left; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: .88rem; color: var(--muted); }
.form input, .form select {
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px solid var(--line-2);
  background: #ffffff;
  color: var(--fg);
  font-size: 1rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form input:focus, .form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31,111,235,.18);
}
.form .btn-primary { margin-top: 6px; justify-content: center; border: none; }
.check { flex-direction: row !important; align-items: center; gap: 10px !important; color: var(--fg) !important; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.error {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  padding: 11px 13px;
  border-radius: 11px;
  font-size: .9rem;
}

.notice {
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #15803d;
  padding: 11px 13px;
  border-radius: 11px;
  font-size: .9rem;
}

.inline-form { display: inline; }
.linkbtn { background: none; border: none; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }
.linkbtn:hover { color: #0b4fc0; text-decoration: underline; }

/* Telegram-виджет блок */
.tg-login { margin-top: 18px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.tg-login .muted { font-size: .85rem; }

.qr {
  margin: 10px auto;
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 0 0 1px var(--line), 0 14px 40px rgba(0,0,0,.14);
}
.secret { font-size: .9rem; color: var(--muted); word-break: break-all; }
.secret code, .codes code { color: #b45309; }
.codes { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.codes li {
  background: #f3f4f6; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px; font-family: var(--mono); text-align: center;
}

/* --- Топбар / навигация --- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(12px);
}
.brand {
  font-weight: 650;
  color: #111111;
}
.admin-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.admin-nav a { color: var(--muted); font-size: .92rem; }
.admin-nav a:hover { color: var(--fg); }

/* --- Кабинет / панели --- */
.cabinet { position: relative; z-index: 1; max-width: 820px; margin: 0 auto; padding: 34px 24px 60px; }
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin: 18px 0;
  backdrop-filter: blur(10px);
}
.panel h2 { margin: 0 0 12px; font-size: 1.12rem; }

/* --- Тарифы --- */
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; margin-top: 18px; }
.plan { text-align: center; transition: transform .2s ease, border-color .2s ease; }
.plan:hover { transform: translateY(-4px); border-color: var(--line-2); }
.price {
  font-size: 2rem; font-weight: 800; margin: 8px 0;
  color: #111111;
}
.buy-form { gap: 10px; }

/* --- Списки/таблицы (устройства, аудит, админ) --- */
.devices { list-style: none; padding: 0; margin: 0; }
.devices li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.devices li:last-child { border-bottom: none; }

.audit { width: 100%; border-collapse: collapse; font-size: .9rem; }
.audit th, .audit td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.audit th { color: var(--muted); font-weight: 600; }
.audit tr:hover td { background: rgba(0,0,0,.03); }

@media (max-width: 560px) {
  .topbar { padding: 12px 16px; }
  .admin-nav { gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; }
}

/* ============================================================================
   ЛЕНДИНГ — светлая тема с фоновым видео (адаптация готового макета под бренд).
   Полностью изолирован в .lp-* и не влияет на остальные (тёмные) страницы.
   Меню — на CSS-чекбоксе, ассеты со своего origin: строгая CSP соблюдена.
   ========================================================================== */
.lp {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  background: #ececec;            /* перекрывает тёмный фон body на лендинге */
  color: #111111;
  font-family: var(--font);
}

/* --- Экран героя с фоновым видео --- */
.lp-screen {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.lp-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  filter: saturate(0);            /* десатурация по макету */
}
.lp-fg {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 100vh;
}

/* --- Навбар --- */
.lp-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 20px;
  /* Герой ниже по DOM имеет margin-top:-120px и flex:1 — без этого его
     прозрачная верхняя часть накрывает навбар и съедает клики по кнопкам. */
  position: relative;
  z-index: 1;
}
.lp-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.lp-brand svg { width: 30px; height: 30px; filter: none; }
.lp-brand-text {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -.01em;
  color: #111111;
}

.lp-auth { display: flex; align-items: center; gap: 8px; }

/* --- Кнопки лендинга --- */
.lp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  padding: 9px 20px;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background-color .2s ease, opacity .2s ease, box-shadow .2s ease;
  white-space: nowrap;
}
.lp-btn-ghost { border-color: #222222; color: #222222; background: transparent; }
.lp-btn-ghost:hover { background: rgba(255,255,255,.25); color: #222222; }
.lp-btn-dark { color: #ffffff; background: linear-gradient(to bottom, #3a3a3a, #111111); }
.lp-btn-dark:hover { opacity: .9; color: #ffffff; }
.lp-btn-lg { padding: 13px 28px; font-size: .95rem; }
.lp-btn-block { width: 100%; }
.lp-btn-dark.lp-btn-lg { box-shadow: 0 12px 30px rgba(0,0,0,.25); }

/* --- Hero --- */
.lp-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 16px 140px;
  margin-top: -120px;
}
.lp-title {
  font-size: clamp(1.75rem, 6vw, 3.75rem);
  font-weight: 700;
  line-height: 1.1;
  max-width: 800px;
  margin: 0 0 18px;
  color: #111111;
}
.lp-sub {
  font-size: clamp(.95rem, 2.2vw, 1.15rem);
  line-height: 1.6;
  max-width: 32rem;
  margin: 0 0 34px;
  color: #333333;
}
.lp-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 320px;
}

/* --- Способы оплаты (карточка) --- */
.lp-pay-wrap { width: 100%; padding: 0 16px 28px; display: flex; justify-content: center; }
.lp-pay-card {
  width: 100%;
  max-width: 880px;
  background: #ffffff;
  border-radius: 18px;
  padding: 20px 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18), 0 4px 16px rgba(0,0,0,.1);
}
.lp-pay-item { display: flex; align-items: center; justify-content: center; opacity: .6; transition: opacity .2s ease; }
.lp-pay-item:hover { opacity: 1; }
.lp-pay-sm { height: 26px; width: auto; }
.lp-pay-lg { height: 30px; width: auto; }

/* --- Подвал --- */
.lp-foot { text-align: center; color: #777777; font-size: .85rem; padding: 30px 16px 40px; background: #ececec; }

/* --- Адаптив --- */
@media (max-width: 480px) {
  .lp-brand-text { font-size: 1.02rem; }
  .lp-btn { padding: 8px 14px; font-size: .82rem; }
  .lp-nav { padding: 14px 14px; gap: 8px; }
}
@media (min-width: 768px) {
  .lp-cta { flex-direction: row; justify-content: center; max-width: none; }
  .lp-pay-card { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 24px 34px; }
  .lp-pay-sm { height: 28px; }
  .lp-pay-lg { height: 32px; }
}
