/* ============================================================
   «Ключ на Дону» - лендинг частного риелтора по новостройкам.
   Тёплая семейная палитра: сливочный фон, терракота - действие,
   олива - спокойные акценты. Заголовки Lora (тёплая антиква),
   текст Onest. Всё считается от телефона: покупатели квартир
   приходят в основном с него.
   ============================================================ */
:root{
  --bg: #FAF5EE;
  --bg-2: #F3EADF;
  --card: #FFFDF9;
  --ink: #2B231D;
  --ink-2: #5E534B;
  --ink-3: #8A7E74;
  --line: #E7DCCF;
  --acc: #B85A35;        /* терракота - кнопки и знак */
  --acc-2: #9C4826;
  --olive: #5E6B3F;
  --olive-soft: #E6E8D8;
  --radius: 18px;
  --pad: clamp(16px, 4vw, 48px);
  --maxw: 1180px;
  --serif: "Lora", Georgia, serif;
  --sans: "Onest", -apple-system, "Segoe UI", Roboto, sans-serif;
}
*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; scroll-padding-top: 80px; }
body{
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
h1, h2, h3{ font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: -.01em; text-wrap: balance; }
h1{ font-size: clamp(34px, 5.2vw, 60px); }
h2{ font-size: clamp(27px, 3.4vw, 40px); }
p{ margin: 0; }
a{ color: inherit; }
img{ max-width: 100%; display: block; }
.wrap{ width: 100%; max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad); }
section{ padding-block: clamp(56px, 8vw, 104px); }
.eyebrow{ font-size: 14px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--olive); margin-bottom: 12px; }
.lead{ font-size: clamp(18px, 1.6vw, 20px); color: var(--ink-2); }
.muted{ color: var(--ink-3); font-size: 15px; margin-top: 16px; }
:focus-visible{ outline: 3px solid var(--acc); outline-offset: 3px; border-radius: 6px; }

/* Заглушки: всё, что заказчица должна дать сама, подсвечено - чтобы
   ни одна выдуманная цифра не выглядела настоящей. */
.ph-mark{ background: #FCE9C8; border-radius: 6px; padding: 0 6px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

/* ---------- кнопки ---------- */
.btn{
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 26px; border-radius: 999px; border: 2px solid transparent;
  font: 600 17px/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: background .2s, transform .2s, border-color .2s, color .2s;
}
.btn-main{ background: var(--acc); color: #fff; }
.btn-main:hover{ background: var(--acc-2); transform: translateY(-1px); }
.btn-line{ border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-line:hover{ background: var(--ink); color: var(--bg); }
.btn-icon{ width: 52px; padding: 0; background: var(--card); border-color: var(--line); color: var(--acc); }

/* ---------- шапка ---------- */
.top{ position: sticky; top: 0; z-index: 20; background: rgba(250,245,238,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in{ display: flex; align-items: center; gap: 24px; min-height: 68px; }
.brand{ display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-txt{ display: flex; flex-direction: column; line-height: 1.15; }
.brand-txt b{ font-family: var(--serif); font-size: 21px; }
.brand-txt small{ font-size: 12.5px; color: var(--ink-3); }
.top-nav{ display: flex; gap: 22px; margin-left: auto; }
.top-nav a{ text-decoration: none; color: var(--ink-2); font-size: 15.5px; }
.top-nav a:hover{ color: var(--acc); }
.top-tel{ font-weight: 600; text-decoration: none; white-space: nowrap; }
@media (max-width: 960px){ .top-nav{ display: none; } .top-tel{ margin-left: auto; } }
/* на телефоне звонок - в нижней кнопке, номер в шапке только ломал название на две строки */
@media (max-width: 560px){ .brand-txt small, .top-tel{ display: none; } }

/* ---------- фото-заглушки ---------- */
.ph{
  position: relative; margin: 0; border-radius: var(--radius); overflow: hidden;
  aspect-ratio: var(--ar, 4/3);
  background:
    radial-gradient(120% 90% at 20% 15%, #F6D9B9 0%, transparent 60%),
    radial-gradient(90% 80% at 85% 90%, #D9DEC2 0%, transparent 60%),
    linear-gradient(135deg, #EED8C1, #E3E1CC);
}
.ph img{ position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s; }
.ph.has-img img{ opacity: 1; }
.ph figcaption{
  position: absolute; left: 14px; bottom: 14px; right: 14px;
  font-size: 13.5px; color: var(--ink-2); background: rgba(255,253,249,.82);
  padding: 6px 10px; border-radius: 10px; width: fit-content;
}
.ph.has-img figcaption{ display: none; }
.ph-person{ background: linear-gradient(160deg, #EBDCCB, #DCD9C3); }
.ph-person::before{
  content: ""; position: absolute; left: 50%; top: 22%; width: 34%; aspect-ratio: 1; border-radius: 50%;
  transform: translateX(-50%); background: rgba(255,253,249,.55);
}
.ph-person::after{
  content: ""; position: absolute; left: 50%; bottom: -8%; width: 70%; height: 44%; border-radius: 50% 50% 0 0;
  transform: translateX(-50%); background: rgba(255,253,249,.55);
}

/* ---------- главный экран ---------- */
.hero{ padding-top: clamp(28px, 5vw, 64px); }
.hero-in{ display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero-txt{ display: flex; flex-direction: column; gap: 20px; }
.hero-txt .lead b{ color: var(--ink); }
.hero-cta{ display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.hero-facts{ list-style: none; margin: 10px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.hero-facts li{ display: flex; flex-direction: column; gap: 2px; }
.hero-facts b{ font-family: var(--serif); font-size: 22px; color: var(--acc); }
.hero-facts span{ font-size: 14px; color: var(--ink-3); line-height: 1.35; }
@media (max-width: 860px){
  .hero-in{ grid-template-columns: 1fr; }
  .hero-pic{ order: -1; --ar: 4/3 !important; }
}
@media (max-width: 480px){ .hero-cta .btn{ flex: 1 1 100%; } .hero-facts b{ font-size: 18px; } }

/* ---------- почему бесплатно ---------- */
.free{ background: var(--olive); color: #FBF8F1; }
.free-head{ display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: center; margin-bottom: 32px; }
.free-head h2{ margin-bottom: 16px; }
.free-head p{ color: #ECEADF; font-size: clamp(17px, 1.5vw, 19px); }
@media (max-width: 860px){ .free-head{ grid-template-columns: 1fr; } }
.free-grid{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.free-card{ background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.free-card .num{ font-family: var(--serif); font-size: 30px; color: #F2C79C; line-height: 1; }
.free-card p{ color: #ECEADF; }
@media (max-width: 860px){ .free-grid{ grid-template-columns: 1fr; } }

/* ---------- шаги ---------- */
.steps h2{ max-width: 22ch; margin-bottom: 36px; }
.steps-list{ list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: s; }
.steps-list li{ counter-increment: s; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 24px; display: flex; flex-direction: column; gap: 8px; }
.steps-list li::before{ content: counter(s, decimal-leading-zero); font-family: var(--serif); font-size: 15px; color: var(--acc); }
.steps-list b{ font-family: var(--serif); font-size: 22px; font-weight: 600; }
.steps-list p{ color: var(--ink-2); font-size: 16px; }
@media (max-width: 960px){ .steps-list{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px){ .steps-list{ grid-template-columns: 1fr; } }

.band{ border-radius: 0; width: 100%; }
@media (max-width: 600px){ .band{ --ar: 16/9 !important; } }

/* ---------- квиз ---------- */
.quiz-sec{ background: var(--bg-2); }
.quiz-wrap{ display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(24px, 4vw, 56px); align-items: start; }
.quiz-head{ display: flex; flex-direction: column; gap: 14px; position: sticky; top: 100px; }
.quiz-head p:last-child{ color: var(--ink-2); }
@media (max-width: 860px){ .quiz-wrap{ grid-template-columns: 1fr; } .quiz-head{ position: static; } }
.quiz{ background: var(--card); border-radius: 24px; padding: clamp(20px, 3vw, 34px); box-shadow: 0 18px 50px rgba(92,64,40,.10); min-height: 420px; display: flex; flex-direction: column; gap: 20px; }
.q-progress{ display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--ink-3); }
.q-bar{ flex: 1; height: 6px; border-radius: 6px; background: var(--bg-2); overflow: hidden; }
.q-bar i{ display: block; height: 100%; background: var(--acc); border-radius: 6px; transition: width .35s; }
.q-title{ font-family: var(--serif); font-size: clamp(22px, 2.4vw, 28px); font-weight: 600; line-height: 1.2; }
.q-hint{ color: var(--ink-3); font-size: 15px; margin-top: -10px; }
.q-opts{ display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 10px; }
.q-opt{
  display: flex; align-items: center; gap: 12px; padding: 15px 16px; border-radius: 14px;
  border: 2px solid var(--line); background: var(--bg); cursor: pointer; font: 500 16.5px/1.3 var(--sans); color: var(--ink); text-align: left;
  transition: border-color .2s, background .2s;
}
.q-opt:hover{ border-color: #D9BFA6; }
.q-opt.on{ border-color: var(--acc); background: #FBEFE6; }
.q-opt .box{ flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #CDBBA9; display: grid; place-items: center; }
.q-opt.multi .box{ border-radius: 6px; }
.q-opt.on .box{ border-color: var(--acc); background: var(--acc); }
.q-opt.on .box::after{ content: ""; width: 8px; height: 8px; border-radius: inherit; background: #fff; }
.q-nav{ display: flex; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 8px; }
.q-back{ background: none; border: 0; color: var(--ink-3); font: 500 16px var(--sans); cursor: pointer; padding: 0 4px; }
.q-back[hidden]{ visibility: hidden; display: block; }
.q-fields{ display: grid; gap: 12px; }
.q-done{ text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; flex: 1; }
.q-done .ok{ width: 64px; height: 64px; border-radius: 50%; background: var(--olive-soft); display: grid; place-items: center; color: var(--olive); font-size: 30px; }

/* ---------- поля ---------- */
label{ display: flex; flex-direction: column; gap: 6px; font-size: 15px; color: var(--ink-2); }
input, textarea{
  font: 400 17px/1.4 var(--sans); color: var(--ink); background: var(--card);
  border: 2px solid var(--line); border-radius: 12px; padding: 13px 14px; width: 100%;
}
input:focus, textarea:focus{ outline: none; border-color: var(--acc); }
label.consent{ flex-direction: row; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--ink-3); }
label.consent input{ width: 20px; height: 20px; flex: none; margin: 1px 0 0; accent-color: var(--acc); }
.err{ color: #B3261E; font-size: 14.5px; }

/* ---------- ипотека ---------- */
.mort-in, .about-in, .lead-in{ display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.mort-in > div, .about-in > div{ display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.mort p:not(.eyebrow){ color: var(--ink-2); }
.ticks{ list-style: none; margin: 4px 0 8px; padding: 0; display: grid; gap: 10px; }
.ticks li{ position: relative; padding-left: 32px; }
.ticks li::before{ content: ""; position: absolute; left: 0; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--olive-soft) url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 20 20%22%3E%3Cpath d=%22M5 10.5l3 3 7-7%22 fill=%22none%22 stroke=%22%235E6B3F%22 stroke-width=%222.2%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E%3C/svg%3E') center/16px no-repeat; }
@media (max-width: 860px){ .mort-in, .about-in, .lead-in{ grid-template-columns: 1fr; } }

/* ---------- обо мне ---------- */
.about{ background: var(--card); }
.about-pic{ max-width: 460px; }
.about-facts{ list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px 28px; }
.about-facts li{ display: flex; flex-direction: column; }
.about-facts b{ font-family: var(--serif); font-size: 24px; }
.about-facts span{ font-size: 14px; color: var(--ink-3); }

/* ---------- отзывы ---------- */
.reviews h2{ margin-bottom: 28px; }
.rev-grid{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.ph-box{ border: 2px dashed #D8C7B5; border-radius: var(--radius); aspect-ratio: 4/5; display: grid; place-items: center; text-align: center; padding: 20px; color: var(--ink-3); background: var(--card); }
@media (max-width: 760px){ .rev-grid{ grid-template-columns: 1fr 1fr; } .rev-grid .rev:last-child{ display: none; } }

/* ---------- вопросы ---------- */
.faq{ background: var(--bg-2); }
.faq-in{ display: grid; grid-template-columns: .7fr 1.3fr; gap: clamp(24px, 4vw, 56px); }
@media (max-width: 860px){ .faq-in{ grid-template-columns: 1fr; } }
.faq-list{ display: grid; gap: 10px; }
.faq details{ background: var(--card); border-radius: 14px; border: 1px solid var(--line); }
.faq summary{ list-style: none; cursor: pointer; padding: 18px 52px 18px 20px; font-weight: 600; position: relative; }
.faq summary::-webkit-details-marker{ display: none; }
.faq summary::after{ content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 26px; font-weight: 400; color: var(--acc); transition: transform .2s; }
.faq details[open] summary::after{ transform: translateY(-50%) rotate(45deg); }
.faq details p{ padding: 0 20px 20px; color: var(--ink-2); }

/* ---------- форма ---------- */
.lead-form{ background: var(--card); border-radius: 24px; padding: clamp(22px, 3vw, 36px); box-shadow: 0 18px 50px rgba(92,64,40,.10); display: flex; flex-direction: column; gap: 14px; }
.lead-form > p{ color: var(--ink-2); }
.lead-form .btn{ align-self: flex-start; }
.form-msg{ font-size: 15px; }

/* ---------- подвал ---------- */
.foot{ background: var(--ink); color: #D9CFC5; padding-block: 40px 110px; }
.foot-in{ display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.foot b{ font-family: var(--serif); font-size: 20px; color: #fff; }
.foot p{ font-size: 14.5px; margin-top: 4px; }
.foot .ph-mark{ background: #5A4A3C; }
.foot-links{ display: flex; flex-direction: column; gap: 6px; }
.foot-links a{ text-decoration: none; }
/* значки мессенджеров (те же, что на pokraska-apl.ru): надписи «Telegram» и «MAX» смотрелись хуже */
.foot-msgs{ display: flex; gap: 12px; margin: 4px 0; }
.foot-msgs .msg{ display: block; width: 40px; height: 40px; border-radius: 10px; transition: transform .15s; }
.foot-msgs .msg:hover{ transform: translateY(-2px); }
.foot-msgs img{ display: block; width: 100%; height: 100%; }

/* ---------- нижняя кнопка на телефоне ---------- */
.sticky-cta{ display: none; }
@media (max-width: 760px){
  .sticky-cta{
    display: flex; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(250,245,238,.95);
    border-top: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  }
  .sticky-cta .btn-main{ flex: 1; }
  .foot{ padding-bottom: 120px; }
}


@media (prefers-reduced-motion: reduce){ *{ transition: none !important; scroll-behavior: auto !important; } }
.btn:disabled{ opacity: .45; cursor: not-allowed; transform: none; }

/* ---------- места под кадры 2-4 (15.10) ---------- */
.steps-head{ display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(24px, 4vw, 56px); align-items: center; margin-bottom: 36px; }
.steps-head h2{ margin-bottom: 16px; }
.steps .steps-head h2{ margin-bottom: 16px; }
.quiz-pic{ margin-top: 10px; }
.faq-head{ display: flex; flex-direction: column; gap: 24px; align-self: start; position: sticky; top: 100px; }
@media (max-width: 860px){
  .steps-head{ grid-template-columns: 1fr; }
  .faq-head{ position: static; }
  .quiz-pic, .faq-head .ph{ display: none; }   /* на телефоне не растягиваем страницу лишними кадрами */
}
/* главный кадр: семья стоит правее центра - в узкой рамке держим её в кадре */
.hero-pic img{ object-position: 68% 50%; }

/* 320 px (20.10): страница вылезала вбок на 27 px - две колонки заглушек отзывов
   не сжимались ниже ширины текста, а кнопка в нижней панели - ниже своих отступов. */
.rev-grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px){ .rev-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 400px){ .ph-box{ padding: 12px; font-size: 14px; } }
.sticky-cta .btn-main{ min-width: 0; }
@media (max-width: 360px){ .sticky-cta .btn-main{ padding-inline: 14px; font-size: 16px; } }

/* ловушка для ботов в формах: человеку не видна и не доступна с клавиатуры */
.trap{ position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.ph-person.has-img::before, .ph-person.has-img::after{ display: none; }   /* силуэт-заглушка не должен лечь поверх настоящего фото */

/* ---------- галерея «С моих показов» (20.10) ---------- */
.gal-sec{ background: var(--bg); }
.gal-sec h2{ max-width: 22ch; }
.gal-lead{ margin: 14px 0 28px; max-width: 60ch; }
.gal{ display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 12px; }
.gal-item{ position: relative; display: block; aspect-ratio: 4/3; border-radius: 14px; overflow: hidden; background: var(--bg-2); }
.gal-item img{ width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
/* подпись видна всегда: наведения на телефоне нет */
.gal-item span{ position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 12px 10px; font-size: 14px; color: #fff;
  background: linear-gradient(transparent, rgba(30,22,16,.62)); line-height: 1.3; }
@media (hover: hover){ .gal-item:hover img{ transform: scale(1.04); } }
@media (max-width: 480px){ .gal{ grid-template-columns: 1fr 1fr; gap: 8px; } .gal-item span{ font-size: 12.5px; padding: 18px 8px 7px; } }

/* окно просмотра поверх страницы */
.lb{ position: fixed; inset: 0; z-index: 100; background: rgba(20,15,11,.94); display: none;
  align-items: center; justify-content: center; padding: 56px 16px 64px; cursor: zoom-out; }
.lb.open{ display: flex; }
.lb img{ max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.lb-cap{ position: absolute; left: 16px; right: 16px; bottom: 18px; text-align: center; color: #EFE6DC; font-size: 15px; }
.lb-btn{ position: absolute; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.14); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
.lb-btn:hover{ background: rgba(255,255,255,.26); }
.lb-close{ top: 10px; right: 10px; }
.lb-prev{ left: 10px; top: 50%; transform: translateY(-50%); }
.lb-next{ right: 10px; top: 50%; transform: translateY(-50%); }
.lb-count{ position: absolute; top: 22px; left: 18px; color: #CFC3B6; font-size: 14px; }
@media (max-width: 600px){ .lb-prev, .lb-next{ top: auto; bottom: 50px; transform: none; } .lb{ padding-bottom: 110px; } }
html.lb-lock, body.lb-lock{ overflow: hidden; }
/* первый снимок крупный (2x2): 13 снимков + 3 клетки = 4 полных ряда, без одинокого кадра внизу */
@media (min-width: 700px){ .gal-item:first-child{ grid-column: span 2; grid-row: span 2; aspect-ratio: auto; } .gal-item:first-child span{ font-size: 16px; } }

/* ---------- мессенджеры в шапке и в нижней панели (21.10) ----------
   В шапке - рядом с телефоном, на компьютере и планшете. На телефоне шапка
   узкая, там значки стоят в нижней панели рядом со звонком, и подпись главной
   кнопки укорачивается до «Подобрать», иначе на 320 px она не помещается. */
.top-msgs{ display: flex; gap: 8px; }
/* 22.10: мельче и слегка приглушены под тёплую шапку (полная тонировка выглядела «печально») - яркие фирменные цвета
   перетягивали взгляд с названия и телефона; цвет возвращается под мышью
   и при фокусе с клавиатуры. */
.top-msgs .msg{ display: block; width: 24px; height: 24px; border-radius: 6px;
  filter: saturate(.5) sepia(.15) opacity(.85); transition: filter .2s, transform .15s; }
.top-msgs .msg:hover, .top-msgs .msg:focus-visible{ filter: none; transform: translateY(-1px); }
.top-msgs img{ display: block; width: 100%; height: 100%; }
@media (max-width: 760px){ .top-msgs{ display: none; } .top-tel{ display: none; } }
.sc-msg img{ width: 30px; height: 30px; border-radius: 8px; }
@media (max-width: 760px){ .sticky-cta{ gap: 8px; } }
@media (max-width: 480px){
  .sc-long{ display: none; }
  .sticky-cta .btn-icon{ width: 48px; }
}
@media (max-width: 360px){ .sticky-cta .btn-icon{ width: 44px; min-height: 48px; } .sc-msg img{ width: 26px; height: 26px; } }
