/* ===== Дизайн-токены (аналог цветов/шрифтов референса) ===== */
:root {
  --accent: #da4b29;        /* основной акцент — кнопки, ссылки */
  --accent-dark: #b93d20;
  --teal: #3cbfa4;          /* второй акцент */
  --ink: #333333;           /* основной текст */
  --ink-muted: #6b6b70;     /* приглушённый текст */
  --bg: #ffffff;
  --bg-muted: #f4f4f9;      /* подложка секций */
  --border: #e7e7ee;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(20, 20, 40, .06);
  --maxw: 1120px;
  --font: 'Open Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

/* ===== База ===== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ===== Кнопки ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5em;
  background: var(--accent); color: #fff;
  padding: 14px 26px; border-radius: 999px;
  font-weight: 600; font-size: 15px;
  border: 2px solid var(--accent); cursor: pointer;
  transition: background .2s, border-color .2s, transform .05s;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn:active { transform: translateY(1px); }
.btn--sm { padding: 9px 18px; font-size: 14px; }
.btn--wide { width: 100%; }

/* Кнопка WhatsApp (фирменный зелёный) */
.btn--wa { background: #25d366; border-color: #25d366; }
.btn--wa:hover { background: #1ebe5b; border-color: #1ebe5b; }
.btn--wa svg { width: 20px; height: 20px; fill: currentColor; }

/* Круглая иконка WhatsApp в шапке */
.wa-icon {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: #25d366; color: #fff; flex: none;
  transition: background .2s, transform .05s;
}
.wa-icon:hover { background: #1ebe5b; }
.wa-icon:active { transform: translateY(1px); }
.wa-icon svg { width: 20px; height: 20px; fill: currentColor; }

/* Плавающая кнопка WhatsApp (FAB) */
.wa-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  display: grid; place-items: center;
  width: 58px; height: 58px; border-radius: 50%;
  background: #25d366; color: #fff;
  box-shadow: 0 8px 24px rgba(37, 211, 102, .45);
  transition: transform .2s, box-shadow .2s;
  animation: wa-pulse 2.4s ease-out infinite;
}
.wa-fab:hover { transform: scale(1.06); background: #1ebe5b; }
.wa-fab svg { width: 30px; height: 30px; fill: currentColor; }

@keyframes wa-pulse {
  0%   { box-shadow: 0 8px 24px rgba(37,211,102,.45), 0 0 0 0 rgba(37,211,102,.5); }
  70%  { box-shadow: 0 8px 24px rgba(37,211,102,.45), 0 0 0 16px rgba(37,211,102,0); }
  100% { box-shadow: 0 8px 24px rgba(37,211,102,.45), 0 0 0 0 rgba(37,211,102,0); }
}
@media (prefers-reduced-motion: reduce) {
  .wa-fab { animation: none; }
}

/* ===== Шапка ===== */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header__inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.logo__mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent); color: #fff; font-weight: 700;
}
.nav { display: flex; gap: 26px; margin-left: auto; }
.nav a { font-size: 15px; color: var(--ink-muted); transition: color .2s; }
.nav a:hover { color: var(--accent); }
.header__contact { display: flex; align-items: center; gap: 12px; }
.header__phone { white-space: nowrap; }

/* Переключатель языка (сегментированный контрол) */
.lang {
  display: inline-flex; flex: none;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 2px; background: var(--bg-muted);
}
.lang__btn {
  border: 0; background: none; cursor: pointer;
  padding: 6px 12px; border-radius: 999px;
  font: inherit; font-size: 13px; font-weight: 600;
  color: var(--ink-muted); line-height: 1;
  transition: background .2s, color .2s;
}
.lang__btn:hover { color: var(--accent); }
.lang__btn.is-active { background: var(--accent); color: #fff; }

.burger { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.burger span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: .25s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Hero ===== */
.hero {
  position: relative;
  overflow: hidden;
  padding: 96px 0;
  background-color: var(--bg-muted); /* запасной цвет, пока грузятся фото */
}
/* Слои-кадры слайд-шоу (плавно перетекают друг в друга) */
.hero__bg { position: absolute; inset: 0; z-index: 0; }
.hero__slide {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center right;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 1s ease;
}
.hero__slide.is-active { opacity: 1; }
/* Светлый слой поверх фото: слева почти белый (для текста), справа прозрачнее */
.hero::before {
  content: "";
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg,
    rgba(255,255,255,.94) 0%,
    rgba(255,255,255,.88) 38%,
    rgba(255,255,255,.55) 68%,
    rgba(255,255,255,.30) 100%);
}
.hero__inner { position: relative; z-index: 2; }
.hero__content { max-width: 720px; }
.hero__eyebrow {
  display: inline-block; margin: 0 0 16px;
  font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--teal);
}
.hero__title { font-size: clamp(28px, 5vw, 46px); }
.hero__lead { font-size: 18px; color: var(--ink-muted); max-width: 620px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 28px 0 40px; }
.hero__facts { display: flex; flex-wrap: wrap; gap: 40px; list-style: none; margin: 0; padding: 0; }
.hero__facts li { display: flex; flex-direction: column; }
.hero__facts strong { font-size: 26px; color: var(--accent); }
.hero__facts span { font-size: 14px; color: var(--ink-muted); }

/* ===== Секции ===== */
.section { padding: 72px 0; }
.section--muted { background: var(--bg-muted); }
.section__head { max-width: 640px; margin: 0 auto 44px; text-align: center; }
.section__head h2 { font-size: clamp(24px, 4vw, 34px); }
.section__head p { color: var(--ink-muted); margin: 0; }

/* ===== Карточки услуг ===== */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 16px 40px rgba(218,75,41,.12); }
.card h3 { font-size: 19px; }
.card p { color: var(--ink-muted); font-size: 15px; flex: 1; }

/* ===== Преимущества ===== */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.feature {
  background: #fff; border-radius: var(--radius); padding: 26px;
  border-top: 3px solid var(--teal);
}
.feature h3 { font-size: 18px; }
.feature p { color: var(--ink-muted); font-size: 15px; margin: 0; }

/* Фон блока «Почему выбирают нас» (картинка задаётся из config.js через JS) */
#advantages {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* ===== Принципы (чек-лист) ===== */
.checks { list-style: none; margin: 0 auto; padding: 0; max-width: 760px; display: grid; gap: 14px; }
.checks li {
  position: relative; padding: 18px 20px 18px 58px;
  background: var(--bg-muted); border-radius: var(--radius-sm); font-weight: 600;
}
.checks li::before {
  content: "✓"; position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--teal); color: #fff; display: grid; place-items: center; font-size: 15px;
}

/* ===== Этапы ===== */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { background: #fff; border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); }
.step__num { font-size: 40px; font-weight: 700; color: rgba(218,75,41,.25); }
.step h3 { font-size: 19px; margin-top: 8px; }
.step p { color: var(--ink-muted); margin: 0; font-size: 15px; }

/* ===== Контакты ===== */
.contacts { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.contacts__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.contacts__list li { display: grid; gap: 2px; }
.contacts__list span { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-muted); }
.contacts__list a { font-size: 18px; font-weight: 600; color: var(--accent); }
.contacts__list p { margin: 0; font-size: 16px; }

.contacts__form {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px; box-shadow: var(--shadow); display: grid; gap: 16px;
}
.contacts__form h3 { margin: 0; font-size: 21px; }
.contacts__form-lead { margin: 0; color: var(--ink-muted); font-size: 15px; }
.contacts__form label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.contacts__form input,
.contacts__form textarea {
  font: inherit; font-weight: 400; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-muted); resize: vertical;
}
.contacts__form input:focus,
.contacts__form textarea:focus { outline: 2px solid var(--teal); background: #fff; }
.contacts__form input.invalid,
.contacts__form textarea.invalid { border-color: var(--accent); outline-color: var(--accent); }
.form__note { margin: 0; font-size: 14px; color: var(--teal); font-weight: 600; }

/* ===== Подвал ===== */
.footer { background: #201f24; color: #cfced6; padding: 48px 0 32px; }
.footer__inner { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }
.footer p { color: #a9a8b3; font-size: 14px; margin: 10px 0 0; }
.logo--footer { color: #fff; font-size: 16px; }
.footer__nav { display: flex; gap: 22px; justify-self: end; }
.footer__nav a { color: #cfced6; font-size: 14px; }
.footer__nav a:hover { color: #fff; }
.footer__copy { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.1); padding-top: 20px; font-size: 13px; }

/* ===== Адаптив ===== */

/* Планшеты и меньше: сетки в 2 колонки, меню сворачивается в бургер */
@media (max-width: 900px) {
  .cards, .features, .steps { grid-template-columns: repeat(2, 1fr); }
  .contacts { grid-template-columns: 1fr; }
  .footer__inner { grid-template-columns: 1fr; }
  .footer__nav { justify-self: start; }

  .header__contact { margin-left: auto; }
  .burger { display: flex; }
  .nav {
    position: fixed; inset: 68px 0 auto 0;
    flex-direction: column; gap: 0; margin: 0;
    background: #fff; border-bottom: 1px solid var(--border);
    transform: translateY(-120%); transition: transform .3s; box-shadow: var(--shadow);
  }
  .nav.open { transform: translateY(0); }
  .nav a { padding: 16px 20px; border-top: 1px solid var(--border); }
}

/* Смартфоны: одна колонка, скрываем кнопку с номером (остаётся иконка WhatsApp) */
@media (max-width: 640px) {
  .header__phone { display: none; }
  .cards, .features, .steps { grid-template-columns: 1fr; }
  .hero__facts { gap: 24px; }
  .section { padding: 48px 0; }
  .hero { padding: 56px 0; }
  /* На узком экране текст на всю ширину — светлый слой плотнее и равномернее */
  .hero::before { background: linear-gradient(rgba(255,255,255,.90), rgba(255,255,255,.82)); }
  .hero__slide { background-position: center; }
  .wa-fab { width: 52px; height: 52px; right: 16px; bottom: 16px; }
  .wa-fab svg { width: 27px; height: 27px; }
}
