/* ============================================================
   Форма заявки — модальное окно.
   Значения берём из tokens.css: форма должна выглядеть частью сайта,
   а не вставленным виджетом.
   ============================================================ */

.lead-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-6);
  background: rgba(16, 24, 40, .55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  overflow-y: auto;
}
.lead-overlay[hidden] { display: none; }

.lead-modal {
  position: relative;
  width: 100%; max-width: 520px;
  max-height: calc(100vh - var(--space-12));
  overflow-y: auto;
  background: var(--c-surface);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 60px rgba(16, 24, 40, .28);
  padding: var(--space-8);
  font-family: var(--font-display);
  color: var(--b-ink);
}

.lead-close {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%;
  background: var(--b-surface-soft); color: var(--b-ink-secondary);
  cursor: pointer; transition: var(--transition);
}
.lead-close:hover { background: var(--b-border); color: var(--b-ink); }
.lead-close svg { width: 18px; height: 18px; }

/* --- Шапка и оффер --- */
.lead-heading { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); padding-right: 40px; }
.lead-heading-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  background: var(--c-primary-soft); color: var(--c-primary);
}
.lead-heading-icon svg { width: 22px; height: 22px; }
.lead-heading h2 { font-size: 22px; font-weight: 700; line-height: 1.25; letter-spacing: -0.02em; }

.lead-info p { font-size: var(--text-base); line-height: 1.5; color: var(--b-ink-secondary); margin-bottom: var(--space-3); }
.lead-info ul { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-bottom: var(--space-6); }
.lead-info li { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; line-height: 1.45; }
.lead-info li svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; color: var(--c-green); }

/* --- Поля --- */
.lead-form { display: flex; flex-direction: column; gap: var(--space-4); }
.lead-field { display: block; }
.lead-label { display: block; font-size: var(--text-sm); font-weight: 600; margin-bottom: 6px; }
.lead-label i { color: var(--c-primary); font-style: normal; }

.lead-field input, .lead-field textarea {
  width: 100%;
  font-family: var(--font-text); font-size: var(--text-base); line-height: 1.4;
  color: var(--b-ink);
  padding: 12px 14px;
  border: 1px solid var(--b-border); border-radius: var(--radius-md);
  background: var(--c-surface);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.lead-field textarea { resize: vertical; min-height: 84px; }
.lead-field input::placeholder, .lead-field textarea::placeholder { color: var(--b-ink-muted); }
.lead-field input:focus, .lead-field textarea:focus {
  outline: none; border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-soft);
}
.lead-field.is-invalid input, .lead-field.is-invalid textarea { border-color: #dc2626; }
.lead-error { display: none; font-size: var(--text-sm); color: #dc2626; margin-top: 5px; }
.lead-field.is-invalid .lead-error { display: block; }

/* Поле-приманка: убрано с глаз, но не display:none — часть ботов такие поля пропускает */
.lead-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.lead-submit {
  width: 100%;
  padding: 15px 24px;
  border: 0; border-radius: var(--radius-md);
  background: var(--c-primary); color: #fff;
  font-family: var(--font-display); font-size: var(--text-base); font-weight: 700;
  cursor: pointer; transition: background var(--transition), transform .1s;
  box-shadow: 0 8px 22px rgba(41, 130, 255, .3);
}
.lead-submit:hover { background: var(--b-blue-dark); }
.lead-submit:active { transform: translateY(1px); }
.lead-submit[disabled] { background: var(--b-ink-muted); box-shadow: none; cursor: default; }

.lead-consent { font-size: var(--text-xs); line-height: 1.45; color: var(--b-ink-muted); text-align: center; }
.lead-consent a { color: var(--b-ink-secondary); text-decoration: none; }
.lead-consent a:hover { text-decoration: underline; text-underline-offset: 3px; }

.lead-fail {
  font-size: var(--text-sm); line-height: 1.5;
  color: #b91c1c; background: #fef2f2;
  border: 1px solid #fecaca; border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.lead-fail[hidden] { display: none; }
.lead-fail a { color: #b91c1c; font-weight: 700; }

/* --- Экран «спасибо» --- */
.lead-thanks { text-align: center; padding: var(--space-4) 0; }
.lead-thanks[hidden] { display: none; }
.lead-thanks-icon {
  width: 56px; height: 56px; margin: 0 auto var(--space-4);
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: #e8f5f0; color: var(--c-green);
}
.lead-thanks-icon svg { width: 28px; height: 28px; }
.lead-thanks h2 { font-size: 24px; font-weight: 700; margin-bottom: var(--space-3); }
.lead-thanks p { font-size: var(--text-base); line-height: 1.55; color: var(--b-ink-secondary); margin-bottom: var(--space-3); }
.lead-thanks a { color: var(--c-primary); font-weight: 600; }
.lead-thanks-id { font-size: var(--text-sm); color: var(--b-ink-muted); }
.lead-thanks .lead-submit { max-width: 220px; margin: var(--space-4) auto 0; }

/* Пока окно открыто, страница под ним не прокручивается */
body.lead-open { overflow: hidden; }

@media (max-width: 640px) {
  .lead-overlay { padding: 0; align-items: flex-end; }
  .lead-modal {
    max-width: none; max-height: 94vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: var(--space-6) var(--space-6) var(--space-8);
  }
  .lead-heading h2 { font-size: 19px; }
}

/* ============================================================
   Форма внутри статьи.
   Мягкая подложка фирменного цвета, сверху заголовок-крючок под тему
   статьи, внутри белая панель с полями. Поля без подписей — подсказка
   в самом поле, как в коротких формах на медиа-площадках.
   ============================================================ */
.lead-inline {
  margin: var(--space-10) 0;
  padding: 28px 28px 24px;
  border-radius: var(--radius-card);
  background: var(--b-blue-light);
  font-family: var(--font-display);
  color: var(--b-ink);
}
.lead-inline-head { margin-bottom: var(--space-6); }
.lead-inline-headline { font-size: 24px; font-weight: 700; line-height: 1.22; letter-spacing: -0.02em; margin-bottom: 10px; }
.lead-inline-sub { font-size: 16px; line-height: 1.5; color: var(--b-ink-secondary); }

.lead-inline-panel { background: var(--c-surface); border-radius: var(--radius-lg); padding: 28px; }
.lead-inline-title { font-size: 24px; font-weight: 700; line-height: 1.25; letter-spacing: -0.02em; margin-bottom: var(--space-4); }
.lead-inline-title[hidden] { display: none; }

/* подпись поля остаётся для скринридеров, глазами видна только подсказка в поле */
.lead-form--inline .lead-label {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.lead-form--inline .lead-field { position: relative; }
.lead-form--inline .lead-field input {
  background: var(--b-surface-soft); border-color: transparent;
  padding: 16px 16px; font-size: 16px;
}
.lead-form--inline .lead-field input:focus { background: var(--c-surface); border-color: var(--c-primary); }
.lead-form--inline .lead-field.is-invalid input { background: var(--c-surface); border-color: var(--c-error); box-shadow: 0 0 0 1px var(--c-error); }
.lead-form--inline .lead-submit { padding: 17px 24px; font-size: 17px; border-radius: var(--radius-pill); }
.lead-form--inline[hidden] { display: none; }

/* внутри статьи текст и ссылки берут стили .post-content — возвращаем свои */
.lead-inline .lead-consent { font-size: var(--text-xs); line-height: 1.45; margin: 0; color: var(--b-ink-muted); }
.lead-inline .lead-consent a { color: var(--b-ink-secondary); font-weight: 400; text-decoration: none; }
.lead-inline .lead-fail { margin: 0; }
.lead-inline .lead-error { margin: 5px 0 0; }

.lead-inline-thanks { text-align: center; padding: var(--space-4) 0; }
.lead-inline-thanks[hidden] { display: none; }
.lead-inline-thanks-title { font-size: 24px; font-weight: 700; margin-bottom: var(--space-3); }
.lead-inline-thanks p { font-size: var(--text-base); line-height: 1.55; color: var(--b-ink-secondary); margin-bottom: var(--space-3); }
.lead-inline-thanks a { color: var(--c-primary); font-weight: 600; }

/* ============================================================
   Вариант главной: форма в первом экране.
   Слева текст первого экрана как есть, справа — та же белая панель,
   что в статьях. На узком экране панель уходит под текст.
   ============================================================ */
.hero--form .inner { text-align: left; max-width: 1200px; }
.hero-split { display: grid; grid-template-columns: 1.15fr .85fr; gap: var(--space-12); align-items: center; }
.hero--form .h1 { font-size: 44px; line-height: 1.12; letter-spacing: -0.03em; }
.hero--form .h1 .text-primary { white-space: normal; }
.hero--form .lead, .hero--form .chips { margin-left: 0; margin-right: 0; max-width: none; }
.hero--form .chips { justify-content: flex-start; }
.hero-split-links { font-family: var(--font-display); font-size: var(--text-base); font-weight: 600; display: flex; gap: 12px; align-items: center; margin-top: var(--space-6); }
.hero-split-links { flex-wrap: wrap; }
.hero-split-links a { color: var(--c-primary); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.hero-split-links span { color: var(--b-ink-muted); }
.hero-split-form {
  background: var(--b-blue-light); border-radius: var(--radius-card);
  padding: 14px; font-family: var(--font-display); color: var(--b-ink);
}
.hero-split-form-head {
  font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--c-primary); padding: 6px 14px 12px;
}
.hero-split-form .lead-inline-panel { padding: 22px; }
.hero-split-form .lead-inline-title { font-size: 21px; margin-bottom: var(--space-3); }
.hero-split-form .lead-form { gap: 10px; }
.hero-split-form .lead-field input { padding: 13px 14px; font-size: 15px; }
.hero-split-form .lead-submit { padding: 15px 22px; font-size: 16px; }
.hero-split-form .lead-consent { margin-top: 2px; }
@media (max-width: 1000px) {
  .hero-split { grid-template-columns: 1fr; gap: var(--space-8); }
  .hero--form .h1 { font-size: 36px; }
}
@media (max-width: 640px) {
  .hero--form .h1 { font-size: 30px; }
  .hero-split-form { padding: 10px; }
  .hero-split-form .lead-inline-panel { padding: 18px 16px; }
}

/* Форма на странице услуги/отрасли: крючок слева, панель справа — во всю ширину контейнера */
.container--narrow { max-width: 1100px; margin: 0 auto; }
.container--narrow .lead-inline {
  margin: 0; padding: 36px 40px;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: var(--space-10); align-items: center;
}
.container--narrow .lead-inline-head { margin-bottom: 0; }
.container--narrow .lead-inline-headline { font-size: 30px; line-height: 1.18; letter-spacing: -0.025em; margin-bottom: 14px; }
.container--narrow .lead-inline-sub { font-size: 17px; }
@media (max-width: 900px) {
  .container--narrow .lead-inline { grid-template-columns: 1fr; gap: var(--space-6); padding: 24px 20px; }
  .container--narrow .lead-inline-headline { font-size: 24px; }
}

@media (max-width: 640px) {
  .lead-inline { padding: 20px 16px 16px; border-radius: var(--radius-lg); }
    .lead-inline-headline { font-size: 21px; }
  .lead-inline-sub { font-size: 15px; }
  .lead-inline-panel { padding: 20px 16px; }
  .lead-inline-title { font-size: 20px; }
}

/* --- перенесено из темы-заплатки 21.09.2026: действующий вид сайта --- */
/* «:root» в селекторе сохраняет прежний вес правила (раньше его давал класс темы на body) */
:root .lead-submit { box-shadow: 0 8px 22px rgba(15, 110, 110, .3); }
/* правило «:root p, :root li { font-family: var(--font-text) }» снято 15.10.2026: абзацы и списки берут шрифт из своих правил (засечка для читаемого текста), остальное наследует body */
:root .lead { font-weight: 400; color: #4B5563; }
