/* ============ базовые переменные и сброс ============ */
:root {
  --bg: #080b11;
  --bg-soft: #0d121b;
  --panel: #111826;
  --panel-2: #16202f;
  --border: #1f2b3d;
  --border-soft: #182234;
  --text: #e8eef8;
  --muted: #8b9ab1;
  --dim: #61708a;
  --accent: #5b9dff;
  --accent-2: #7cf5c0;
  --warn: #ffb545;
  --danger: #ff6b6b;
  --ok: #4ade80;
  --radius: 16px;
  --radius-sm: 10px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; letter-spacing: -.02em; font-weight: 700; }
h1 { font-size: clamp(30px, 5vw, 52px); }
h2 { font-size: clamp(24px, 3.4vw, 34px); }
h3 { font-size: 20px; }
p { margin: 0 0 1em; }
ul { margin: 0 0 1em; padding-left: 1.2em; }
li { margin-bottom: .35em; }
code { font-family: var(--mono); font-size: .92em; background: #0a0f18; border: 1px solid var(--border-soft); padding: 2px 6px; border-radius: 6px; }
pre { background: #0a0f18; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 14px 16px; overflow-x: auto; }
pre code { border: 0; padding: 0; background: none; }

.wrap { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.narrow { width: min(760px, calc(100% - 40px)); margin: 0 auto; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.mono { font-family: var(--mono); }
.center { text-align: center; }
.mt0 { margin-top: 0; } .mt1 { margin-top: 8px; } .mt2 { margin-top: 16px; } .mt3 { margin-top: 28px; } .mt4 { margin-top: 48px; }
.mb0 { margin-bottom: 0; } .mb2 { margin-bottom: 16px; } .mb3 { margin-bottom: 28px; }
.nowrap { white-space: nowrap; }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }

/* ============ шапка ============ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(8, 11, 17, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 66px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: -.02em; color: var(--text); font-size: 18px; }
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 28px; height: 28px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; color: #05121b; font-weight: 900; font-size: 15px;
}
.nav { display: flex; gap: 22px; margin-left: 8px; }
.nav a { color: var(--muted); font-size: 15px; font-weight: 500; }
.nav a:hover, .nav a.active { color: var(--text); text-decoration: none; }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

/* ============ кнопки ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--panel); color: var(--text);
  font: inherit; font-weight: 600; font-size: 15px; cursor: pointer;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--panel-2); border-color: #2b3a52; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, #4f93ff, #6fb0ff); border-color: transparent; color: #04101f; }
.btn-primary:hover { background: linear-gradient(135deg, #5f9dff, #7fbcff); }
.btn-ghost { background: transparent; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn-danger { border-color: #4a2028; color: #ffb4b4; background: #1a0f13; }
.btn-danger:hover { background: #24151b; }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }

/* ============ карточки и сетки ============ */
.card {
  background: linear-gradient(180deg, var(--panel), #0e1521);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.card-tight { padding: 16px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 26px; align-items: start; }

/* ============ hero ============ */
.hero { padding: 76px 0 48px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -30% 20% auto -10%; height: 620px;
  background: radial-gradient(closest-side, rgba(91, 157, 255, .16), transparent 70%);
  pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 48px; align-items: center; position: relative; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600;
  color: var(--accent-2); border: 1px solid #1c3a33; background: #0a1a16;
  padding: 6px 12px; border-radius: 999px; margin-bottom: 20px;
}
.hero h1 { margin-bottom: 18px; }
.hero .lead { font-size: 18px; color: var(--muted); max-width: 560px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.chip {
  font-size: 13px; color: var(--muted); border: 1px solid var(--border-soft);
  background: #0b111a; padding: 6px 11px; border-radius: 8px;
}
.terminal { background: #0a0f18; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.terminal-bar { display: flex; gap: 6px; padding: 11px 14px; border-bottom: 1px solid var(--border-soft); background: #080d15; }
.terminal-dot { width: 10px; height: 10px; border-radius: 50%; background: #2a3548; }
.terminal-body { padding: 16px 18px; font-family: var(--mono); font-size: 13.5px; line-height: 1.85; }
.terminal-body .k { color: var(--accent-2); }
.terminal-body .c { color: var(--dim); }
.terminal-body .v { color: #cfe0ff; }

/* ============ статистика и шаги ============ */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border-soft); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border-soft); }
.stat { background: var(--bg-soft); padding: 20px 22px; }
.stat b { display: block; font-size: 26px; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: 13.5px; }

.steps { counter-reset: step; display: grid; gap: 16px; grid-template-columns: repeat(4, 1fr); }
.step { position: relative; padding-left: 44px; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
  background: #0f1a29; border: 1px solid #1e2c42; color: var(--accent);
}
.step h4 { margin-bottom: 4px; }

/* ============ тарифы ============ */
.plan-card { display: flex; flex-direction: column; }
.plan-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.plan-name { font-weight: 700; font-size: 17px; }
.plan-price { font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.plan-price small { font-size: 14px; font-weight: 500; color: var(--muted); }
.plan-specs { list-style: none; padding: 0; margin: 0 0 18px; }
.plan-specs li { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--border-soft); font-size: 14.5px; }
.plan-specs li:last-child { border-bottom: 0; }
.plan-specs .val { color: var(--text); font-weight: 600; }
.plan-specs .key { color: var(--muted); }
.plan-flags { font-size: 18px; letter-spacing: 2px; margin-bottom: 14px; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 4px 9px; border-radius: 7px; }
.badge-pop { background: #10233d; color: #9dc4ff; border: 1px solid #22406b; }
.badge-ok { background: #0d2320; color: #7cf5c0; border: 1px solid #1c4038; }
.badge-warn { background: #2a1f0c; color: var(--warn); border: 1px solid #493516; }
.badge-err { background: #2a1014; color: #ff9b9b; border: 1px solid #4a1e24; }

/* ============ таблицы ============ */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--dim); font-weight: 600; background: #0c121c; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #0d1420; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ============ формы ============ */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; color: var(--muted); margin-bottom: 7px; }
.input, select, textarea {
  width: 100%; height: 44px; padding: 0 13px; font: inherit; font-size: 15px;
  color: var(--text); background: #0a1018; border: 1px solid var(--border);
  border-radius: var(--radius-sm); outline: none;
}
textarea { height: auto; min-height: 90px; padding: 11px 13px; }
.input:focus, select:focus, textarea:focus { border-color: #34507a; box-shadow: 0 0 0 3px rgba(91, 157, 255, .12); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--muted); }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hint { font-size: 12.5px; color: var(--dim); margin-top: 6px; }

/* ============ оповещения ============ */
.flash { padding: 13px 16px; border-radius: var(--radius-sm); font-size: 14.5px; margin-bottom: 18px; border: 1px solid; }
.flash-ok { background: #0c1f1a; border-color: #1b3f34; color: #a9f0cf; }
.flash-err { background: #211014; border-color: #4a1f28; color: #ffb3b3; }
.flash-info { background: #0c1727; border-color: #1d3352; color: #b7d3ff; }

/* ============ формы входа и регистрации ============ */
.auth-card { max-width: 440px; margin: 0 auto; }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0; color: var(--dim); font-size: 12.5px; text-transform: lowercase;
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border-soft);
}
.tg-widget { display: flex; justify-content: center; min-height: 44px; }

/* ============ кабинет ============ */
.side { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 26px; align-items: start; }
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.side-nav a { padding: 10px 13px; border-radius: 9px; color: var(--muted); font-size: 14.5px; font-weight: 500; }
.side-nav a:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.side-nav a.active { background: var(--panel-2); color: var(--text); }
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px 18px; font-size: 14.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.secret { font-family: var(--mono); background: #0a0f18; border: 1px solid var(--border-soft); border-radius: 8px; padding: 5px 9px; }
.reveal { cursor: pointer; color: var(--accent); border-bottom: 1px dashed; }

/* ============ прочее ============ */
.divider { height: 1px; background: var(--border-soft); margin: 28px 0; }
.faq details { border-bottom: 1px solid var(--border-soft); padding: 16px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 16px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq p { margin: 12px 0 0; color: var(--muted); }

.site-footer { border-top: 1px solid var(--border-soft); margin-top: 72px; padding: 34px 0 46px; color: var(--dim); font-size: 13.5px; }
.footer-grid { display: flex; justify-content: space-between; gap: 26px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }

.empty { text-align: center; padding: 54px 20px; color: var(--muted); }
.empty h3 { color: var(--text); }

.tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 6px; background: #0d1622; border: 1px solid var(--border-soft); color: var(--muted); }

.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 100;
  background: #0e1a26; border: 1px solid #21405e; color: #cfe4ff;
  padding: 13px 18px; border-radius: 12px; font-size: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  transition: opacity .3s ease;
}

@media (max-width: 980px) {
  .hero-grid, .split, .side { grid-template-columns: 1fr; }
  .grid-4, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 620px) {
  .nav { display: none; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stats, .steps, .form-row { grid-template-columns: 1fr; }
  .hero { padding-top: 44px; }
  .kv { grid-template-columns: 1fr; gap: 4px 0; }
  .kv dt { margin-top: 10px; }
}

/* ============ кнопка Google ============ */
.google-btn {
  background: #ffffff; color: #1f1f1f; border-color: #dadce0;
  justify-content: center; font-weight: 600;
}
.google-btn:hover { background: #f8f9fa; border-color: #c9cdd2; color: #1f1f1f; text-decoration: none; }
.google-btn svg { flex: 0 0 auto; }
/* ============ компактные таблицы админки ============ */
.table-wrap table.compact { table-layout: fixed; }
.table-wrap table.compact th,
.table-wrap table.compact td { padding: 10px; }
.table-wrap table.compact th { font-size: 11.5px; letter-spacing: .03em; }
.cell-form { display: flex; flex-direction: column; gap: 6px; }
.cell-form .input { width: 100%; height: 32px; font-size: 13px; padding: 0 9px; }
.cell-form .btn { width: 100%; height: 32px; font-size: 13px; padding: 0 10px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
th.center, td.center { text-align: center; }
/* таблица админки в одну строку на запись */
.table-wrap table.oneline { table-layout: fixed; }
.table-wrap table.oneline th,
.table-wrap table.oneline td {
  padding: 8px 8px;
  white-space: nowrap;
  vertical-align: middle;
}
.table-wrap table.oneline td .ellipsis { display: block; max-width: 100%; }
.row-form { display: flex; gap: 5px; align-items: center; flex-wrap: nowrap; }
.row-form .input {
  height: 32px; font-size: 13px; padding: 0 8px;
  min-width: 0; flex: 1 1 auto; width: 100%;
}
.row-form .btn {
  height: 32px; font-size: 13px; padding: 0 10px; flex: 0 0 auto;
}