/* Universal Utility — сайт в тонах приложения (ui/theme.py) */
:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #1c2128;
  --inset: #010409;
  --hover: #21262d;
  --border: #30363d;
  --border-soft: #21262d;
  --border-bright: #484f58;
  --text: #e6edf3;
  --muted: #8b949e;
  --dim: #6e7681;
  --blue: #569bfd;
  --blue-dk: #4088f5;
  --green: #3fb950;
  --green-dk: #238636;
  --red: #f85149;
  --amber: #d29922;
  --radius: 8px;
  --font: 'Segoe UI', 'Noto Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
}

::selection { background: var(--blue-dk); color: #fff; }

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

code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: Consolas, 'Cascadia Mono', monospace;
  font-size: 0.9em;
  color: var(--blue);
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 760px; }
.accent { color: var(--blue); }

/* ---------- Шапка ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-soft);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand-logo { display: block; flex-shrink: 0; }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: 0.2px; }

.main-nav { display: flex; align-items: center; gap: 22px; }
.main-nav a:not(.btn) {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s ease;
}
.main-nav a:not(.btn):hover { color: var(--text); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: var(--muted);
  border-radius: 1px;
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { background: var(--hover); border-color: var(--border-bright); color: var(--text); }

.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 15px; font-weight: 600; }

.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dk); border-color: var(--blue-dk); color: #fff; }

.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--hover); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  text-align: center;
  padding: 96px 24px 80px;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -220px;
  left: 50%;
  transform: translateX(-50%);
  width: 720px;
  height: 420px;
  background: radial-gradient(ellipse at center, rgba(86, 155, 253, 0.16), transparent 65%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 24px;
}
.hero-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(63, 185, 80, 0.7);
}

.hero-title {
  font-size: 56px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 16px;
}

.hero-subtitle {
  max-width: 620px;
  margin: 0 auto 32px;
  color: var(--muted);
  font-size: 17px;
}

.hero-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 48px; }

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}
.hero-stat { display: flex; flex-direction: column; gap: 2px; }
.stat-value { font-size: 26px; font-weight: 700; }
.stat-label { font-size: 12px; font-weight: 600; color: var(--muted); }

/* ---------- Секции ---------- */
.section { padding: 72px 24px; }
.section-alt { background: var(--inset); border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }

.section-title { font-size: 30px; font-weight: 700; text-align: center; margin-bottom: 8px; }
.section-subtitle { text-align: center; color: var(--muted); font-size: 15px; margin-bottom: 40px; }

/* ---------- Карточки возможностей ---------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover { border-color: var(--border-bright); transform: translateY(-2px); }

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  border: 1px solid;
}
.icon-blue { color: var(--blue); background: rgba(86, 155, 253, 0.10); border-color: rgba(86, 155, 253, 0.35); }
.icon-green { color: var(--green); background: rgba(63, 185, 80, 0.10); border-color: rgba(63, 185, 80, 0.35); }
.icon-amber { color: var(--amber); background: rgba(210, 153, 34, 0.10); border-color: rgba(210, 153, 34, 0.35); }

.card h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.card p { color: var(--muted); font-size: 14px; }

/* ---------- Скриншоты ---------- */
.screens-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
  max-width: 980px;
  margin: 0 auto;
}
.screen-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s ease;
}
.screen-card:hover { border-color: var(--border-bright); }
.screen-card a { display: block; }
.screen-card img {
  width: 100%;
  display: block;
  border-bottom: 1px solid var(--border-soft);
}
.screen-cap {
  padding: 12px 16px;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Шаги установки ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  counter-reset: step;
}

.step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 24px 22px 22px;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(86, 155, 253, 0.16);
  border: 1px solid var(--blue);
  color: var(--blue);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 12px;
}
.step h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: 14px; }

/* ---------- Блок скачивания ---------- */
.download-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 48px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.download-info .section-title { text-align: left; }
.download-info .section-subtitle { text-align: left; margin-bottom: 24px; }

.download-meta { display: flex; flex-direction: column; gap: 12px; }
.meta-item { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.meta-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid;
  flex-shrink: 0;
}
.download-note { color: var(--dim); font-size: 12px; margin-top: 14px; }

/* ---------- Лицензия ---------- */
.license-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.license-card p { color: var(--muted); font-size: 14px; line-height: 1.7; }
.license-card .license-warning {
  color: var(--amber);
  background: rgba(210, 153, 34, 0.08);
  border: 1px solid rgba(210, 153, 34, 0.35);
  border-radius: 6px;
  padding: 10px 14px;
}
.license-card .license-contact { margin-top: 4px; }

/* ---------- FAQ ---------- */
.faq { display: flex; flex-direction: column; gap: 10px; }

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  transition: border-color 0.15s ease;
}
.faq-item:hover { border-color: var(--border-bright); }
.faq-item[open] { border-color: var(--border); }

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 20px;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  color: var(--blue);
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
  transition: transform 0.15s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding: 0 20px 18px; color: var(--muted); font-size: 14px; }

/* ---------- Страница входа ---------- */
.gate-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% -20%, rgba(86, 155, 253, 0.12), transparent 60%),
    var(--bg);
}
.gate-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px; width: 100%; }
.gate-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px 32px 28px;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.gate-logo { margin-bottom: 12px; }
.gate-title { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.gate-subtitle { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.gate-label { align-self: flex-start; color: var(--muted); font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.gate-input {
  width: 100%;
  background: var(--inset);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  margin-bottom: 14px;
  outline: none;
  transition: border-color 0.15s ease;
}
.gate-input:focus { border-color: var(--blue); }
.gate-input::placeholder { color: var(--dim); }
.gate-error {
  width: 100%;
  background: rgba(248, 81, 73, 0.10);
  border: 1px solid rgba(248, 81, 73, 0.45);
  color: var(--red);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  margin-bottom: 14px;
}
.gate-btn { width: 100%; justify-content: center; }
.gate-contact {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.gate-contact p { color: var(--muted); font-size: 13px; }
.gate-contact .btn { justify-content: center; width: 100%; }
.gate-hint { color: var(--dim); font-size: 12px; }

/* ---------- Ошибка ---------- */
.error-box { text-align: center; padding: 40px 0; }
.error-box .hero-title { font-size: 40px; margin-bottom: 12px; }
.error-box .hero-subtitle { margin-bottom: 28px; }

/* ---------- Подвал ---------- */
.site-footer {
  border-top: 1px solid var(--border-soft);
  background: var(--surface);
  padding: 40px 24px 24px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
  padding-bottom: 24px;
}
.footer-brand p { color: var(--dim); font-size: 13px; margin-top: 8px; max-width: 340px; }
.footer-nav { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-nav a { color: var(--muted); font-size: 14px; }
.footer-nav a:hover { color: var(--text); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-soft);
  padding-top: 16px;
  color: var(--dim);
  font-size: 13px;
}
.to-top { color: var(--dim); font-size: 13px; }
.to-top:hover { color: var(--blue); }
.footer-links { display: inline-flex; gap: 16px; align-items: center; }
.footer-links a { color: var(--dim); font-size: 13px; }
.footer-links a:hover { color: var(--blue); }

/* ---------- Адаптивность ---------- */
@media (max-width: 900px) {
  .features-grid, .steps { grid-template-columns: repeat(2, 1fr); }
  .screens-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 42px; }
}

@media (max-width: 640px) {
  .features-grid, .steps { grid-template-columns: 1fr; }
  .hero { padding: 64px 16px 56px; }
  .hero-title { font-size: 34px; }
  .hero-stats { gap: 24px; }
  .section { padding: 48px 16px; }
  .section-title { font-size: 24px; }
  .download-card { padding: 32px 24px; }

  .nav-toggle { display: flex; }
  .main-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 8px 16px 16px;
  }
  .main-nav.open { display: flex; }
  .main-nav a:not(.btn) { padding: 10px 4px; border-bottom: 1px solid var(--border-soft); }
  .main-nav .btn { justify-content: center; margin-top: 10px; }
}
