@import url('https://fonts.googleapis.com/css2?family=Onest:wght@400;700;800;900&family=Inter:wght@400;500;600&display=swap');

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

:root {
  --bg-light: #FBFAF7;
  --bg-dark: #13111C;
  --bg-dark-2: #1E1B2E;
  --text-heading: #0E0E14;
  --text-body: #2A2835;
  --text-muted: #6B6878;
  --grad-primary: linear-gradient(135deg, #6C3CE1 0%, #00C2FF 100%);
  --grad-accent: linear-gradient(135deg, #FF5E57 0%, #FFD93D 100%);
  --success: #00D9A3;
  --error: #FF5E57;
  --glass-border: rgba(255,255,255,0.18);
  --purple: #6C3CE1;
  --cyan: #00C2FF;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-light);
  color: var(--text-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Typography */
.h1 {
  font-family: 'Onest', sans-serif;
  font-weight: 800;
  font-size: clamp(48px, 7vw, 96px);
  letter-spacing: -0.03em;
  line-height: 0.95;
}
.h2 {
  font-family: 'Onest', sans-serif;
  font-weight: 900;
  font-size: clamp(36px, 5vw, 64px);
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.h3 {
  font-family: 'Onest', sans-serif;
  font-weight: 700;
  font-size: clamp(24px, 2.5vw, 32px);
}
.body-text { font-size: clamp(16px, 1.5vw, 18px); line-height: 1.6; }
.caption { font-family: 'Inter', sans-serif; font-weight: 500; font-size: 14px; color: var(--text-muted); }
.stat-num {
  font-family: 'Onest', sans-serif;
  font-weight: 900;
  font-size: clamp(64px, 10vw, 140px);
  line-height: 1;
  letter-spacing: -0.04em;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-variant-numeric: tabular-nums;
}

/* Gradient text */
.grad-text {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.grad-text-accent {
  background: var(--grad-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  border-radius: 16px;
  padding: 0 32px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 17px;
  cursor: pointer;
  border: none;
  transition: transform 200ms cubic-bezier(0.34,1.56,0.64,1), box-shadow 200ms ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: scale(0.96) !important; }
.btn-primary {
  background: var(--grad-primary);
  color: #fff;
}
.btn-primary:hover { box-shadow: 0 0 40px rgba(108,60,225,0.5); transform: translateY(-2px); }
.btn-accent {
  background: var(--grad-accent);
  color: #fff;
}
.btn-accent:hover { box-shadow: 0 0 40px rgba(255,94,87,0.4); transform: translateY(-2px); }
.btn-glass {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--glass-border);
  color: #fff;
  backdrop-filter: blur(20px);
}
.btn-glass:hover { background: rgba(255,255,255,0.14); transform: translateY(-2px); }
.btn-outline {
  background: transparent;
  border: 1.5px solid rgba(108,60,225,0.4);
  color: var(--purple);
}
.btn-outline:hover { border-color: var(--purple); box-shadow: 0 0 20px rgba(108,60,225,0.15); }

/* Cards */
.card {
  border-radius: 24px;
  padding: 40px;
  background: #fff;
  transition: transform 300ms ease, box-shadow 300ms ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 20px 60px rgba(108,60,225,0.12); }
.glass-card {
  border-radius: 24px;
  padding: 40px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  transition: transform 300ms ease, box-shadow 300ms ease;
}
.glass-card:hover { transform: translateY(-4px); box-shadow: 0 20px 60px rgba(108,60,225,0.2); }
.card-light {
  border-radius: 24px;
  padding: 40px;
  background: #fff;
  border: 1.5px solid rgba(14,14,20,0.07);
  transition: transform 300ms ease, box-shadow 300ms ease;
}
.card-light:hover { transform: translateY(-4px); box-shadow: 0 20px 60px rgba(108,60,225,0.1); }

/* Layout */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.section-pad { padding: 120px 0; }
.section-pad-sm { padding: 64px 0; }

/* Inputs */
.input-field {
  width: 100%;
  height: 56px;
  border-radius: 14px;
  padding: 0 20px;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  border: 1.5px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: #fff;
  outline: none;
  transition: border-color 200ms ease, background 200ms ease;
}
.input-field::placeholder { color: rgba(255,255,255,0.4); }
.input-field:focus { border-color: var(--purple); background: rgba(108,60,225,0.08); }

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 600ms ease-out, transform 600ms ease-out;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Sticky CTA mobile */
.sticky-cta {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 12px 20px 20px;
  background: linear-gradient(to top, var(--bg-dark) 60%, transparent);
}

/* Accordion */
.accordion-item { overflow: hidden; }
.accordion-header {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 32px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 18px;
  color: var(--text-heading);
  gap: 16px;
}
.accordion-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(108,60,225,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 300ms cubic-bezier(0.34,1.56,0.64,1), background 200ms;
  color: var(--purple);
  font-size: 18px;
}
.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 400ms cubic-bezier(0.4,0,0.2,1);
}
.accordion-body-inner { padding: 0 32px 28px; color: var(--text-body); font-size: 17px; line-height: 1.6; }

/* Pricing */
.pricing-featured {
  position: relative;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.pricing-featured::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 26px;
  background: var(--grad-primary);
  z-index: -1;
}

/* Toggle */
.toggle-wrap {
  display: inline-flex;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 4px;
  gap: 4px;
}
.toggle-btn {
  padding: 10px 24px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 15px;
  transition: background 200ms, color 200ms;
  color: rgba(255,255,255,0.5);
  background: transparent;
}
.toggle-btn.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Comparison table */
.compare-table { width: 100%; }
.compare-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  border-bottom: 1px solid rgba(14,14,20,0.06);
}
.compare-row:last-child { border-bottom: none; }
.compare-cell { padding: 18px 24px; font-size: 16px; }
.compare-cell.label { font-weight: 600; color: var(--text-heading); }
.compare-cell.bad { color: var(--text-muted); }
.compare-cell.good { color: var(--purple); font-weight: 600; }

/* Swipe carousel (mobile) */
@media (max-width: 768px) {
  .section-pad { padding: 48px 0; }
  .section-pad-sm { padding: 40px 0; }

  .container { padding: 0 16px; }

  /* Заголовки — снижаем нижнюю границу clamp, чтобы крупные H1/H2 не вылезали за viewport */
  .h1 { font-size: clamp(34px, 9vw, 60px); line-height: 1.05; letter-spacing: -0.02em; }
  .h2 { font-size: clamp(26px, 7vw, 44px); line-height: 1.1; letter-spacing: -0.01em; }
  .h3 { font-size: clamp(20px, 5vw, 26px); }
  .body-text { font-size: 15px; line-height: 1.55; }

  /* Карточки — компактнее, меньше воздуха по краям */
  .card, .card-light, .glass-card { padding: 20px; border-radius: 20px; }

  /* Кнопки — разрешаем перенос текста, уменьшаем высоту/шрифт */
  .btn {
    height: auto;
    min-height: 52px;
    padding: 12px 16px;
    font-size: 15px;
    line-height: 1.25;
    white-space: normal;
    border-radius: 14px;
  }

  /* Двухстрочные кнопки скачивания: лейбл сверху, цена снизу */
  .download-btn {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 4px;
    text-align: center;
    padding: 12px 16px !important;
  }
  .download-btn > span:first-child { font-size: 14px; line-height: 1.3; }
  .download-btn > span:last-child { font-size: 18px; }

  /* Инпуты — те же 16px шрифт чтобы iOS не зумил при фокусе, высота поменьше */
  .input-field { height: 52px; font-size: 16px; padding: 0 16px; }

  /* Стат-числа (саль до) — нижний bound снижен, чтобы 7-значные суммы помещались */
  .stat-num { font-size: clamp(40px, 11vw, 80px); }

  /* Toggle (single/multi, ручной/документы) — wrap на узком экране */
  .toggle-wrap { flex-wrap: wrap; }
  .toggle-btn { padding: 8px 14px; font-size: 14px; }

  /* Аккордеон/таблицы */
  .accordion-header { font-size: 16px; padding: 20px 24px; }
  .accordion-body-inner { padding: 0 24px 20px; }
  .compare-cell { padding: 14px 16px; font-size: 14px; }

  /* Swipe carousel — !important нужен потому что в jsx ставится inline display:grid */
  .swipe-carousel {
    display: flex !important;
    grid-template-columns: none !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 16px !important;
    padding: 4px 0 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .swipe-carousel::-webkit-scrollbar { display: none; }
  .swipe-carousel > * {
    flex: 0 0 85vw;
    scroll-snap-align: start;
    min-width: 0;
  }

  /* Hero-блок со статистикой: 3 числа в один столбец, выравнивание влево */
  .hero-stats {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    padding-top: 32px !important;
    margin-top: 40px !important;
  }
  .hero-stat-cell { text-align: left !important; padding: 0 !important; }

  /* Comparison: две колонки сворачиваем в одну */
  .compare-grid { grid-template-columns: 1fr !important; gap: 16px !important; }

  .sticky-cta { display: block; }
  .hero-hidden-mobile { display: none; }
}

/* Очень узкие экраны (≤380px) — ещё компактнее */
@media (max-width: 380px) {
  .container { padding: 0 12px; }
  .card, .card-light, .glass-card { padding: 16px; }
  .btn { font-size: 14px; padding: 10px 14px; }
  .download-btn > span:first-child { font-size: 13px; }
}

/* Glow orb */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

/* 3D CSS vehicle */
.hero-visual {
  position: relative;
  width: 100%;
  height: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Nav */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  transition: background 300ms, backdrop-filter 300ms;
}
.nav.scrolled {
  background: rgba(19,17,28,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: 'Onest', sans-serif;
  font-weight: 900;
  font-size: 20px;
  color: #fff;
  text-decoration: none;
}
.nav-links { display: flex; gap: 32px; align-items: center; }
.nav-link { color: rgba(255,255,255,0.6); font-size: 15px; font-weight: 500; text-decoration: none; transition: color 200ms; }
.nav-link:hover { color: #fff; }
@media (max-width: 768px) {
  .nav-links { display: none; }
}

/* Двухколоночная сетка полей в калькуляторе: на узких экранах схлопывается в одну колонку,
   чтобы поля не были сжаты и не «плясали» по вертикали. */
.input-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 640px) {
  .input-grid-2col { grid-template-columns: 1fr; }
}
