/* Дизайн-направление "Строгий монохром" (выбрано заказчиком из трёх вариантов,
   см. историю в docs/knowledge-base): почти чёрно-белая палитра, тонкие
   разделители-hairline, один синий акцент — сосредоточен в кнопках, которые
   нарочно сделаны заметнее всего на странице (округлые, стеклянные, с тенью). */
:root {
  --color-primary: #2f80ed;
  --color-primary-dark: #1c64c9;
  --color-primary-light: #4f93f5;
  --color-ink: #17191c;
  --color-bg: #ffffff;
  --color-surface: #f7f8fa;
  --color-text: #17191c;
  --color-muted: #6b7076;
  --color-border: #e4e5e7;
  --radius: 10px;
  --radius-lg: 20px;
  --radius-pill: 14px; /* по просьбе заказчика — вдвое менее скруглено, чем полная "таблетка" */
  --font: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.container--narrow { max-width: 640px; }

/* --- Header --- */
.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
}

.site-header__logo {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  color: var(--color-ink);
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.site-header__phone {
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-ink);
  text-decoration: none;
  white-space: nowrap;
}

.site-header__phone:hover { color: var(--color-primary); }

/* --- Кнопки: единственный "дизайнерский" акцент на в остальном строгой
   странице — округлые, стеклянные (полупрозрачный градиент + blur), с мягкой
   цветной тенью. Все кнопки сайта (шапка, hero, форма, виджет) используют
   один и тот же класс .btn ради целостности. --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #fff;
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary-dark));
  background-clip: padding-box;
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  backdrop-filter: blur(14px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 10px 24px -8px rgba(47, 128, 237, 0.55);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn:hover {
  filter: brightness(1.05);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 14px 28px -8px rgba(47, 128, 237, 0.6);
}

.btn:active {
  transform: translateY(0);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 6px 14px -6px rgba(47, 128, 237, 0.5);
}

.btn--large { font-size: 1.1rem; padding: 17px 34px; }

/* --- Hero + форма заявки в один блок: текст слева, форма справа (макет по
   образцу конкурента, см. историю в docs/knowledge-base) --- */
.hero-split {
  padding: 24px 0 40px;
}

.hero-split__grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: start;
}

.hero-split__text {
  padding-top: 8px;
}

.hero__eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  font-weight: 600;
  margin-bottom: 10px;
}

.hero-split__text h1 {
  font-size: 2.1rem;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  color: var(--color-ink);
}

.hero-split__terms {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-primary-dark);
  margin: 0 0 16px;
}

.hero-split__points {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-split__points li {
  position: relative;
  padding-left: 28px;
  color: var(--color-text);
}

.hero-split__points li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--color-primary);
  font-weight: 700;
}

.hero-split__form-note {
  color: var(--color-muted);
  margin-top: 0;
}

/* --- Карта проезда --- */
.map-section {
  border-top: 1px solid var(--color-border);
  padding: 56px 0 64px;
}

.map-section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--color-ink);
}

.map-section > .container > p {
  color: var(--color-muted);
  margin: 0 0 24px;
}

.map-section__frame {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  line-height: 0;
}

.map-section__frame iframe {
  display: block;
  width: 100%;
  border: 0;
}

.lead-form {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-row { display: flex; flex-direction: column; gap: 3px; }

/* Пара "Ваше имя" + "Телефон" в одну строку, чтобы форма была компактнее. */
.form-row-group { display: flex; gap: 16px; }
.form-row-group .form-row { flex: 1; min-width: 0; }
/* JivoSite заменил наш чат-виджет (см. ADR-013) — этого правила больше нет,
   .lead-form сейчас используется только на самой странице (container--narrow,
   640px), поэтому 480px-медиазапрос ниже покрывает и её. */

.form-row label { font-weight: 600; font-size: 0.9rem; }

.form-row input[type="text"],
.form-row input[type="tel"],
.form-row input[type="email"],
.form-row select,
.form-row textarea {
  padding: 9px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  background: #fff;
  color: var(--color-text);
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.15);
}

/* "Комментарий": высота сама подстраивается под текст (см. setupAutoGrowTextareas
   в main.js) — руками тянуть не нужно и незачем, поэтому resize отключён
   полностью, никакой рамки для перетаскивания в углу нет вообще. Растёт
   максимум до двойной исходной высоты (min-height * 2) — дальше уже обычная
   прокрутка внутри поля, а не бесконечный рост вниз. overflow-y дальше
   переключает JS между hidden (пока текст помещается) и auto (когда упёрлись
   в max-height и появляется прокрутка). */
.form-row textarea {
  resize: none;
  min-height: 40px;
  max-height: 120px;
  overflow-y: hidden;
}

/* Некорректный email (проверяем по уходу фокуса, см. setupEmailValidation
   в main.js): рамка и сам введённый текст красные, поле встряхивается,
   чтобы точно привлечь внимание. */
.form-row input.field-invalid {
  border-color: #c0392b;
  color: #c0392b;
  animation: field-shake 0.4s ease;
}

.form-row input.field-invalid:focus {
  border-color: #c0392b;
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.15);
}

@keyframes field-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* Единая "белая рамка": сам input и список выбранных файлов внутри неё —
   визуально один растущий вниз блок, а не рамка отдельно от списка. */
.file-upload {
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px 12px;
}

.file-upload input[type="file"] {
  display: block;
  width: 100%;
  font-size: 0.9rem;
}

.file-upload__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.file-upload__list:not(:empty) { margin-top: 10px; }

.file-upload__list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  background: var(--color-surface);
  border-radius: 6px;
  font-size: 0.85rem;
}

.file-upload__list .file-upload__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-upload__list .file-upload__check {
  flex-shrink: 0;
  color: #1a7f37;
  font-weight: 700;
}

/* Подсказка про форматы файлов — под кнопкой выбора, серая и мелкая,
   не должна спорить с самой кнопкой за внимание. Специфичность селектора
   поднята намеренно (.form-row label.form-row__hint), чтобы перебить общее
   правило ".form-row label { font-weight: 600; font-size: 0.9rem }" выше. */
.form-row label.form-row__hint {
  font-weight: 400;
  font-size: 8px;
  color: var(--color-muted);
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 400 !important;
  font-size: 0.9rem;
}

.lead-form .btn { align-self: flex-start; margin-top: 4px; }

.form-status { font-size: 0.9rem; }
.form-status[data-state="success"] { color: #1a7f37; }
.form-status[data-state="error"] { color: #c0392b; }

/* Honeypot-поле: скрыто визуально, но остаётся в DOM и доступно скринридерам
   отключено — именно поэтому это не display:none (боты часто игнорируют его),
   а увод за пределы экрана. */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --- Footer --- */
.site-footer {
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  padding: 24px 0;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.site-footer__inner p { margin: 4px 0; }
.site-footer a { color: var(--color-primary-dark); }

/* Живой чат в правом нижнем углу — виджет JivoSite (см. partials/jivo-widget.hbs),
   рисует себя сам, собственного CSS с нашей стороны не требует. */

/* --- Privacy policy page --- */
.policy h2 { margin-top: 32px; }

/* --- Модалка об успешной отправке заявки: квадратная карточка по центру
   экрана с затемнением фона, а не маленький тост в углу — сообщение должно
   быть невозможно не заметить. --- */
.success-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(23, 25, 28, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.success-modal-backdrop.success-modal-backdrop--visible {
  opacity: 1;
  pointer-events: auto;
}

.success-modal {
  position: relative;
  width: min(280px, 84vw);
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  padding: 32px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 48px -12px rgba(23, 25, 28, 0.35);
  transform: scale(0.92);
  transition: transform 0.25s ease;
}

.success-modal-backdrop--visible .success-modal {
  transform: scale(1);
}

.success-modal__icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #1a7f37;
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.success-modal__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-ink);
  margin: 0;
}

.success-modal__text {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin: 0;
  line-height: 1.4;
}

.success-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: var(--color-muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

/* --- Модалка "Заказать звонок" из шапки — та же логика затемнения/карточки,
   что и success-modal, но пошире (внутри полноценная форма, а не сообщение)
   и без анимации размера иконки-галочки. --- */
.callback-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(23, 25, 28, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.callback-modal-backdrop.callback-modal-backdrop--visible {
  opacity: 1;
  pointer-events: auto;
}

.callback-modal {
  position: relative;
  width: min(420px, 90vw);
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 48px -12px rgba(23, 25, 28, 0.35);
  transform: scale(0.92);
  transition: transform 0.25s ease;
}

.callback-modal-backdrop--visible .callback-modal {
  transform: scale(1);
}

/* Форма и так внутри карточки модалки — своя рамка/фон/паддинг ей ни к чему. */
.callback-modal .lead-form {
  background: none;
  border: none;
  padding: 0;
}

.callback-modal__title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-ink);
  margin: 0 0 6px;
}

.callback-modal__subtitle {
  color: var(--color-muted);
  margin: 0 0 20px;
}

.callback-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: var(--color-muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 480px) {
  .form-row-group { flex-direction: column; }
}

/* Две колонки (текст/форма) на планшете и телефоне не помещаются рядом —
   форма уезжает под текст, как обычный поток. */
@media (max-width: 900px) {
  .hero-split__grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .hero-split { padding: 40px 0; }
  .hero-split__text h1 { font-size: 1.6rem; }
  .hero-split__terms { font-size: 1.1rem; }
  .site-header__phone { display: none; }
}
