/* ===== Базовые стили ===== */
:root {
  --primary: #1a2b5c;
  --primary-dark: #111d40;
  --accent: #4ecdc4;
  --accent-dark: #2fb1a8;
  --text: #1c2230;
  --muted: #5b6477;
  --bg: #ffffff;
  --bg-alt: #f3f6fb;
  --border: #e2e7f0;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(26, 43, 92, 0.10);
  --header-h: 68px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

img, svg { max-width: 100%; }
a { color: var(--primary); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; color: var(--primary); }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 760px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ===== Кнопки ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 26px;
  border: 2px solid transparent; border-radius: 999px;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--primary-dark); box-shadow: 0 6px 18px rgba(78, 205, 196, .35); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { border-color: rgba(255,255,255,.6); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.12); }
.btn-tg { background: #229ed9; color: #fff; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: wait; transform: none; }

/* ===== Шапка ===== */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: rgba(26, 43, 92, .96); backdrop-filter: blur(10px);
  color: #fff; box-shadow: 0 2px 14px rgba(0,0,0,.15);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 100%; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.logo-text { font-size: 1.6rem; font-weight: 800; letter-spacing: .08em; color: #fff; }
.logo-icon { width: 44px; height: auto; color: var(--accent); }

.nav { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.nav a { color: #fff; text-decoration: none; font-weight: 500; opacity: .9; }
.nav a:hover { opacity: 1; color: var(--accent); }
.nav-phone { display: none; }
.header-phone {
  color: var(--primary-dark); background: var(--accent); text-decoration: none;
  font-weight: 700; padding: 9px 18px; border-radius: 999px; white-space: nowrap;
}
.header-phone:hover { background: var(--accent-dark); }

.burger { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.burger span { display: block; width: 26px; height: 3px; margin: 5px 0; background: #fff; border-radius: 2px; transition: transform .25s, opacity .25s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ===== Первый экран ===== */
.hero {
  background:
    radial-gradient(900px 400px at 85% 0%, rgba(78,205,196,.25), transparent 60%),
    linear-gradient(135deg, #1a2b5c 0%, #263f86 100%);
  color: #fff; padding: 72px 0 64px;
}
.hero-inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: center; }
.hero h1 { color: #fff; font-size: clamp(2rem, 4.6vw, 3.1rem); margin-bottom: .4em; }
.eyebrow { color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: .85rem; margin-bottom: .8em; }
.lead { font-size: 1.15rem; opacity: .92; max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.hero-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.hero-facts li {
  display: flex; align-items: baseline; gap: 14px; padding: 16px 20px;
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius); backdrop-filter: blur(6px);
}
.hero-facts strong { font-size: 1.7rem; color: var(--accent); min-width: 5.2ch; }
.hero-facts span { opacity: .9; }

/* ===== Секции ===== */
.section { padding: 72px 0; }
.section-alt { background: var(--bg-alt); }
.section-title { font-size: clamp(1.6rem, 3.2vw, 2.2rem); text-align: center; margin-bottom: 1.2em; }
.section-sub { text-align: center; color: var(--muted); margin-top: -.6em; margin-bottom: 1.6em; }

.cards { display: grid; gap: 22px; }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.cards-2 { grid-template-columns: repeat(2, 1fr); }
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.card h3 { font-size: 1.2rem; }
.card p { color: var(--muted); margin: 0; }
.icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: rgba(78,205,196,.18); margin-bottom: 16px; }
.icon svg { width: 28px; height: 28px; fill: none; stroke: var(--primary); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ===== Услуги ===== */
.services { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: start; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.checklist li { position: relative; padding: 16px 18px 16px 54px; background: #fff; border: 1px solid var(--border); border-radius: 12px; font-weight: 500; }
.checklist li::before {
  content: "✓"; position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--primary-dark);
  display: grid; place-items: center; font-weight: 800; font-size: .9rem;
}
.repair { background: var(--primary); color: #fff; border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.repair h3 { color: #fff; }
.repair ul { margin: 0 0 22px; padding-left: 1.2em; }
.repair li { margin-bottom: .4em; }

/* ===== Калькулятор ===== */
.calc { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: start; }
.calc-form, .calc-result, .lead-form {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow);
}
.calc-form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.calc-form .options { grid-column: 1 / -1; }
.calc-result { position: sticky; top: calc(var(--header-h) + 20px); background: linear-gradient(160deg, #1a2b5c, #263f86); color: #fff; border: 0; }
.calc-label { opacity: .8; margin: 0; }
.calc-price { font-size: 2.6rem; font-weight: 800; color: var(--accent); margin: 0 0 .3em; line-height: 1.1; }
.calc-summary { font-size: .95rem; opacity: .9; min-height: 3em; }
.calc-note { font-size: .82rem; opacity: .75; margin: 14px 0 0; }

.field { display: grid; gap: 6px; font-weight: 600; font-size: .95rem; }
.field span { color: var(--primary); }
.field input, .field select {
  width: 100%; min-height: 48px; padding: 10px 14px; font: inherit; font-weight: 400;
  color: var(--text); background: #fff; border: 1.5px solid var(--border); border-radius: 12px;
}
.field input:focus, .field select:focus { border-color: var(--accent-dark); outline: 3px solid rgba(78,205,196,.35); }
.field input.invalid { border-color: #d64545; }

.options { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px 22px; }
.options legend { font-weight: 600; color: var(--primary); margin-bottom: 8px; padding: 0; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; min-height: 40px; }
.check input { width: 22px; height: 22px; accent-color: var(--accent-dark); }

/* ===== Шаги ===== */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.steps li { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 22px; }
.steps h3 { font-size: 1.1rem; }
.steps p { color: var(--muted); margin: 0; font-size: .95rem; }
.step-num { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; margin-bottom: 14px; }

/* ===== Отзывы ===== */
.review { margin: 0; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.review figcaption { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.review figcaption strong { display: block; color: var(--primary); }
.review time { color: var(--muted); font-size: .85rem; }
.avatar { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; flex: none; }
.stars { color: #f5a623; letter-spacing: 2px; margin-bottom: 8px; }
.review blockquote { margin: 0; color: var(--text); }

/* ===== FAQ ===== */
.faq-item { background: #fff; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.faq-item summary { list-style: none; cursor: pointer; padding: 18px 56px 18px 20px; font-weight: 600; color: var(--primary); position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 1.5rem; color: var(--accent-dark); }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { margin: 0; padding: 0 20px 18px; color: var(--muted); }

/* ===== Форма заявки ===== */
.lead-form { display: grid; gap: 18px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin: 0; min-height: 1.4em; text-align: center; font-weight: 600; }
.form-status.ok { color: #1e8e5a; }
.form-status.err { color: #c0392b; }
.form-note { margin: 0; font-size: .8rem; color: var(--muted); text-align: center; }

/* ===== Подвал ===== */
.site-footer { background: var(--primary-dark); color: #cfd6ea; padding: 36px 0; }
.site-footer a { color: #fff; }
.site-footer p { margin: 0 0 .3em; }
.site-footer .logo-text { margin-bottom: 6px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.copyright { width: 100%; font-size: .85rem; opacity: .7; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.12); }

/* ===== Нижняя панель на телефоне ===== */
.mobile-bar { display: none; }

/* ===== Появление при прокрутке ===== */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .5s ease, transform .5s ease; }
.js .reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn { transition: none; }
}

/* ===== Планшеты ===== */
@media (max-width: 960px) {
  .hero-inner, .services, .calc { grid-template-columns: 1fr; }
  .hero-facts { grid-template-columns: repeat(3, 1fr); }
  .hero-facts li { flex-direction: column; gap: 4px; text-align: center; }
  .cards-3 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .calc-result { position: static; }
}

/* ===== Телефоны ===== */
@media (max-width: 820px) {
  .header-phone { display: none; }
  .burger { display: block; margin-left: auto; }
  .nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0; margin: 0;
    background: var(--primary); padding: 8px 20px 18px;
    box-shadow: 0 14px 24px rgba(0,0,0,.2);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .2s, transform .2s, visibility .2s;
  }
  .nav.open { transform: none; opacity: 1; visibility: visible; }
  .nav a { padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.1); }
  .nav-phone { display: block; color: var(--accent) !important; font-weight: 700; border-bottom: 0 !important; }
}

@media (max-width: 640px) {
  .section { padding: 52px 0; }
  .hero { padding: 48px 0 44px; }
  .hero-actions .btn { flex: 1 1 100%; }
  .hero-facts { grid-template-columns: 1fr; }
  .hero-facts li { flex-direction: row; text-align: left; align-items: baseline; }
  .cards-2, .steps, .calc-form { grid-template-columns: 1fr; }
  .calc-form, .calc-result, .lead-form { padding: 20px; }
  .calc-price { font-size: 2.2rem; }

  body { padding-bottom: 76px; }
  .mobile-bar {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.97); box-shadow: 0 -6px 20px rgba(0,0,0,.12);
  }
  .mobile-bar .btn { min-height: 48px; padding: 10px 14px; }
}

/* Контакты без формы */
.contact-direct { display: grid; gap: 14px; max-width: 460px; margin: 0 auto; }
.lead-form[hidden], .contact-direct[hidden] { display: none; }


/* Форма заявки внутри калькулятора */
.calc-lead, .calc-direct { display: grid; gap: 12px; margin-top: 8px; }
.calc-lead[hidden], .calc-direct[hidden] { display: none; }
.calc-lead input[type="text"], .calc-lead input[type="tel"] {
  width: 100%; min-height: 48px; padding: 10px 14px; font: inherit; color: var(--text);
  background: #fff; border: 1.5px solid transparent; border-radius: 12px;
}
.calc-lead input.invalid { border-color: #ff8a8a; }
.calc-lead .form-status { color: #fff; min-height: 1.4em; }
.calc-lead .form-status.ok { color: var(--accent); }
.calc-lead .form-status.err { color: #ffb3b3; }
.calc-lead .form-note { color: rgba(255,255,255,.7); }

.calc-price-text { font-size: 1.7rem; line-height: 1.25; }
.calc-more { font-size: .9rem; opacity: .9; margin: 0 0 12px; }
.calc-more[hidden] { display: none; }

/* Карточки-ссылки на страницы услуг */
.cards-4 { grid-template-columns: repeat(4, 1fr); }
.card-link { text-decoration: none; color: inherit; display: block; transition: transform .15s ease, box-shadow .2s ease; }
.card-link:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(26,43,92,.16); }
.card-link .more { display: inline-block; margin-top: 12px; color: var(--accent-dark); font-weight: 600; }
@media (max-width: 960px) { .cards-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .cards-4 { grid-template-columns: 1fr; } }

/* Согласие в форме заявки */
.consent { display: flex; align-items: flex-start; gap: 10px; font-size: .85rem; line-height: 1.4; color: #fff; cursor: pointer; }
.consent input { width: 20px; height: 20px; margin-top: 1px; flex: none; accent-color: var(--accent); }
.consent a, .calc-lead .form-note a { color: var(--accent); }

/* Ссылки в подвале */
.footer-links { display: grid; gap: 6px; align-content: start; }
.footer-links a { color: #cfd6ea; text-decoration: none; }
.footer-links a:hover { color: #fff; text-decoration: underline; }

/* Уведомление о cookie */
.cookie {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 900;
  max-width: 760px; margin: 0 auto; padding: 14px 18px;
  display: flex; align-items: center; gap: 16px;
  background: #fff; color: var(--text); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 10px 34px rgba(0,0,0,.2); font-size: .9rem;
}
.cookie[hidden] { display: none; }
.cookie p { margin: 0; }
.cookie .btn { min-height: 40px; padding: 8px 20px; flex: none; }
@media (max-width: 640px) {
  .cookie { bottom: 84px; flex-direction: column; align-items: stretch; gap: 10px; }
}

/* Страницы услуг и политика */
.hero-single .hero-inner { grid-template-columns: 1fr; }
.hero-single { padding: 56px 0 52px; }
.crumbs { font-size: .9rem; opacity: .85; margin-bottom: 14px; }
.crumbs a { color: var(--accent); text-decoration: none; }
.checklist-wide { max-width: 820px; margin: 0 auto; }
.note-block { max-width: 820px; margin: 24px auto 0; padding: 16px 20px; background: #fff; border-left: 4px solid var(--accent); border-radius: 8px; color: var(--muted); }
.cta-band { text-align: center; }
.cta-band p { color: var(--muted); }
.cta-actions { justify-content: center; }
.prose h1 { margin-bottom: .8em; }
.prose h2 { font-size: 1.25rem; margin: 1.6em 0 .5em; }
.prose p, .prose li { color: var(--text); }
.prose ul { padding-left: 1.2em; }
