/* ============================================================
   Рандомус — клон. Дизайн-система.
   Шрифты: Nunito (основной), JetBrains Mono (моно).
   Акцент: синий (#3b5bb5), логотип: #335599.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,400;0,600;0,700;0,800;0,900;1,400&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ---------- Токены ---------- */
:root {
  --accent: #3b5bb5;
  --accent-hover: #34509f;
  --accent-soft: #eef2fb;
  --link: #3b6fb5;
  --logo-text: #2a3d63;
  --logo-icon: #3f6fc4;

  --text: #2b2f3a;
  --text-muted: #828a99;
  --heading: #232833;

  --bg: #ffffff;
  --bg-soft: #f4f6f9;
  --bg-card: #f5f7fa;
  --border: #e7eaf0;
  --card-border: #edeef2;
  --shadow-sm: 0 1px 2px rgba(28, 40, 64, .06);
  --shadow-md: 0 6px 24px rgba(28, 40, 64, .08);
  --shadow-lg: 0 18px 50px rgba(28, 40, 64, .14);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --container: 1240px;

  --font: "Nunito", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
}

:root[data-theme="dark"] {
  --accent: #4f74d6;
  --accent-hover: #6183df;
  --accent-soft: #1c2740;
  --link: #7aa2e8;
  --logo-text: #cdd7ec;
  --logo-icon: #6f97e6;

  --text: #d4d9e2;
  --text-muted: #8a93a6;
  --heading: #eef1f6;

  --bg: #14171d;
  --bg-soft: #1a1e26;
  --bg-card: #1c212b;
  --border: #2a303c;
  --card-border: #2a303c;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 6px 24px rgba(0, 0, 0, .5);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, .6);
}

/* ---------- Сброс ---------- */
*, *::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.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--link); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-hover); }
img, svg { max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 { color: var(--heading); font-weight: 800; margin: 0; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 720px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--text-muted); }
.hidden { display: none !important; }
.text-center { text-align: center; }
.mono { font-family: var(--font-mono); }

/* ============================================================
   ШАПКА
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 200;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo-svg { height: 30px; width: auto; display: block; }
.rnd-logo-text { fill: var(--logo-text); }
.rnd-logo-icon { fill: var(--logo-icon); }
.rnd-logo-icon-top { fill: var(--logo-icon); opacity: .5; }

.header-nav { display: flex; align-items: center; gap: 8px; }

/* Кнопки шапки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-weight: 700; font-size: 15px; line-height: 1;
  padding: 11px 18px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: transparent; color: var(--text);
  cursor: pointer; transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-outline { border-color: var(--border); color: var(--text); background: var(--bg); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { color: var(--text); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 22px; font-size: 16px; }
.btn-sm { padding: 8px 12px; font-size: 14px; }

/* Дропдаун */
.dropdown { position: relative; }
.dropdown-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  color: var(--text); font-weight: 700; font-size: 15px; background: transparent; border: none;
  white-space: nowrap;
}
.dropdown-toggle svg { width: 18px; height: 18px; flex: none; }
.dropdown-toggle:hover { background: var(--bg-soft); }
.dropdown-toggle .chev { width: 16px; height: 16px; transition: transform .2s; }
.dropdown.open .dropdown-toggle .chev { transform: rotate(180deg); }
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 300px; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 8px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .16s, transform .16s, visibility .16s; z-index: 300;
  max-height: 80vh; overflow-y: auto;
}
.dropdown.open .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-menu.menu-left { left: 0; right: auto; }
.dropdown-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text); font-weight: 600; font-size: 15px; white-space: nowrap;
}
.dropdown-item:hover { background: var(--bg-soft); color: var(--accent); }
.dropdown-item .di-icon { width: 20px; height: 20px; flex: none; color: var(--accent); opacity: .85; }
.dropdown-item .di-icon svg { width: 20px; height: 20px; display: block; }
.dropdown-item small.sub { display: block; color: var(--text-muted); font-weight: 600; font-size: 12px; }
.dropdown-item .badge-new {
  margin-left: auto; color: #e0506b; font-size: 12px; font-weight: 800;
  text-transform: lowercase; letter-spacing: .3px;
}
.dropdown-divider { height: 1px; background: var(--border); margin: 8px 4px; }

/* ============================================================
   HERO + СТАТИСТИКА
   ============================================================ */
.hero { padding: 40px 0 8px; }
.hero-title {
  text-align: center; font-size: 30px; font-weight: 800; color: var(--heading);
  margin: 8px 0 26px; letter-spacing: -.2px;
}
.stats-row {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 34px; padding: 6px 0 8px;
}
.stats-icon { color: var(--accent); opacity: .55; }
.stats-icon svg { width: 44px; height: 44px; }
.stat { text-align: center; min-width: 120px; }
.stat .stat-label { color: var(--text-muted); font-size: 14px; font-weight: 600; }
.stat .stat-value { color: var(--heading); font-size: 20px; font-weight: 800; margin-top: 2px; }

/* ============================================================
   ГЛАВНАЯ СЕТКА: генератор + фичи
   ============================================================ */
.main-grid {
  display: grid; grid-template-columns: 380px 1fr; gap: 34px;
  padding: 30px 0 60px; align-items: start;
}
@media (max-width: 900px) { .main-grid { grid-template-columns: 1fr; } }

/* Карточка-виджет (генератор и инструменты) */
.widget {
  background: var(--bg-card); border: 1px solid var(--card-border);
  border-radius: var(--radius-lg); padding: 26px 26px 28px;
}
.widget h2, .widget-title {
  font-size: 24px; font-weight: 800; color: var(--heading); line-height: 1.15;
}
.widget-sub { color: var(--text-muted); font-size: 14px; margin: 8px 0 20px; }

.field { margin-bottom: 18px; }
.field-label { display: block; color: var(--text); font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.inline-fields { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inline-fields .prefix { color: var(--text-muted); font-weight: 600; }

.input, .textarea, select.input {
  width: 100%; font-family: inherit; font-size: 16px; color: var(--text);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px 14px; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus, select.input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.input-num { width: 92px; text-align: center; }
.input-sm { width: 120px; }
.textarea { resize: vertical; min-height: 160px; line-height: 1.5; }
.field-hint { color: var(--text-muted); font-size: 13px; margin-top: 6px; }

/* Переключатель (toggle) */
.toggle { display: flex; align-items: center; gap: 12px; margin: 12px 0; cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle .track {
  width: 42px; height: 24px; border-radius: 999px; background: #cfd5df;
  position: relative; flex: none; transition: background .18s;
}
.toggle .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .18s;
}
.toggle input:checked + .track { background: var(--accent); }
.toggle input:checked + .track::after { transform: translateX(18px); }
.toggle .toggle-label { color: var(--text); font-weight: 600; font-size: 15px; }

/* Чекбокс/радио строкой */
.checkline { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: 15px; color: var(--text); }
.checkline input { width: 18px; height: 18px; accent-color: var(--accent); }

/* Результат */
.result-box {
  margin-top: 22px; background: var(--bg); border: 1px dashed var(--border);
  border-radius: var(--radius); padding: 18px; min-height: 60px;
}
.result-numbers { display: flex; flex-wrap: wrap; gap: 10px; }
.result-num {
  font-family: var(--font-mono); font-weight: 700; font-size: 18px;
  background: var(--accent-soft); color: var(--accent); border-radius: 8px; padding: 8px 14px;
}
.result-plain { font-family: var(--font-mono); font-size: 16px; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.result-hero {
  font-family: var(--font-mono); font-weight: 800; text-align: center;
  font-size: clamp(3rem, 10vw, 6rem); color: var(--accent); padding: 20px 0;
}

/* Популярные комбинации */
.combos { padding: 6px 0 0; }
.combos-title { color: var(--text); font-weight: 700; font-size: 16px; margin-bottom: 12px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; padding: 7px 14px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px;
  border: 1px solid transparent; transition: background .15s, border-color .15s;
}
.pill:hover { border-color: var(--accent); color: var(--accent); }

/* ============================================================
   КАРТОЧКИ-ФИЧИ (правая колонка)
   ============================================================ */
.feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 40px; }
@media (max-width: 640px) { .feature-grid { grid-template-columns: 1fr; } }
.feature {
  display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: start;
}
.feature .f-icon { color: var(--accent); width: 40px; height: 40px; opacity: .85; }
.feature .f-icon svg { width: 40px; height: 40px; display: block; }
.feature h3 { font-size: 19px; font-weight: 800; color: var(--heading); margin-bottom: 6px; }
.feature h3 sup { font-size: 11px; font-weight: 700; color: var(--accent); }
.feature p { color: var(--text-muted); font-size: 15px; margin: 0; line-height: 1.45; }
.feature a.f-title { color: var(--heading); }
.feature a.f-title:hover { color: var(--accent); }

/* Рекламный блок-заглушка */
.ad-block {
  border: 1px solid var(--card-border); border-radius: var(--radius); padding: 16px;
  background: var(--bg); margin-bottom: 28px; position: relative;
}
.ad-tag { font-size: 11px; color: var(--text-muted); letter-spacing: .4px; text-transform: uppercase; }
.ad-block .ad-body { display: flex; gap: 18px; align-items: flex-start; margin-top: 10px; }
.ad-thumb { width: 240px; height: 150px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, #dfe6f5, #eef2fb); display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-weight: 800; }

/* Текстовая реклама (без изображений) */
.ad-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.ad-text { display: block; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg-soft);
  transition: border-color .15s, background .15s; }
.ad-text:hover { border-color: var(--accent); background: var(--accent-soft); }
.ad-text-title { font-weight: 800; color: var(--heading); font-size: 15px; }
.ad-text-desc { color: var(--text-muted); font-size: 13.5px; margin: 4px 0 6px; line-height: 1.4; }
.ad-text-link { color: var(--accent); font-weight: 700; font-size: 13px; }

/* ============================================================
   СТРАНИЦА ИНСТРУМЕНТА (одноколоночная)
   ============================================================ */
.page { padding: 34px 0 60px; }
.page-title { font-size: 30px; font-weight: 800; text-align: center; color: var(--heading); margin-bottom: 8px; }
.page-sub { text-align: center; color: var(--text-muted); font-size: 16px; margin-bottom: 30px; }
.tool-layout { display: grid; grid-template-columns: 1fr; gap: 24px; max-width: 860px; margin: 0 auto; }

/* ============================================================
   ЛИЧНЫЙ КАБИНЕТ / ТАБЫ
   ============================================================ */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 24px 0 24px; flex-wrap: wrap; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 14px 16px;
  color: var(--text); font-weight: 700; font-size: 16px; border-bottom: 2px solid transparent;
  margin-bottom: -1px; background: none; border-top: none; border-left: none; border-right: none;
}
.tab:hover { color: var(--accent); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab .t-icon { width: 18px; height: 18px; }
.empty-state { color: var(--text-muted); font-style: italic; padding: 24px 4px; }

/* ============================================================
   АВТОРИЗАЦИЯ
   ============================================================ */
.auth { padding: 60px 0 80px; }
.auth h1 { font-size: 30px; text-align: center; margin-bottom: 6px; }
.auth .auth-sub { text-align: center; color: var(--text-muted); margin-bottom: 34px; }
.auth-block { max-width: 560px; margin: 0 auto; }
.auth-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-muted); }
.input-icon .input { padding-left: 42px; }
.auth-sep { border: none; border-top: 1px solid var(--border); margin: 42px 0; }

/* ============================================================
   ФУТЕР
   ============================================================ */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--border); margin-top: 40px; padding: 40px 0 34px; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr auto 1fr; gap: 30px; align-items: start; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-col a { display: block; color: var(--link); font-weight: 600; font-size: 15px; margin-bottom: 12px; }
.footer-col a:hover { color: var(--accent-hover); }

.theme-toggle { display: inline-flex; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 4px; gap: 2px; }
.theme-toggle button {
  width: 40px; height: 34px; border: none; background: transparent; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted);
}
.theme-toggle button svg { width: 18px; height: 18px; }
.theme-toggle button.active { background: var(--accent); color: #fff; }

.social-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.social-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 7px;
  font-size: 14px; font-weight: 700; color: #fff;
}
.social-vk { background: #0077ff; } .social-ok { background: #ee8208; }
.social-tg { background: #29a9eb; } .social-wa { background: #25d366; }
.social-btn .cnt { background: rgba(255,255,255,.25); border-radius: 4px; padding: 1px 5px; font-size: 12px; }

.footer-note { color: var(--text-muted); font-size: 13.5px; line-height: 1.5; }
.footer-note b { color: var(--text); }
.footer-legal { color: var(--text-muted); font-size: 13px; margin-top: 16px; }

/* ============================================================
   МОДАЛКА
   ============================================================ */
.modal-backdrop { position: fixed; inset: 0; background: rgba(20,26,40,.5); display: none; align-items: center; justify-content: center; z-index: 500; padding: 20px; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--bg); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); max-width: 520px; width: 100%; padding: 26px; }
.modal h3 { font-size: 20px; margin-bottom: 12px; }

/* ============================================================
   УТИЛИТЫ
   ============================================================ */
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--border); margin: 24px 0; }
.copy-hint { font-size: 13px; color: var(--text-muted); }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--heading); color: #fff; padding: 12px 20px; border-radius: 10px;
  font-weight: 700; opacity: 0; transition: opacity .2s, transform .2s; z-index: 600; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* мобильное меню */
.menu-backdrop { position: fixed; inset: 0; background: transparent; display: none; z-index: 150; }
.menu-backdrop.open { display: block; }

@media (max-width: 560px) {
  .site-header .container { height: 60px; padding: 0 16px; }
  .hero-title { font-size: 22px; }
  .stats-row { gap: 18px; }
  .stats-icon { display: none; }
  .btn { padding: 9px 12px; font-size: 14px; }
  .dropdown-toggle span.label-text { display: none; }
}
