/* =========================
   БАЗА И ПЕРЕМЕННЫЕ
========================= */
:root{
  color-scheme: light dark;

  --bg: #0f1115;
  --bg-alt: #121721;
  --surf: #141a26;
  --card: #ffffff;
  --text: #1b2333;
  --muted: #6c7891;
  --border: #e7ecf3;
  --accent: #4da3ff;
  --accent-2: #7cffb7;
  --danger: #ff5c7a;
  --container: 1100px;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(16,23,38,.08);
}

@media (prefers-color-scheme: dark){
  :root{
    --card: #161b24;
    --text: #e7edf8;
    --muted: #a7b2c8;
    --border: #1e2735;
    --shadow: 0 10px 30px rgba(0,0,0,.35);
  }
}

/* Глобальные базовые настройки */
*{ box-sizing: border-box }
html{
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
html,body{ margin:0; padding:0 }

body{
  line-height: 1.5;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at -10% -20%, #dff2ff44 0%, transparent 60%),
    radial-gradient(1200px 600px at 110% -20%, #eafff244 0%, transparent 60%),
    #f6f9ff;
}

@media (prefers-color-scheme: dark){
  body{
    background:
      radial-gradient(1200px 600px at -10% -20%, #1e335544 0%, transparent 60%),
      radial-gradient(1200px 600px at 110% -20%, #1a3a2e44 0%, transparent 60%),
      var(--bg);
  }
}

/* Медиа по умолчанию */
img, svg, video, canvas, audio, iframe{
  max-width: 100%;
  height: auto;
}

.container{ max-width: var(--container); margin: 0 auto; padding: 0 20px }

/* Текстовые утилиты */
.muted{ color: var(--muted) }
.accent{ color: var(--accent) }

/* Фокусная подсветка доступности */
:focus-visible{
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}

/* Якори с учётом липкого хедера */
section[id]{ scroll-margin-top: 86px }

/* Блокировка скролла (для открытого бургера/модалки при необходимости) */
body.no-scroll{ overflow: hidden }

/* =========================
   КНОПКИ
========================= */
.btn{
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem;
  padding: 12px 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform .1s ease, background .2s ease, border-color .2s ease, color .2s ease;
}
/* hover-эффект только там, где есть курсор */
@media (hover: hover){
  .btn:hover{ transform: translateY(-1px) }
}
.btn:active{ transform: translateY(0) scale(.99) }
.btn--primary{
  background: linear-gradient(180deg, var(--accent), #3c86d4);
  color: #fff;
  border-color: transparent;
}
.btn--ghost{
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn--small{ padding: 8px 12px; font-size: .95rem }
/* Состояния кнопок */
.btn[disabled], .btn:disabled{
  opacity: .6; cursor: not-allowed; transform: none !important;
}

/* =========================
   ХЕДЕР + НАВИГАЦИЯ
========================= */
.header{
  position: sticky; top:0; z-index: 50;
  background: rgba(255,255,255,.7);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
@media (prefers-color-scheme: dark){
  .header{ background: rgba(16,20,28,.6) }
}
/* Фолбэк, если нет backdrop-filter */
@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))){
  .header{ background: rgba(255,255,255,.95) }
  @media (prefers-color-scheme: dark){
    .header{ background: rgba(16,20,28,.95) }
  }
}
.header__inner{
  min-height: 70px;
  display: flex; align-items: center; justify-content: space-between;
}

.logo{
  display:flex; align-items:center; gap: .6rem; font-weight: 900; letter-spacing:.2px;
}
.logo__mark{
  display:inline-grid; place-items:center;
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(180deg, var(--accent), #3c86d4);
  color:#fff; font-weight:900;
}
.logo__text{ font-weight: 800 }
.logo--small .logo__mark{ width:30px; height:30px; font-size:.9rem }

.nav{ display:flex; align-items:center; gap: 18px }
.nav__link{
  color: var(--text); text-decoration: none; font-weight: 600; opacity:.9;
}
.nav__link:hover{ opacity:1 }
/* Активный пункт (см. aria-current в JS) */
.nav__link[aria-current="page"]{
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Бургер (мобилки) */
.burger{
  display:none;
  width: 44px; height: 44px; padding:0; border: 1px solid var(--border);
  border-radius: 10px; background: var(--card); cursor:pointer;
}
.burger span{
  display:block; width:22px; height:2px; background: var(--text);
  margin: 5px auto; transition: .2s;
}
@media (max-width: 880px){
  .burger{ display:block }
  .nav{
    position: fixed; inset: 70px 0 auto 0; z-index: 60;
    display: grid; gap: 10px;
    padding: 16px 20px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%);
    transition: transform .2s ease;
  }
  .header.is-open .nav{ transform: translateY(0) }
  .header.is-open .burger span:nth-child(1){ transform: translateY(7px) rotate(45deg) }
  .header.is-open .burger span:nth-child(2){ opacity:0 }
  .header.is-open .burger span:nth-child(3){ transform: translateY(-7px) rotate(-45deg) }
}

/* =========================
   HERO
========================= */
.hero{ padding: 48px 0 24px }
.hero__grid{
  display: grid; gap: 28px;
  grid-template-columns: 1.2fr .8fr;
  align-items: start;
}
@media (max-width: 980px){
  .hero__grid{ grid-template-columns: 1fr }
}
.hero__content h1{
  font-size: clamp(28px, 4.5vw, 44px);
  line-height: 1.15; margin: 0 0 10px;
}
.hero__lead{
  font-size: 1.05rem; color: var(--muted); margin: 10px 0 18px;
}
.hero__actions{ display:flex; gap:12px; flex-wrap:wrap; margin-bottom: 12px }
.hero__badges{
  list-style:none; padding:0; margin:10px 0 0;
  display:flex; gap:10px; flex-wrap:wrap;
}
.hero__badges li{
  padding: 8px 10px; border:1px dashed var(--border); border-radius: 999px;
  background: var(--card); color: var(--muted); font-weight:600;
}

/* Карточка-форма в hero */
.hero__card{
  background: var(--card);
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.hero__card h3{ margin: 4px 0 12px }

/* =========================
   СЕКЦИИ, СЕТКИ, КАРТОЧКИ
========================= */
.section{ padding: 48px 0 }
.section--alt{
  background: linear-gradient(180deg, transparent, #f2f6ff 60%, transparent);
}
@media (prefers-color-scheme: dark){
  .section--alt{ background: linear-gradient(180deg, transparent, #0f1523 60%, transparent) }
}

.section__head{
  display:flex; align-items:center; justify-content: space-between; gap: 12px;
  margin-bottom: 16px;
}

.grid{ display:grid; gap: 18px }
.cards{ grid-template-columns: repeat(3, 1fr) }
@media (max-width: 980px){ .cards{ grid-template-columns: repeat(2, 1fr) } }
@media (max-width: 680px){ .cards{ grid-template-columns: 1fr } }

.card{
  background: var(--card);
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  display:flex; flex-direction: column; gap: 10px;
}
.card__actions{ display:flex; gap:10px; margin-top: auto; flex-wrap:wrap }

.list{ margin:0; padding-left: 18px }
.list li{ margin: 6px 0 }

/* Шаги */
.steps{
  list-style:none; padding:0; margin:0;
  display:grid; gap:14px; grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 980px){ .steps{ grid-template-columns: repeat(2, 1fr) } }
@media (max-width: 560px){ .steps{ grid-template-columns: 1fr } }
.steps li{
  display:flex; gap:12px; align-items:flex-start;
  background: var(--card); border:1px solid var(--border);
  border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow);
}
.steps__num{
  flex: 0 0 34px; height:34px; display:grid; place-items:center;
  border-radius: 50%; color:#fff; font-weight:800;
  background: linear-gradient(180deg, var(--accent), #3c86d4);
}

/* =========================
   ПРАЙСЫ
========================= */
.price{ position:relative }
.price--accent{ outline: 2px solid var(--accent); }
.price__value{
  font-size: 28px; font-weight: 900; margin: 0 0 8px;
}

/* Переключатель тарифов */
.toggle{ display:flex; align-items:center; gap:10px }
.switch{
  position:relative; display:inline-block; width: 54px; height: 30px;
}
.switch input{ display:none }
/* важно: скоупим стили только к тумблеру, чтобы не конфликтовали со слайдером отзывов */
.switch .slider{
  position:absolute; inset:0; background:#cfd6e6; border-radius: 999px; cursor:pointer;
}
.switch .slider:before{
  content:""; position:absolute; height:22px; width:22px; left:4px; top:4px;
  background:#fff; border-radius:50%; transition:.2s; box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.switch input:checked + .slider{ background: linear-gradient(180deg, var(--accent), #3c86d4) }
.switch input:checked + .slider:before{ transform: translateX(24px) }
/* фокусное состояние тумблера */
.switch input:focus-visible + .slider{
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 999px;
}

/* =========================
   СЛАЙДЕР ОТЗЫВОВ (скинули коллизии)
========================= */
[data-slider]{
  position: relative; overflow: hidden; border-radius: var(--radius);
  background: var(--card); border:1px solid var(--border); box-shadow: var(--shadow);
}
[data-slider] [data-track]{
  display:flex; transition: transform .35s ease; will-change: transform;
}
[data-slider] .slide{
  flex: 0 0 100%; padding: 18px; display:grid; gap:8px;
}
[data-slider] .slide blockquote{ margin:0; font-size:1.05rem }
[data-slider] .slider__btn{
  position:absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; /* WCAG таргет >=44px */
  border-radius: 50%;
  border:1px solid var(--border); background: var(--card);
  box-shadow: var(--shadow); cursor:pointer;
}
[data-slider] .slider__btn:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
[data-slider] .slider__btn--prev{ left: 10px }
[data-slider] .slider__btn--next{ right: 10px }

/* =========================
   АККОРДЕОН (FAQ)
========================= */
.accordion{ display:grid; gap:10px }
.acc{
  border:1px solid var(--border); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow);
}
.acc__head{
  width:100%; text-align:left; padding:14px 16px; background:transparent; border:0; cursor:pointer;
  font-weight:800;
}
.acc__body{
  display:none; padding: 0 16px 14px; color: var(--muted);
  border-top:1px dashed var(--border);
}
.acc.is-open .acc__body{ display:block }

/* =========================
   ФОРМЫ
========================= */
.form{ display:grid; gap: 14px }
.form--tight{ gap: 10px }
.form__grid{
  display:grid; gap: 14px; grid-template-columns: repeat(2, 1fr);
}
.field{ display:grid; gap:6px }
.field--full{ grid-column: 1 / -1 }

input, select, textarea{
  width:100%; padding: 12px 12px;
  border:1px solid var(--border); border-radius: 10px;
  background: var(--card); color: var(--text);
  caret-color: var(--accent);
}
textarea{ resize: vertical }

/* Placeholder — фолбэк + улучшение через @supports */
::placeholder{ color: var(--muted); opacity:.85 }
@supports (color: color-mix(in srgb, #000 50%, #fff)){
  ::placeholder{ color: color-mix(in srgb, var(--muted) 80%, transparent) }
}

/* Подсветка фокуса на группе поля и индикация ошибок */
.field:has(:focus-visible), .field:focus-within{
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 12px;
}
/* :invalid — фолбэк + улучшение */
:is(input,select,textarea):invalid{ border-color: var(--danger) }
@supports (color: color-mix(in srgb, #000 50%, #fff)){
  :is(input,select,textarea):invalid{
    border-color: color-mix(in srgb, var(--danger) 60%, var(--border));
  }
}

/* Автофилл */
input:-webkit-autofill{
  -webkit-text-fill-color: var(--text);
  transition: background-color 10000s ease-in-out 0s;
}

.hp{ display:none } /* honeypot */

.form__actions{ display:flex; align-items:center; gap:12px; flex-wrap:wrap }
.form__status{ min-height: 1.2em; color: var(--muted); font-weight:700 }

@media (max-width: 680px){
  .form__grid{ grid-template-columns: 1fr }
}

/* =========================
   МОДАЛКА (dialog)
========================= */
.modal{
  width:min(720px, 96vw); border:0; padding:0;
  background: transparent;
}
.modal::backdrop{
  background: #0b101aee; backdrop-filter: blur(3px);
}
.modal__box{
  position:relative;
  margin:0;
  padding: 18px;
  background: var(--card);
  color: var(--text);
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.modal__close{
  position:absolute; right:10px; top:10px;
  width:38px; height:38px; border-radius:10px; border:1px solid var(--border);
  background: var(--card); cursor:pointer; font-size: 20px; line-height: 1;
}
.modal__content{ margin: 10px 0 14px }
.modal__actions{ display:flex; gap:10px; justify-content:flex-end }

/* =========================
   ПОДВАЛ
========================= */
.footer{
  margin-top: 40px; padding: 24px 0 60px;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, transparent, #eef4ff);
}
@media (prefers-color-scheme: dark){
  .footer{ background: linear-gradient(180deg, transparent, #0e1422) }
}
.footer__grid{
  display:grid; gap:12px; grid-template-columns: 2fr 1fr 1fr;
  align-items:start;
}
.footer__nav, .footer__legal{
  display:grid; gap:8px;
}
@media (max-width: 880px){
  .footer__grid{ grid-template-columns: 1fr }
}

/* Кнопка "наверх" */
.to-top{
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 40;
  width:44px; height:44px; border-radius: 50%;
  border:1px solid var(--border); background: var(--card); cursor:pointer;
  box-shadow: var(--shadow); display:none;
}
.to-top.is-visible{ display:block }

/* =========================
   TOAST
========================= */
.toast{
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  background: var(--card); color: var(--text);
  border:1px solid var(--border); border-radius: 999px; padding: 10px 16px;
  box-shadow: var(--shadow);
  pointer-events: none; /* не блокирует клики */
}

/* =========================
   МЕЛОЧИ
========================= */
h2{ font-size: clamp(22px, 3.2vw, 30px); margin: 0 0 12px }
h3{ margin: 0 0 6px }
p{ margin: 0 0 10px }

/* Ховеры только там, где нет курсора — без «подпрыгиваний» */
@media (hover:none){
  .btn{ transition: background .2s ease, border-color .2s ease, color .2s ease }
}

/* Высокая контрастность */
@media (prefers-contrast: more){
  :focus-visible{ outline-width: 4px }
  .nav__link[aria-current="page"]{
    text-decoration-thickness: 2px;
  }
}

/* Меньше анимаций для пользователей, кто их отключает */
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto }
  *{ animation: none !important; transition: none !important }
}
