/* ═══════════════════════════════════════════════════════════
   Сайт строителя каркасных домов — стили
   Принципы: читаемый текст 16px+, крупные кнопки под палец,
   никаких анимаций, мешающих чтению. Целевая аудитория 35+.
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg:        #f7f6f3;
  --surface:   #ffffff;
  --surface-2: #f0ede7;
  --ink:       #1d2129;
  --ink-soft:  #5a6270;
  --muted:     #8b93a1;
  --line:      #e2ded6;
  --brand:     #1f3864;
  --brand-2:   #2b4c85;
  --accent:    #c1741f;
  --accent-2:  #e19a45;
  --ok:        #1e7b34;
  --warn:      #9a6b00;
  --radius:    14px;
  --radius-sm: 10px;
  --shadow:    0 2px 8px rgba(29, 33, 41, .06);
  --shadow-lg: 0 8px 28px rgba(29, 33, 41, .10);
  --maxw:      1160px;
}

* { box-sizing: border-box; }

/* Тексты приходят из админки, и владелец может вписать длинное слово —
   адрес, название посёлка в одно слово. Без этого правила такой текст
   растягивает страницу и появляется горизонтальная прокрутка на телефоне. */
body { overflow-wrap: break-word; }
img, table, pre { max-width: 100%; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; color: var(--ink); }
h1 { font-size: clamp(28px, 4vw, 44px); letter-spacing: -.5px; }
h2 { font-size: clamp(23px, 2.6vw, 32px); }
h3 { font-size: 19px; }

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

/* ─────────── ШАПКА ─────────── */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex; align-items: center; gap: 24px;
  min-height: 72px;
}

.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.logo:hover { text-decoration: none; }

.logo-mark {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  background: var(--brand); color: #fff;
  border-radius: 12px; font-weight: 800; font-size: 17px;
}

.logo-text b { display: block; font-size: 16px; line-height: 1.2; }
.logo-text small { display: block; font-size: 12.5px; color: var(--muted); }

.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { color: var(--ink-soft); font-size: 15.5px; font-weight: 500; }
.nav a:hover { color: var(--brand); text-decoration: none; }

.header-contacts { display: flex; align-items: center; gap: 16px; }

.header-phone {
  font-weight: 700; font-size: 17px; color: var(--ink); white-space: nowrap;
}
.header-phone:hover { color: var(--brand); text-decoration: none; }

/* ─────────── КНОПКИ ─────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px; border-radius: var(--radius-sm);
  border: 2px solid transparent; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 16px;
  text-decoration: none; transition: background .15s, border-color .15s, transform .1s;
  min-height: 48px;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #a96217; }

.btn-ghost { background: transparent; color: var(--brand); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); background: #f4f6fa; }

.btn-small { padding: 10px 16px; font-size: 15px; min-height: 42px; }
.btn-lg { padding: 16px 28px; font-size: 17px; min-height: 54px; }
.btn-block { width: 100%; }

/* ─────────── ПЕРВЫЙ ЭКРАН ─────────── */
.hero { background: linear-gradient(180deg, #fff 0%, var(--bg) 100%); padding: 48px 0 40px; }

.hero-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: center;
}

.badge {
  display: inline-block; padding: 7px 14px; margin-bottom: 18px;
  background: #eaf1e8; color: var(--ok);
  border-radius: 999px; font-size: 14px; font-weight: 600;
}

.hero .lead { font-size: 18.5px; color: var(--ink-soft); margin: 0 0 26px; }

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; }

.hero-points { list-style: none; margin: 0; padding: 0; }
.hero-points li {
  position: relative; padding-left: 28px; margin-bottom: 10px;
  color: var(--ink-soft); font-size: 16px;
}
.hero-points li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  color: var(--ok); font-weight: 800;
}

.hero-media { position: relative; }
.hero-media img {
  border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%;
  aspect-ratio: 3 / 2; object-fit: cover;
}
.hero-media-note {
  margin-top: 10px; font-size: 13px; color: var(--muted); text-align: center;
}

/* Телефон прямо в первом экране: часть людей не листает, а звонит сразу */
.hero-phone { margin-top: 22px; font-size: 16px; color: var(--ink-soft); }
.hero-phone a { font-size: 21px; font-weight: 800; color: var(--ink); white-space: nowrap; }

/* ─────────── ЦИФРЫ ─────────── */
.stats { background: var(--brand); color: #fff; padding: 30px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center; }
.stat b { display: block; font-size: clamp(24px, 3vw, 34px); font-weight: 800; }
.stat span { font-size: 14.5px; opacity: .85; }

/* Честная оговорка к ценам: снимает спор «вы обещали дешевле» */
.price-note {
  max-width: 720px; margin: 0 auto 26px; padding: 14px 18px;
  background: #fff8e6; border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm); color: var(--ink-soft); font-size: 15px;
}

/* ─────────── СТРАНИЦЫ ОШИБОК ─────────── */
.error-page { text-align: center; padding: 20px 0 40px; }
.error-code {
  font-size: clamp(64px, 14vw, 120px); font-weight: 800; line-height: 1;
  color: var(--line); margin-bottom: 8px;
}
.error-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 26px 0; }
.error-phone { font-size: 16px; color: var(--ink-soft); }
.error-phone a { font-size: 20px; font-weight: 800; color: var(--ink); }

/* ─────────── ПОМЕТКА «ЭТО ПРИМЕР» ─────────── */
/* Работа из демонстрационного набора: фото не от этого объекта. Показываем
   честно, чтобы не было претензии по закону о рекламе. Владелец удаляет
   такие работы одной кнопкой, когда заливает свои. */
.demo-note {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 8px 0 0; padding: 8px 14px;
  background: #fff4e0; border: 1px dashed var(--accent);
  border-radius: var(--radius-sm); color: #7a4a05; font-size: 14px;
}
.work .demo-note, .project-desc .demo-note { margin-top: 12px; }

/* ─────────── СЕКЦИИ ─────────── */
.section { padding: 60px 0; }
.section-alt { background: var(--surface-2); }
.section-cta { background: var(--brand); color: #fff; }
.section-cta h2, .section-cta .section-lead { color: #fff; }

.section-lead { color: var(--ink-soft); max-width: 680px; margin: 0 0 32px; font-size: 17px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
.link-more { font-weight: 600; white-space: nowrap; }

/* ─────────── КАРТОЧКИ УСЛУГ ─────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.card h3 { margin-bottom: 10px; }
.card p { color: var(--ink-soft); margin: 0 0 16px; font-size: 15.5px; }
.card-price { font-size: 21px; font-weight: 800; color: var(--brand); }
.card-price small { font-size: 14px; font-weight: 500; color: var(--muted); }

/* ─────────── ГАЛЕРЕЯ РАБОТ ─────────── */
.works { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }

.work {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}

.work-photo { display: block; background: var(--surface-2); }
.work-photo img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }

.work-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.work-body h3 { margin: 0; font-size: 18px; }

.work-specs {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--ink-soft);
}
.work-specs li {
  background: var(--surface-2); padding: 4px 10px; border-radius: 6px;
}

.work-price { font-weight: 800; color: var(--brand); font-size: 18px; }
.work-want { margin-top: auto; }

.empty-state {
  background: var(--surface); border: 1px dashed var(--line);
  border-radius: var(--radius); padding: 32px; text-align: center; color: var(--ink-soft);
}
.empty-state code { background: var(--surface-2); padding: 2px 7px; border-radius: 5px; font-size: 14px; }

/* ─────────── КАЛЬКУЛЯТОР ─────────── */
.calc-wrap { display: grid; grid-template-columns: 1.15fr .85fr; gap: 26px; align-items: start; }

.calc-panel, .calc-result {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow);
}

.field { margin-bottom: 22px; }
.field label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 15.5px; }

input[type="text"], input[type="tel"], input[type="number"],
input[type="email"], input[type="password"], select, textarea {
  width: 100%; padding: 13px 15px; font: inherit; font-size: 16px;
  color: var(--ink); background: #fff;
  border: 2px solid var(--line); border-radius: var(--radius-sm);
  min-height: 50px;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand-2);
}
textarea { resize: vertical; min-height: 90px; }

.range-row { display: grid; grid-template-columns: 1fr 110px; gap: 14px; align-items: center; }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 8px; border-radius: 4px;
  background: var(--line); outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); cursor: pointer; border: 3px solid #fff;
  box-shadow: var(--shadow);
}
input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); cursor: pointer; border: 3px solid #fff;
}

.chips { display: flex; flex-wrap: wrap; gap: 10px; }

.chip {
  padding: 12px 16px; font: inherit; font-size: 15px; font-weight: 500;
  background: #fff; color: var(--ink);
  border: 2px solid var(--line); border-radius: var(--radius-sm);
  cursor: pointer; text-align: left; line-height: 1.3;
  min-height: 48px;
}
.chip small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.chip:hover { border-color: var(--brand-2); }
.chip.is-active { border-color: var(--accent); background: #fdf6ee; color: var(--brand); }

.calc-more { margin: 6px 0 22px; border-top: 1px solid var(--line); padding-top: 16px; }
.calc-more summary {
  cursor: pointer; font-weight: 600; color: var(--brand-2);
  font-size: 15.5px; padding: 6px 0; list-style: none;
}
.calc-more summary::-webkit-details-marker { display: none; }
.calc-more summary::before { content: "＋ "; font-weight: 700; }
.calc-more[open] summary::before { content: "− "; }
.calc-more-body { padding-top: 18px; }

/* результат */
.result-head { font-size: 14.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.result-sum {
  font-size: clamp(26px, 3.4vw, 38px); font-weight: 800;
  color: var(--brand); margin: 6px 0 8px; line-height: 1.15;
}
.result-note { font-size: 14.5px; color: var(--ink-soft); margin-bottom: 20px; }

.result-table { width: 100%; border-collapse: collapse; font-size: 15px; margin-bottom: 16px; }
.result-table td { padding: 9px 0; border-bottom: 1px solid var(--line); }
.result-table td:last-child { text-align: right; font-weight: 600; white-space: nowrap; }
.result-table tr:last-child td { border-bottom: none; }

.result-warnings { font-size: 14.5px; color: var(--warn); margin-bottom: 16px; }
.result-warnings p { margin: 0 0 6px; padding-left: 20px; position: relative; }
.result-warnings p::before { content: "!⃝"; position: absolute; left: 0; }

.result-cta { border-top: 1px solid var(--line); padding-top: 20px; }
.result-cta p { margin: 0 0 6px; }
.result-cta .small { font-size: 14.5px; color: var(--ink-soft); margin-bottom: 16px; }

/* ─────────── ПРОЦЕСС ─────────── */
/* Слева шаги, справа фото со стройки: текст читается, а кадр подтверждает,
   что человек действительно строит, а не пересказывает чужой опыт. */
.process-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 40px; align-items: start; }
.process { display: grid; gap: 16px; }

.process-step {
  display: grid; grid-template-columns: 46px 1fr; gap: 16px; align-items: start;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px;
}
.process-num {
  width: 46px; height: 46px; flex: none;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 800; font-size: 18px;
}
.process-step p { margin: 8px 0 0; color: var(--ink-soft); }

.process-photo img {
  width: 100%; border-radius: var(--radius); box-shadow: var(--shadow-lg);
  position: sticky; top: 96px;
}

/* ─────────── О МАСТЕРЕ ─────────── */
.about-grid { display: grid; grid-template-columns: 380px 1fr; gap: 44px; align-items: start; }
.about-photo img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.about-text p { color: var(--ink-soft); }
.about-signature { margin-top: 20px; color: var(--ink); }
.guarantee { background: #eaf1e8; border-left: 4px solid var(--ok); padding: 14px 18px; border-radius: var(--radius-sm); color: var(--ink); }

/* ─────────── ОТЗЫВЫ ─────────── */
.review .stars { color: var(--accent); font-size: 18px; letter-spacing: 2px; margin-bottom: 10px; }
.review-author { font-weight: 600; color: var(--ink); margin-top: 12px; }

/* ─────────── FAQ ─────────── */
.faq { display: grid; gap: 10px; }

.faq-item {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); overflow: hidden;
}
.faq-item summary {
  cursor: pointer; padding: 18px 20px; font-weight: 600; font-size: 16.5px;
  list-style: none; position: relative; padding-right: 48px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  font-size: 22px; font-weight: 400; color: var(--brand-2);
}
.faq-item[open] summary::after { content: "−"; }
.faq-answer { padding: 0 20px 20px; color: var(--ink-soft); }

/* ─────────── ФОРМА ЗАЯВКИ ─────────── */
.lead-form { background: var(--surface); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-lg); color: var(--ink); }
.lead-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.req { color: var(--accent); }

.checkbox { display: flex; gap: 12px; align-items: flex-start; margin: 4px 0 22px; font-size: 14.5px; color: var(--ink-soft); cursor: pointer; }
.checkbox input { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--accent); }

.form-note { font-size: 14px; color: var(--muted); text-align: center; margin: 14px 0 0; }

.form-msg { margin-top: 16px; padding: 14px 18px; border-radius: var(--radius-sm); font-size: 15.5px; }
.form-msg.ok { background: #eaf1e8; color: #14571f; border-left: 4px solid var(--ok); }
.form-msg.err { background: #fdeceb; color: #8a1f16; border-left: 4px solid #c0392b; }

/* ─────────── ПОДВАЛ ─────────── */
.footer { background: #14181f; color: #c9cfd8; padding: 44px 0 24px; margin-top: 20px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px; }
.footer b { color: #fff; display: block; margin-bottom: 10px; }
.footer p { margin: 0 0 8px; font-size: 15px; }
.footer a { color: #c9cfd8; }
.footer a:hover { color: #fff; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.footer-bottom {
  margin-top: 28px; padding-top: 20px; border-top: 1px solid #262c36;
  display: flex; flex-wrap: wrap; gap: 8px 24px;
  align-items: baseline; justify-content: space-between;
}
/* Сноска о поддержке: тише основного текста, но кликабельная */
.footer-credit { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.footer-credit a { color: #9aa4b2; border-bottom: 1px solid #3a4250; }
.footer-credit a:hover { color: #fff; }

/* ─────────── COOKIE ─────────── */
.cookie { position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 20px rgba(0,0,0,.08); }
.cookie-inner { max-width: var(--maxw); margin: 0 auto; padding: 16px 20px; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.cookie p { margin: 0; flex: 1 1 380px; font-size: 14.5px; color: var(--ink-soft); }
.cookie-actions { display: flex; gap: 10px; }

/* ─────────── АДАПТИВ ─────────── */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .hero-media { order: -1; }
  .calc-wrap { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; gap: 26px; }
  .about-photo { max-width: 380px; }
  .process-grid { grid-template-columns: 1fr; gap: 26px; }
  .process-photo img { position: static; }
  .nav { display: none; }
}

@media (max-width: 700px) {
  body { font-size: 16px; }
  .section { padding: 44px 0; }
  .header-inner { min-height: 64px; gap: 12px; }
  .logo-text small { display: none; }
  .header-contacts { gap: 10px; margin-left: auto; }
  .header-phone { font-size: 15.5px; }
  .header-contacts .btn { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .lead-grid { grid-template-columns: 1fr; }
  .range-row { grid-template-columns: 1fr 86px; gap: 10px; }
  .hero-actions .btn { width: 100%; }
  .calc-panel, .calc-result, .lead-form { padding: 20px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .cookie-inner { padding: 14px 16px; }
  .cookie-actions { width: 100%; }
  .cookie-actions .btn { flex: 1; }
}

@media print {
  .header, .footer, .cookie, .calc-panel { display: none; }
}
