/* Релог — производственный CSS. Источник: дизайн-система (бренд-бриф v1.0).
   Светлые поверхности + тёмный hero, один акцент #2E6BFF, Unbounded/Inter/JetBrains Mono,
   радиусы 16/10/pill, модуль 8px, сдержанная анимация. */

/* ---------- Токены ---------- */
:root {
  --color-primary-900: #0E1726;
  --color-primary-800: #16233A;
  --color-surface: #F6F8FB;
  --color-surface-card: #FFFFFF;
  --color-text: #101828;
  --color-text-secondary: #5B6B82;
  --color-text-on-dark: #FFFFFF;
  --color-text-on-dark-secondary: rgba(255,255,255,.64);
  --color-border: #E4E9F0;
  --color-border-on-dark: rgba(255,255,255,.08);
  --color-accent: #2E6BFF;
  --color-accent-hover: #1F54D6;
  --color-accent-soft: rgba(46,107,255,.09);
  --color-success: #12B76A; --color-success-soft: rgba(18,183,106,.10);
  --color-warning: #F79009; --color-warning-soft: rgba(247,144,9,.10);
  --color-danger: #E5484D;  --color-danger-soft: rgba(229,72,77,.10);
  --color-info: #3AA6F5;    --color-info-soft: rgba(58,166,245,.10);
  --gradient-hero: linear-gradient(135deg,#2E6BFF 0%,#6C8CFF 100%);
  --font-display: 'Unbounded','Manrope',system-ui,sans-serif;
  --font-body: 'Inter','Golos Text',system-ui,sans-serif;
  --font-mono: 'JetBrains Mono',ui-monospace,monospace;
  --radius-card: 16px; --radius-control: 10px; --radius-pill: 999px;
  --shadow-rest: 0 1px 2px rgba(16,24,40,.06);
  --shadow-hover: 0 8px 24px rgba(16,24,40,.10);
  --motion-fast: 150ms ease-out; --motion-base: 200ms ease-out; --motion-enter: 300ms ease-out;
  --sidebar-width: 264px;
}

/* ---------- База ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--color-surface); color: var(--color-text);
  font-family: var(--font-body); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-hover); }
h1,h2,h3,h4 { font-family: var(--font-display); margin: 0; }
h1 { font-size: 56px; font-weight: 600; line-height: 1.1; letter-spacing: -.01em; }
h2 { font-size: 40px; font-weight: 600; line-height: 1.15; }
h3 { font-size: 28px; font-weight: 500; line-height: 1.2; }
h4 { font-size: 20px; font-weight: 500; }
.muted { color: var(--color-text-secondary); }
.small { font-size: 14px; }
.mono { font-family: var(--font-mono); }
.caption { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; font-weight: 500; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
img { max-width: 100%; }
@media (max-width: 720px) { h1 { font-size: 36px; } h2 { font-size: 28px; } h3 { font-size: 22px; } }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: var(--radius-control);
  font-family: var(--font-body); font-size: 15px; font-weight: 500;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background var(--motion-fast), color var(--motion-fast), border var(--motion-fast);
  text-decoration: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--color-accent-hover); color: #fff; }
.btn-secondary { background: var(--color-surface-card); color: var(--color-text); border-color: var(--color-border); }
.btn-secondary:hover:not(:disabled) { background: var(--color-surface); color: var(--color-text); }
.btn-ghost { background: transparent; color: var(--color-accent); }
.btn-ghost:hover:not(:disabled) { background: var(--color-accent-soft); color: var(--color-accent); }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #C93A3F; color: #fff; }
.btn-on-dark { background: rgba(255,255,255,.08); color: #fff; border-color: var(--color-border-on-dark); }
.btn-on-dark:hover:not(:disabled) { background: rgba(255,255,255,.14); color: #fff; }
.btn-block { width: 100%; }
.btn .lucide { width: 18px; height: 18px; }

/* ---------- Формы ---------- */
.field { margin-bottom: 16px; }
.field-group { margin-bottom: 32px; }
.label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.hint { font-size: 13px; color: var(--color-text-secondary); margin-top: 6px; }
.input, .select, textarea.input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: var(--radius-control);
  border: 1px solid var(--color-border); background: var(--color-surface-card);
  font-family: var(--font-body); font-size: 15px; color: var(--color-text);
  transition: border var(--motion-fast), box-shadow var(--motion-fast);
}
textarea.input { height: auto; padding: 12px 14px; resize: vertical; min-height: 96px; }
.input:focus, .select:focus, textarea.input:focus {
  outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-soft);
}
.input.is-error { border-color: var(--color-danger); }
.input-mono { font-family: var(--font-mono); font-size: 13px; }
.checkbox-row { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.checkbox-row input { margin-top: 4px; }

/* переключатель */
.switch { position: relative; display: inline-flex; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; border-radius: var(--radius-pill);
  background: var(--color-border); transition: background var(--motion-fast); cursor: pointer;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: var(--shadow-rest);
  transition: transform var(--motion-fast);
}
.switch input:checked + .track { background: var(--color-accent); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }

/* ---------- Карточки ---------- */
.card {
  background: var(--color-surface-card); border: 1px solid var(--color-border);
  border-radius: var(--radius-card); padding: 24px; box-shadow: var(--shadow-rest);
}
.card-hover { transition: box-shadow var(--motion-base), transform var(--motion-base); }
.card-hover:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.card-dark {
  background: var(--color-primary-800); color: #fff;
  border: 1px solid var(--color-border-on-dark); border-radius: var(--radius-card); padding: 24px;
}
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; font-family: var(--font-body); }
.card + .card { margin-top: 16px; }
@media (max-width: 720px) { .card, .card-dark { padding: 16px; } }

/* ---------- Бейджи статусов ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: var(--radius-pill); font-size: 12px; font-weight: 500;
  letter-spacing: .02em; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge-success { color: var(--color-success); background: var(--color-success-soft); }
.badge-warning { color: var(--color-warning); background: var(--color-warning-soft); }
.badge-danger { color: var(--color-danger); background: var(--color-danger-soft); }
.badge-info { color: var(--color-info); background: var(--color-info-soft); }
.badge-accent { color: var(--color-accent); background: var(--color-accent-soft); }
.badge-neutral { color: var(--color-text-secondary); background: rgba(91,107,130,.10); }

/* ---------- Алерты ---------- */
.alert {
  display: block; padding: 14px 16px; border-radius: var(--radius-control);
  font-size: 14px; line-height: 1.55; border: 1px solid transparent; margin-bottom: 16px;
}
.alert a { font-weight: 500; }
/* Баннер «текст + кнопка справа» (дашборд): отдельный модификатор */
.alert-row { display: flex; gap: 16px; align-items: center; }
.alert-row > :first-child { flex: 1; }
.alert-info { background: var(--color-info-soft); color: #1769AA; }
.alert-success { background: var(--color-success-soft); color: #0B7A49; }
.alert-warning { background: var(--color-warning-soft); color: #A85F06; }
.alert-danger { background: var(--color-danger-soft); color: #B22B30; }

/* ---------- Прогресс ---------- */
.progress { height: 8px; border-radius: var(--radius-pill); background: var(--color-border); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--color-accent); border-radius: var(--radius-pill); transition: width 400ms ease-out; }

/* ---------- Степпер ---------- */
.stepper { display: flex; flex-direction: column; gap: 0; }
.step { display: flex; gap: 16px; position: relative; padding-bottom: 24px; }
.step:last-child { padding-bottom: 0; }
.step::before {
  content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px;
  background: var(--color-border);
}
.step:last-child::before { display: none; }
.step-dot {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-surface-card); border: 2px solid var(--color-border);
  font-size: 13px; font-weight: 600; color: var(--color-text-secondary); z-index: 1;
}
.step.is-done .step-dot { background: var(--color-success); border-color: var(--color-success); color: #fff; }
.step.is-active .step-dot { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
.step.is-done::before { background: var(--color-success); }
.step-body { padding-top: 4px; }
.step-title { font-weight: 600; font-size: 15px; }
.step-text { font-size: 14px; color: var(--color-text-secondary); margin-top: 4px; white-space: pre-line; }

/* ---------- Таблицы ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--color-text-secondary); font-weight: 500; padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
}
.table td { padding: 12px; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--motion-fast); }
.table tbody tr:hover { background: var(--color-surface); }
.table .row-link { cursor: pointer; }

/* ---------- Пустые состояния ---------- */
.empty {
  text-align: center; padding: 48px 24px; color: var(--color-text-secondary); font-size: 14px;
}
.empty .lucide { width: 32px; height: 32px; margin-bottom: 12px; opacity: .5; }

/* ---------- Тосты ---------- */
#toasts { position: fixed; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 1000; }
.toast {
  background: var(--color-primary-900); color: #fff; padding: 12px 18px;
  border-radius: var(--radius-control); font-size: 14px; box-shadow: var(--shadow-hover);
  animation: toast-in 300ms ease-out; max-width: 420px;
}
.toast.toast-error { background: var(--color-danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Модал ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(14,23,38,.5); z-index: 900;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal {
  background: var(--color-surface-card); border-radius: var(--radius-card);
  max-width: 560px; width: 100%; max-height: 86vh; overflow: auto; padding: 24px;
  animation: toast-in 200ms ease-out;
}

/* ---------- Лендинг ---------- */
.l-header {
  max-width: 1280px; margin: 0 auto; padding: 24px 40px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.l-header nav { display: flex; gap: 28px; font-size: 14px; }
.l-header nav a { color: var(--color-text-on-dark-secondary); }
.l-header nav a:hover { color: #fff; }
.wordmark { font-family: var(--font-display); font-weight: 600; font-size: 22px; color: #fff; }
.wordmark .dot { background: var(--gradient-hero); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero { background: var(--color-primary-900); color: #fff; padding-bottom: 96px; }
.hero-grid {
  max-width: 1280px; margin: 0 auto; padding: 64px 40px 0;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center;
}
.hero .lead { font-size: 18px; color: var(--color-text-on-dark-secondary); max-width: 480px; margin: 24px 0 0; }
.grad { background: var(--gradient-hero); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-cta { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.hero-note { margin-top: 16px; font-size: 13px; color: rgba(255,255,255,.45); }
.mock { background: var(--color-primary-800); border: 1px solid var(--color-border-on-dark); border-radius: var(--radius-card); padding: 20px; }
.mock-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--color-border-on-dark); }
.mock-route { display: block; font-size: 14px; font-weight: 500; }
.mock-meta { display: block; font-size: 12px; color: rgba(255,255,255,.45); }
.mock-total { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--color-border-on-dark); display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 13px; color: var(--color-text-on-dark-secondary); }
.section { max-width: 1280px; margin: 0 auto; padding: 96px 40px 0; }
.section:last-of-type { padding-bottom: 96px; }
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head .caption { color: var(--color-accent); margin-bottom: 12px; }
.section-head p { color: var(--color-text-secondary); margin: 12px 0 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 24px; }
.icon-box {
  width: 40px; height: 40px; border-radius: var(--radius-control);
  background: var(--color-accent-soft); color: var(--color-accent);
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.icon-box .lucide { width: 20px; height: 20px; }
.dark-section { background: var(--color-primary-900); color: #fff; border-radius: var(--radius-card); padding: 48px; }
.dark-section .muted { color: var(--color-text-on-dark-secondary); }
.faq-item { border-bottom: 1px solid var(--color-border); padding: 20px 0; }
.faq-item summary { cursor: pointer; font-weight: 600; font-size: 16px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq-item summary::after { content: "+"; color: var(--color-accent); font-size: 20px; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { color: var(--color-text-secondary); margin: 12px 0 0; font-size: 15px; }
.l-footer { border-top: 1px solid var(--color-border); margin-top: 96px; }
.l-footer-in { max-width: 1280px; margin: 0 auto; padding: 32px 40px; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; font-size: 14px; color: var(--color-text-secondary); }
.price-num { font-family: var(--font-display); font-size: 40px; font-weight: 600; }
.reveal { opacity: 0; transform: translateY(10px); transition: opacity 400ms ease-out, transform 400ms ease-out; }
.reveal.is-in { opacity: 1; transform: none; }
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; padding-top: 40px; }
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .l-header { padding: 16px 20px; } .l-header nav { display: none; }
  .section { padding: 64px 20px 0; }
}
@media (max-width: 640px) { .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; } .dark-section { padding: 24px; } }

/* ---------- Аутентификация ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; }

/* ---------- Кабинет ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-width); flex-shrink: 0; background: var(--color-surface-card);
  border-right: 1px solid var(--color-border); padding: 24px 16px;
  display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .wordmark { color: var(--color-text); padding: 0 12px 20px; font-size: 20px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: var(--radius-control); font-size: 14px; font-weight: 500;
  color: var(--color-text-secondary); transition: background var(--motion-fast), color var(--motion-fast);
}
.nav-item:hover { background: var(--color-surface); color: var(--color-text); }
.nav-item.is-active { background: var(--color-accent-soft); color: var(--color-accent); }
.nav-item .lucide { width: 18px; height: 18px; flex-shrink: 0; }
.nav-badge { margin-left: auto; background: var(--color-accent); color: #fff; border-radius: var(--radius-pill); font-size: 11px; padding: 1px 7px; }
.nav-sep { margin: 12px 12px 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--color-text-secondary); }
.content { flex: 1; padding: 32px; min-width: 0; }
.content-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.content-head h3 { font-size: 24px; }
.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 24px; }
.stat { padding: 20px 24px; }
.stat .num { font-family: var(--font-display); font-size: 28px; font-weight: 600; line-height: 1.2; }
.stat .lbl { font-size: 13px; color: var(--color-text-secondary); margin-top: 4px; }
.row { display: flex; gap: 16px; align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--color-border); font-size: 14px; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--color-text-secondary); }
.menu-burger { display: none; }
@media (max-width: 980px) {
  .sidebar { position: fixed; z-index: 800; transform: translateX(-100%); transition: transform var(--motion-base); }
  .sidebar.is-open { transform: none; box-shadow: var(--shadow-hover); }
  .menu-burger { display: inline-flex; }
  .content { padding: 16px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .cols-2 { grid-template-columns: 1fr; }
}

/* ---------- Документация ---------- */
.docs-layout { max-width: 1100px; margin: 0 auto; padding: 40px 24px; display: grid; grid-template-columns: 240px 1fr; gap: 48px; }
.docs-nav { position: sticky; top: 24px; align-self: start; display: flex; flex-direction: column; gap: 2px; }
.docs-body h2 { font-size: 28px; margin-bottom: 16px; }
.docs-body h3 { font-size: 20px; margin: 32px 0 8px; font-family: var(--font-body); font-weight: 600; }
.docs-body p, .docs-body li { font-size: 15px; color: #2A3548; }
.docs-body code { font-family: var(--font-mono); font-size: 13px; background: var(--color-surface); border: 1px solid var(--color-border); padding: 1px 6px; border-radius: 6px; }
.docs-body pre { background: var(--color-primary-900); color: #E6EDF7; padding: 16px; border-radius: var(--radius-control); overflow-x: auto; font-size: 13px; font-family: var(--font-mono); line-height: 1.5; }
.docs-body pre code { background: none; border: none; color: inherit; padding: 0; }
.docs-body table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 12px 0; }
.docs-body th, .docs-body td { border: 1px solid var(--color-border); padding: 8px 12px; text-align: left; }
@media (max-width: 860px) { .docs-layout { grid-template-columns: 1fr; } .docs-nav { position: static; flex-direction: row; flex-wrap: wrap; } }

/* ---------- Скелетоны ---------- */
.skeleton { background: linear-gradient(90deg,var(--color-border) 25%,#EFF3F8 50%,var(--color-border) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; min-height: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }
