:root {
  --primary: #1f6feb;
  --accent: #f59e0b;
  --text: #0f172a;
  --muted: #64748b;
  --bg: #ffffff;
  --bg-soft: #f1f5f9;
  --border: #e2e8f0;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --tap: 44px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
}

body.no-scroll { overflow: hidden; }

img { max-width: 100%; display: block; }

a { color: var(--primary); }

.container {
  width: min(1160px, 100% - 32px);
  margin-inline: auto;
}

.btn {
  min-height: var(--tap);
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.06s ease, background 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { filter: brightness(1.05); }
.btn--primary:disabled { background: #cbd5e1; cursor: not-allowed; }
.btn--ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn--block { width: 100%; }
.btn--lg { min-height: 52px; padding: 14px 28px; font-size: 18px; }

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header__inner { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.header__brand { display: flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; color: var(--text); }
.header__logo { width: 32px; height: 32px; }
.header__nav { display: flex; gap: 18px; margin-left: 12px; }
.header__nav a { text-decoration: none; color: var(--muted); font-weight: 500; }
.header__nav a:hover { color: var(--primary); }
.header__actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.header__phone { text-decoration: none; color: var(--text); font-weight: 600; white-space: nowrap; }
.header__burger { display: none; background: none; border: 0; font-size: 24px; min-width: var(--tap); min-height: var(--tap); cursor: pointer; }

/* Hero */
.hero { padding: 72px 0; background: linear-gradient(180deg, var(--bg-soft), #fff); }
.hero h1 { font-size: clamp(28px, 5vw, 48px); margin: 0 0 16px; line-height: 1.1; }
.hero p { font-size: clamp(16px, 2.2vw, 20px); color: var(--muted); max-width: 720px; margin: 0 0 28px; }

.section { padding: 56px 0; }
.section h2 { font-size: clamp(22px, 3.4vw, 34px); margin: 0 0 24px; }
.section--carousel { padding-top: 32px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 8px; }

.prose { max-width: 820px; }
.prose p { color: var(--muted); }

/* FAQ */
.faq__item { border: 1px solid var(--border); border-radius: 12px; padding: 4px 16px; margin-bottom: 10px; background: #fff; }
.faq__item summary { cursor: pointer; font-weight: 600; padding: 12px 0; min-height: var(--tap); display: flex; align-items: center; }
.faq__item p { color: var(--muted); margin: 0 0 12px; }

/* Contacts */
.contacts-list { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 12px; max-width: 520px; }
.contacts-list li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.contacts-list span:first-child { color: var(--muted); }

/* Carousel */
.carousel { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--bg-soft); box-shadow: var(--shadow); }
.carousel__track { display: flex; transition: transform 0.5s ease; }
.carousel__slide { min-width: 100%; position: relative; }
.carousel__image { width: 100%; height: clamp(220px, 42vw, 440px); object-fit: cover; }
.carousel__caption {
  position: absolute; inset: auto 0 0 0;
  padding: 24px;
  background: linear-gradient(180deg, transparent, rgba(15, 23, 42, 0.82));
  color: #fff;
}
.carousel__caption h2 { margin: 0 0 6px; font-size: clamp(20px, 3vw, 30px); }
.carousel__caption p { margin: 0 0 14px; opacity: 0.92; }
.carousel__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: var(--tap); height: var(--tap); border-radius: 50%;
  border: 0; background: rgba(255, 255, 255, 0.85); cursor: pointer; font-size: 22px; line-height: 1;
}
.carousel__nav--prev { left: 12px; }
.carousel__nav--next { right: 12px; }
.carousel__dots { position: absolute; bottom: 12px; right: 16px; display: flex; gap: 8px; }
.carousel__dot { width: 10px; height: 10px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.55); cursor: pointer; padding: 0; }
.carousel__dot.is-active { background: #fff; }

/* Footer */
.footer { background: #0f172a; color: #cbd5e1; padding: 40px 0 20px; margin-top: 40px; }
.footer__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.footer a { color: #e2e8f0; text-decoration: none; }
.footer__socials { display: flex; flex-direction: column; gap: 8px; }
.footer__note { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 28px; padding-top: 16px; border-top: 1px solid #1e293b; font-size: 14px; }

/* Quiz overlay */
.quiz-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 23, 42, 0.6);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.quiz-overlay[hidden] { display: none; }
.quiz {
  width: min(560px, 100%); max-height: 94vh; overflow-y: auto;
  background: #fff; border-radius: 18px; padding: 20px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
}
.quiz__progress { height: 6px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.quiz__bar { height: 100%; width: 0; background: var(--primary); transition: width 0.3s ease; }
.quiz__meta { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; color: var(--muted); font-size: 14px; }
.quiz__close { background: none; border: 0; font-size: 26px; line-height: 1; cursor: pointer; min-width: var(--tap); min-height: var(--tap); color: var(--muted); }
.quiz__title { margin: 12px 0; font-size: clamp(18px, 4vw, 24px); }
.quiz__options { display: grid; gap: 10px; }
.quiz__option {
  min-height: var(--tap); padding: 14px 16px; text-align: left;
  border: 1px solid var(--border); border-radius: 12px; background: #fff;
  font-size: 16px; cursor: pointer;
}
.quiz__option:hover { border-color: var(--primary); }
.quiz__option.is-selected { border-color: var(--primary); background: rgba(31, 111, 235, 0.08); font-weight: 600; }
.quiz__option--inline { display: inline-block; }
.quiz__hint { color: var(--muted); font-size: 14px; margin: 10px 0 0; }
.quiz__channels { display: flex; flex-wrap: wrap; gap: 10px; }
.quiz__contact { display: grid; gap: 14px; margin-top: 8px; }
.field { display: grid; gap: 6px; }
.field__label { font-size: 14px; color: var(--muted); }
.field input[type="text"], .field input[type="tel"], .field input[type="email"] {
  min-height: var(--tap); padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 16px;
}
.field.has-error input { border-color: #dc2626; background: #fef2f2; }
.field__error { color: #dc2626; font-size: 13px; min-height: 16px; }
.quiz__consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); cursor: pointer; flex-wrap: wrap; }
.quiz__consent input { width: 22px; height: 22px; margin-top: 2px; }
.quiz__consent.has-error { color: #dc2626; }
.quiz__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.quiz__error { color: #dc2626; background: #fef2f2; border-radius: 10px; padding: 10px 12px; margin-top: 12px; font-size: 14px; }
.quiz__footer { display: flex; gap: 10px; margin-top: 18px; }
.quiz__footer .btn { flex: 1; }
.quiz__success { text-align: center; padding: 24px 0; }

@media (max-width: 860px) {
  .header__nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: #fff; flex-direction: column; padding: 16px; border-bottom: 1px solid var(--border); }
  .header__nav.is-open { display: flex; }
  .header__burger { display: inline-flex; align-items: center; justify-content: center; }
  .header__phone { display: none; }
}
@media (max-width: 480px) {
  .header__actions .btn--primary { display: none; }
  .hero { padding: 44px 0; }
  .section { padding: 40px 0; }
}
