/* MyHomeGroup — общие стили сайта.
   Макет: поток секций шириной 1180, внутри гибкие ряды и сетки.
   Акцент один — золото знака; остальное холодные нейтрали. */

:root {
  --bg: #F4F5F7;
  --surface: #FFFFFF;
  --surface-2: #EAECEF;
  --ink: #15181C;
  --muted: #5A626B;
  --line: #DCDFE4;
  --gold: #8C6A24;
  --gold-soft: #F2E7CF;
  --deep: #1B2026;

  --display: 'Bricolage Grotesque', 'Trebuchet MS', sans-serif;
  --body: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101316;
    --surface: #171B20;
    --surface-2: #1F252B;
    --ink: #F0F2F4;
    --muted: #A2ABB4;
    --line: #2A3137;
    --gold: #D7AF63;
    --gold-soft: #2A2316;
    --deep: #0B0E11;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #101316;
  --surface: #171B20;
  --surface-2: #1F252B;
  --ink: #F0F2F4;
  --muted: #A2ABB4;
  --line: #2A3137;
  --gold: #D7AF63;
  --gold-soft: #2A2316;
  --deep: #0B0E11;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--surface);
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }
img { max-width: 100%; }

a { color: var(--gold); }
a:hover { color: var(--ink); }

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.band { padding-block: 88px; }
.band--tight { padding-block: 56px; }
.ruled { border-top: 1px solid var(--line); }

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.lede { font-size: 20px; line-height: 1.6; color: var(--muted); max-width: 62ch; }
h2.sec { font-size: 38px; margin-block: 14px 12px; }

/* — шапка — */
header.site {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.bar { display: flex; align-items: center; gap: 16px 28px; padding-block: 14px; }

.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand-name { font-family: var(--display); font-size: 21px; font-weight: 700; letter-spacing: -0.01em; }

/* Знак с надписью: своя типографика внутри, поэтому рядом ничего не пишем. */
.brand-logo { height: 46px; width: auto; display: block; }
footer.site .brand-logo { height: 38px; }

/* Пункты меню не переносятся по одному: либо строка целиком помещается,
   либо меню уходит на свою строку (см. медиазапрос ниже). Иначе «Контакты»
   отрываются от остальных и шапка выглядит сломанной. */
/* Меню не растягивается и не сжимается: при сжатии его пункты вылезали за
   свою границу и налезали на телефон. Телефон с кнопкой прижаты вправо. */
nav.main { display: flex; flex-wrap: nowrap; gap: 22px; flex: 0 1 auto; }
.bar .phone-num { margin-left: auto; }
nav.main a { color: var(--ink); text-decoration: none; font-size: 16px; white-space: nowrap; }
nav.main a:hover { color: var(--gold); }
nav.main a[aria-current="page"] { color: var(--gold); font-weight: 600; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 4px;
  border: 1px solid transparent;
  font-family: var(--body);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn--solid { background: var(--ink); color: var(--bg); }
.btn--solid:hover { background: var(--gold); color: #15181C; }
.btn--ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn--gold { background: var(--gold); color: #15181C; }
.btn--gold:hover { filter: brightness(1.08); color: #15181C; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

.phone-num { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }

/* — первый экран — */
.hero { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; }
.hero > .col { flex: 1 1 420px; min-width: 0; }
.hero h1 { font-size: clamp(38px, 5.2vw, 62px); margin-block: 18px 20px; }

.facts { display: flex; flex-wrap: wrap; gap: 32px; margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--line); }
.fact-n { font-family: var(--display); font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fact-l { font-size: 15px; color: var(--muted); }

.shot {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 16px;
  max-width: 100%;
}

/* — полоса гарантий — */
.strip { background: var(--deep); color: #EDEFF1; }
.strip .wrap { display: flex; flex-wrap: wrap; gap: 28px; padding-block: 26px; }
.strip .item { display: flex; gap: 12px; align-items: flex-start; flex: 1 1 240px; min-width: 0; }
.strip .item span { font-size: 15px; line-height: 1.5; }
.strip svg { flex-shrink: 0; margin-top: 2px; }

/* — фильтр и объекты — */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-block: 28px 32px; }
.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  min-height: 44px;
  padding: 0 18px;
  font-family: var(--body);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.chip:focus-visible, .btn:focus-visible, a:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.grid-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card .shot { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; height: 190px; }
.card .body { padding: 20px; display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; }
.card .district { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); }
.card h3 { font-size: 20px; }
.card .meta { font-size: 15px; color: var(--muted); }
.card .price-row {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.price { font-family: var(--display); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--gold-soft);
  color: var(--gold);
  padding: 5px 10px;
  border-radius: 3px;
}
.empty { grid-column: 1 / -1; padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 6px; }

/* — шаги — */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 26px; }
.step .num { font-family: var(--display); font-size: 15px; font-weight: 700; color: var(--gold); letter-spacing: 0.08em; }
.step h3 { font-size: 19px; margin-block: 12px 8px; }
.step p { font-size: 15px; color: var(--muted); line-height: 1.6; }

/* — колонки, списки — */
.split { display: flex; flex-wrap: wrap; gap: 56px; }
.split > * { flex: 1 1 400px; min-width: 0; }

.checklist { display: flex; flex-direction: column; gap: 14px; margin-top: 26px; }
.checklist div { display: flex; gap: 12px; align-items: flex-start; font-size: 16px; line-height: 1.5; }
.checklist svg { flex-shrink: 0; margin-top: 4px; }

.points { display: flex; flex-direction: column; gap: 20px; }
.point { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 22px 24px; }
.point h3 { font-size: 18px; margin-bottom: 6px; }
.point p { font-size: 15px; color: var(--muted); }

.cases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.cases .point h3 { font-size: 19px; }

/* — тёмная секция — */
.dark { background: var(--deep); color: #EDEFF1; }
.dark h1, .dark h2, .dark h3 { color: #FFFFFF; }
.dark .lede { color: #AEB6BE; }
.dark .note { color: #8E979F; }

/* — формы — */
.form-card {
  background: #FFFFFF;
  color: #15181C;
  border-radius: 8px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 14px; font-weight: 500; color: #4B5460; }
.field input, .field select, .field textarea {
  font-family: var(--body);
  font-size: 16px;
  color: #15181C;
  background: #FFFFFF;
  border: 1px solid #CFD4DA;
  border-radius: 4px;
  min-height: 50px;
  padding: 12px 14px;
  width: 100%;
}
.field textarea { min-height: 96px; resize: vertical; }
.row2 { display: flex; gap: 16px; flex-wrap: wrap; }
.row2 > * { flex: 1 1 160px; min-width: 0; }
.note { font-size: 13px; color: #6B727C; line-height: 1.5; }
.ok {
  display: none;
  background: #E8F3EC;
  border: 1px solid #BCDCC8;
  color: #1C5B36;
  padding: 14px 16px;
  border-radius: 4px;
  font-size: 15px;
}
.ok[data-shown="1"] { display: block; }

.fail {
  display: none;
  background: #FBE9E7;
  border: 1px solid #E8B4AC;
  color: #8A2B1B;
  padding: 14px 16px;
  border-radius: 4px;
  font-size: 15px;
}
.fail[data-shown="1"] { display: block; }

/* — переключатель «собственник / риелтор» — */
.switch { display: flex; gap: 8px; flex-wrap: wrap; }
.switch-btn {
  flex: 1 1 auto;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 4px;
  font-family: var(--body);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.switch-btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.agent-divider {
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

/* `display: flex` сильнее браузерного правила для [hidden], поэтому скрытие
   задаётся явно — иначе блок риелтора виден и собственнику. */
#agent-block { display: flex; flex-direction: column; gap: 16px; }
#agent-block[hidden] { display: none; }

/* — выбор файлов — */

/* Системная кнопка «Выбрать файл» выглядит чужой на странице и на телефоне
   подписана по-разному. Своя кнопка с плюсом говорит, что делать, и ведёт
   себя одинаково везде. Само поле остаётся на месте — его только не видно,
   поэтому клавиатура и программы чтения с экрана работают как обычно. */
.field-label { font-size: 14px; font-weight: 500; color: var(--muted); }

/* Поле остаётся в разметке и доступно с клавиатуры — его просто не видно.
   Селектор с тегом нужен, чтобы перебить общее правило `.field input`,
   которое растягивает поля на всю ширину: иначе невидимое поле остаётся
   широким и растягивает страницу вбок. */
.field input.file-input,
input.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.filepick {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
}
.filepick:hover { border-color: var(--gold); color: var(--gold); }
.filepick:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.filepick .plus {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gold);
  color: #15181C;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
}

/* — миниатюры фотографий — */
.thumbs { display: flex; flex-wrap: wrap; gap: 12px; }

.thumb {
  position: relative;
  width: 104px;
  height: 104px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.thumb .drop {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: rgba(16, 19, 22, 0.76);
  color: #FFFFFF;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.thumb .drop:hover { background: #B3261E; }

.add-tile {
  width: 104px;
  height: 104px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--body);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}
.add-tile:hover { border-color: var(--gold); color: var(--gold); }
.add-tile:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.add-tile .plus {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
}

/* — карта — */
.map {
  height: 280px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-2);
}
.map iframe { width: 100%; height: 100%; border: 0; display: block; }

/* — список документов — */
.docs { display: flex; flex-direction: column; gap: 8px; }
.docs:empty { display: none; }

.doc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.doc-row svg { flex-shrink: 0; color: var(--gold); }
.doc-row .name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-row .size { font-size: 13px; color: var(--muted); white-space: nowrap; }
.doc-row .drop {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.doc-row .drop:hover { background: var(--surface-2); color: #B3261E; }
input[type="file"] { padding: 12px 14px; }

/* форма на светлом фоне страницы */
.form-plain {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.form-plain label { color: var(--muted); }
.form-plain input, .form-plain select, .form-plain textarea {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
.form-plain .note { color: var(--muted); }

/* — таблица сравнения — */
.table-box { overflow-x: auto; }
table.compare { width: 100%; border-collapse: collapse; min-width: 720px; }
table.compare th {
  text-align: left;
  padding: 16px 20px;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
table.compare th.ours { color: var(--ink); border-bottom: 2px solid var(--gold); background: var(--surface); }
table.compare td { padding: 18px 20px; font-size: 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
table.compare td.k { font-weight: 600; color: var(--ink); }
table.compare td.ours { color: var(--ink); background: var(--surface); }

/* — цифры — */
.numbers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.numbers div { background: var(--surface); padding: 26px 24px; }
.numbers .n { font-family: var(--display); font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; }
.numbers .l { font-size: 15px; color: var(--muted); margin-top: 4px; }

/* — вопросы — */
details { border-bottom: 1px solid var(--line); }
details summary {
  cursor: pointer;
  list-style: none;
  padding-block: 20px;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; font-size: 24px; color: var(--gold); line-height: 1; }
details[open] summary::after { content: "–"; }
details p { padding-bottom: 22px; color: var(--muted); font-size: 16px; max-width: 72ch; }

/* — контакты, подвал — */
.contact-grid { display: flex; flex-wrap: wrap; gap: 48px; }
.contact-grid > * { flex: 1 1 380px; min-width: 0; }
.kv { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }
.kv div { display: flex; gap: 14px; font-size: 17px; }
.kv .k { color: var(--muted); flex: 0 0 110px; }

footer.site { border-top: 1px solid var(--line); background: var(--surface); }
footer.site .wrap { padding-block: 32px; display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; font-size: 15px; color: var(--muted); }
footer.site a { color: var(--muted); text-decoration: none; }
footer.site a:hover { color: var(--gold); }

.ph-mark { font-style: normal; background: var(--gold-soft); color: var(--gold); padding: 0 5px; border-radius: 3px; }

/* Меню уходит на свою строку заметно раньше, чем кончается место: при
   масштабе 125% строка в браузере короче, чем кажется по ширине экрана. */
@media (max-width: 1400px) {
  .bar { flex-wrap: wrap; }
  nav.main { order: 3; flex-basis: 100%; flex-wrap: wrap; }
  .bar .phone-num { margin-left: auto; }
}

@media (max-width: 980px) {
  .grid-cards, .cases { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .band { padding-block: 64px; }
}

@media (max-width: 620px) {
  .grid-cards, .cases { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .numbers { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { font-size: 34px; }
  h2.sec { font-size: 30px; }
  .band { padding-block: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Правовые тексты: узкая колонка, крупный межстрочный интервал. Читают их
   редко, но когда читают — читают внимательно. */
.legal { max-width: 760px; }
.legal .upd { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.legal h2 { font-family: var(--display); font-size: 23px; margin-block: 38px 12px; }
.legal p { font-size: 16px; line-height: 1.75; margin-bottom: 14px; }
.legal ul { margin-block: 12px 18px; padding-left: 22px; }
.legal li { font-size: 16px; line-height: 1.7; margin-bottom: 8px; }
.legal b { font-weight: 600; }

/* Согласие берём галочкой, а не мелким шрифтом под кнопкой: иначе доказать,
   что человек его давал, нечем. */
.consent { display: flex; align-items: flex-start; gap: 10px; margin-block: 2px 16px; cursor: pointer; }
.form-plain .consent input { width: 17px; height: 17px; flex: 0 0 auto; margin: 2px 0 0; accent-color: var(--gold); }
.consent span { font-size: 13px; line-height: 1.5; color: var(--muted); }
.consent a { color: var(--gold); }
.consent[data-error="1"] span { color: #C0392B; }
.dark .consent[data-error="1"] span { color: #F0A9A0; }
