@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/space-grotesk/space-grotesk-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/space-grotesk/space-grotesk-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/static/fonts/space-grotesk/space-grotesk-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/space-grotesk/space-grotesk-700.woff2') format('woff2');
}
:root {
  --bg: #0b1220;
  --bg-soft: #111a2f;
  --card: #101829;
  --text: #e7eefb;
  --muted: #9fb0cf;
  --border: #26344f;
  --accent: #25c2d9;
  --accent-2: #5eead4;
  --danger: #fca5a5;
  --ok: #86efac;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
  background: radial-gradient(1200px 600px at 10% -10%, rgba(37,194,217,0.15), transparent 45%), var(--bg);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
  background: rgba(11, 18, 32, 0.88);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.logo { font-weight: 700; letter-spacing: .2px; }
.nav-desktop { display: flex; align-items: center; gap: 8px; }
.nav-link {
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--muted);
  border: 1px solid transparent;
}
.nav-link:hover, .nav-link.active {
  color: var(--text);
  border-color: var(--border);
  background: rgba(37,194,217,0.08);
}
.topbar button.nav-link {
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.burger {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
}
.main { padding: 28px 0 42px;
  min-height: calc(80vh - 70px);
}
.hero, .card {
  border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(16,24,41,.95), rgba(12,20,36,.95));
  border-radius: 16px;
}
.hero { padding: 24px; }
.grid {
  margin-top: 16px;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(12, 1fr);
}
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }
.card { padding: 16px; }
.kpi { font-size: 28px; font-weight: 700; }
.muted { color: var(--muted); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  padding: 11px 14px;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #042a30;
}
.btn.secondary {
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn.danger {
  background: rgba(252,165,165,0.12);
  border: 1px solid rgba(252,165,165,.45);
  color: var(--danger);
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
th { color: var(--muted); font-weight: 600; }
input, select, textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0a1324;
  color: var(--text);
  padding: 11px 12px;
}
pre {
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0b1323;
  overflow: auto;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(340px, 88vw);
  transform: translateX(102%);
  transition: transform .25s ease;
  background: #0e1729;
  border-left: 1px solid var(--border);
  z-index: 70;
  padding: 18px;
}
.drawer.open { transform: translateX(0); }
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(3,8,18,.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 60;
}
.overlay.open {
  opacity: 1;
  pointer-events: auto;
}
#key-modal {
  left: 50%;
  right: auto;
  top: 10vh;

  transform: translate(-50%, 120%);
  width: min(620px, 92vw);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
}
#key-modal.open {
  transform: translate(-50%, 0);
  bottom: auto;
}
.drawer-links { display: grid; gap: 8px; margin-top: 12px; }
.drawer-links a {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--muted);
}
.drawer-links a.active {
  color: var(--text);
  background: rgba(37,194,217,.08);
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}
.status-ok { color: var(--ok); }
.status-danger { color: var(--danger); }
.list { margin: 0; padding-left: 18px; color: var(--muted); }
hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.site-footer {
  border-top: 1px solid var(--border);
  background: rgba(9, 15, 27, 0.85);
  padding: 28px 0 36px;
}
.footer-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.footer-col h4 {
  margin: 0 0 10px;
  font-size: 15px;
}
.footer-links {
  display: grid;
  gap: 8px;
}
.footer-links a {
  color: var(--muted);
}
.footer-links a:hover {
  color: var(--text);
}
@media (max-width: 980px) {
  .nav-desktop { display: none; }
  .burger { display: inline-flex; align-items: center; justify-content: center; }
  .col-4, .col-6, .col-8 { grid-column: span 12; }
  .row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* Home long-grid story layout */
.home-long {
  padding: 0;
  min-height: auto;
  scroll-snap-type: y mandatory;
}
.home-long .block {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: 84px 0 48px;
  scroll-snap-align: start;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  background: radial-gradient(900px 420px at 12% 8%, rgba(37,194,217,0.08), transparent 48%);
}
.home-long .block-dark {
  background:
    radial-gradient(700px 340px at 85% 20%, rgba(94,234,212,0.10), transparent 52%),
    linear-gradient(160deg, rgba(10,16,30,0.94), rgba(6,12,24,0.96));
}
.home-long .block-accent {
  background:
    radial-gradient(760px 360px at 20% 10%, rgba(37,194,217,0.18), transparent 55%),
    linear-gradient(160deg, rgba(9,18,33,0.96), rgba(9,14,27,0.94));
}
.home-long .block-final {
  background:
    radial-gradient(640px 300px at 50% 5%, rgba(94,234,212,0.20), transparent 60%),
    linear-gradient(180deg, rgba(9,15,27,0.96), rgba(5,10,20,0.98));
}
.home-long .block-hero h1,
.home-long .block h2 {
  margin: 0 0 12px;
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.home-long .block-hero h1 {
  font-size: clamp(34px, 7vw, 72px);
  max-width: 12ch;
}
.home-long .block h2 {
  font-size: clamp(28px, 5vw, 52px);
  max-width: 18ch;
}
.home-long .lead {
  font-size: clamp(17px, 2.3vw, 24px);
  color: var(--muted);
  max-width: 52ch;
}
.home-long .block-inner {
  display: grid;
  gap: 18px;
}
.home-long .block-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1.2fr .8fr;
  align-items: center;
}
.home-long .feature-list {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.home-long .feature-list .card {
  min-height: 172px;
}
.home-long .stat-card {
  max-width: 380px;
}
.home-long .block-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.home-long .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .5s ease, transform .55s ease;
}
.home-long .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.home-short .block {
  min-height: 82vh;
}

@media (max-width: 980px) {
  .home-long {
    scroll-snap-type: y proximity;
  }
  .home-long .block {
    min-height: auto;
    padding: 74px 0 42px;
  }
  .home-long .block-grid,
  .home-long .feature-list {
    grid-template-columns: 1fr;
  }
  .home-long .feature-list .card {
    min-height: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-long .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.price-old {
  margin: 12px 0 4px;
  color: var(--muted);
  font-size: 18px;
  text-decoration: line-through;
  opacity: 0.85;
}

/* Cabinet login */
.login-main {
  display: grid;
  align-items: center;
  min-height: calc(100vh - 70px);
}
.login-flow {
  max-width: 760px;
  margin: 18px auto;
  padding: 34px;
}
.login-step.hidden {
  display: none;
}
.login-flow h1 {
  margin: 0 0 12px;
  font-size: clamp(34px, 4.8vw, 56px);
  line-height: 1.06;
  letter-spacing: -0.02em;
}
.login-flow .muted {
  font-size: 20px;
  line-height: 1.5;
  margin: 0 0 14px;
}
.login-email-block {
  width: min(460px, 100%);
  margin: 28px auto 0;
  display: grid;
  gap: 12px;
}
.login-email-block label {
  color: var(--text);
  font-weight: 600;
}
.login-status {
  min-height: 24px;
  margin-top: 2px;
}
.otp-row {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 12px;
  margin: 28px 0 16px;
}
.otp-input {
  width: 78px;
  height: 96px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: #eef4ff0a;
  text-align: center;
  font-size: 42px;
  font-weight: 700;
  color: var(--text);
  padding: 0;
}
.otp-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(37, 194, 217, 0.18);
}
.login-primary {
  width: 100%;
  margin-top: 8px;
  min-height: 58px;
  font-size: 26px;
  border-radius: 14px;
}
.btn-link {
  display: block;
  margin: 14px auto 0;
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 34px;
  font-weight: 500;
  cursor: pointer;
}
.btn-link:disabled {
  opacity: 0.55;
  cursor: default;
}

@media (max-width: 760px) {
  .login-flow {
    padding: 20px;
    margin: 10px auto;
  }
  .login-flow h1 {
    font-size: clamp(30px, 8vw, 44px);
  }
  .login-flow .muted {
    font-size: 18px;
  }
  .otp-row {
    gap: 8px;
  }
  .otp-input {
    width: min(52px, 13vw);
    height: 70px;
    font-size: 30px;
  }
  .login-primary {
    font-size: 22px;
    min-height: 54px;
  }
  .btn-link {
    font-size: 28px;
  }
}
