/* ── Оболочка ─────────────────────────────────────────────────────────────*/
.lead[hidden] {
  display: none;
}

.lead {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 44px);
  opacity: 0;
  transition: opacity 200ms var(--ease-out);
}

.lead.is-open {
  opacity: 1;
}

.lead__scrim {
  position: absolute;
  inset: 0;
  background: var(--scrim);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.lead__panel {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: var(--r-xl);
  padding: clamp(24px, 4vw, 36px);
  transform: translateY(8px) scale(0.98);
  transition: transform 260ms var(--ease-out);
}

.lead.is-open .lead__panel {
  transform: none;
}

@media (prefers-reduced-motion: reduce) {

  .lead,
  .lead__panel {
    transition-duration: 120ms;
  }

  .lead__panel,
  .lead.is-open .lead__panel {
    transform: none;
  }
}

/* ── Шапка ────────────────────────────────────────────────────────────── */
.lead__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
}

.lead__title {
  margin: 4px 0 0;
  font-size: clamp(22px, 3vw, 27px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink-0);
}

.lead__close {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--hairline-lit);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ink-1);
  cursor: pointer;
  transition: all 0.25s var(--ease);
}

.lead__close:hover {
  color: var(--ink-0);
  border-color: var(--honey-line-lit);
}

.lead__close:active {
  transform: scale(var(--press-scale));
}

.lead__sub {
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
}

/* Режим «спасибо»: шапка формы уходит, остаётся только «✕». Заголовок и лид
   зовут заполнить форму, которой на экране уже нет, — рядом с принятой заявкой
   они читаются как сбой. */
.lead__panel.is-done .lead__intro,
.lead__panel.is-done .lead__sub {
  display: none;
}

/* Без заголовка в строке шапки «✕» прижимается вправо сам. */
.lead__panel.is-done .lead__head {
  justify-content: flex-end;
  margin-bottom: 0;
}

/* ── Поля ─────────────────────────────────────────────────────────────── */
.lead__form[hidden],
.lead__done[hidden] {
  display: none;
}

.lead__form {
  display: grid;
  gap: 14px;
}

.lead__field {
  display: grid;
  gap: 6px;
}

.lead__label {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-2);
}

.lead__label span {
  font-weight: 500;
  color: var(--ink-3);
}

/* Звёздочка обязательного поля. Мёдом (--honey-deep, 4.8:1 — чистый #ffa600 на
   светлом даёт ~1.8:1 и выглядел бы выцветшим). Для скринридеров звёздочка
   скрыта: им про обязательность говорит required у самого поля, а «звёздочка»
   голосом — шум. */
.lead__label b {
  color: var(--honey-deep);
  font-weight: 700;
}

.lead__input,
.lead__textarea {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-0);
  background: var(--glass-tint);
  border: 1px solid var(--hairline-lit);
  outline: none;
  transition:
    border-color 0.25s var(--ease),
    background 0.25s var(--ease);
}

.lead__input {
  min-height: 50px;
  padding: 0 18px;
  border-radius: var(--r-pill);
}

/* resize:none — уголок растягивания в углу стеклянной панели выглядел как
   мусор и позволял растянуть поле за пределы модалки. Высоты хватает, длинный
   комментарий скроллится внутри поля (см. data-lenis-prevent в lead-form.js). */
.lead__textarea {
  min-height: 112px;
  padding: 14px 18px;
  border-radius: var(--r-md);
  line-height: 1.5;
  resize: none;
  /* Поле переносит строки, поэтому горизонтальной прокрутке взяться неоткуда —
     запрещаем её явно. Единственное, что реально может вылезти вбок, — длинный
     неразрывный кусок (ссылка, артикул на пол-экрана); `break-word` ломает его
     по месту, а не отправляет поле ездить вбок. UA-стиль у textarea —
     `overflow: auto`, то есть полоса разрешена по обеим осям; оставляем только
     вертикальную. */
  overflow-x: hidden;
  overflow-y: auto;
  overflow-wrap: break-word;
}

.lead__input::placeholder,
.lead__textarea::placeholder {
  color: var(--ink-3);
}

.lead__input:focus,
.lead__textarea:focus {
  border-color: var(--honey-line-lit);
  background: rgba(255, 255, 255, 0.5);
}

.lead__input[aria-invalid="true"],
.lead__textarea[aria-invalid="true"] {
  border-color: var(--alert);
}

.lead__error {
  min-height: 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--alert);
}

.lead__error:empty {
  display: none;
}

.lead__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ── Согласие ─────────────────────────────────────────────────────────── */
.lead__consent {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 12px;
  margin-top: 4px;
}

.lead__check {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: 26px;
  height: 26px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.lead__box {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: var(--r-sm);
  background: var(--glass-tint);
  border: 1px solid var(--hairline-lit);
  box-shadow: var(--inset-hi);
  color: transparent;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}

.lead__box svg {
  transform: scale(0.5);
  transition: transform 0.3s var(--ease);
}

.lead__check:hover+.lead__box {
  border-color: var(--honey-line-lit);
}

.lead__check:focus-visible+.lead__box {
  outline: 2px solid var(--honey-line-lit);
  outline-offset: 2px;
}

.lead__check:checked+.lead__box {
  background: var(--honey-grad);
  border-color: var(--honey);
  color: var(--on-honey);
}

.lead__check:checked+.lead__box svg {
  transform: scale(1);
}

.lead__consent-text {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-2);
  cursor: pointer;
}

.lead__consent-text b {
  color: var(--honey-deep);
  font-weight: 700;
}

.lead__consent-text a {
  color: var(--honey-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {

  .lead__box,
  .lead__box svg {
    transition: none;
  }
}

/* ── Подвал ───────────────────────────────────────────────────────────── */
.lead__foot {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.lead__submit {
  width: 100%;
}

/* Погашенная кнопка — порт `.btn:disabled` из BaseButton.vue: тот же мёд под
   opacity .6, отчего он читается песочным. Гасим и hover-эффекты: без этого
   `.btn--honey:hover` из cta.css (там свои filter и box-shadow) продолжал бы
   подсвечивать мёртвую кнопку под курсором и обещать нажатие. */
.lead__submit:disabled {
  cursor: default;
  opacity: 0.6;
  filter: none;
  box-shadow: none;
}

.lead__submit:disabled:hover,
.lead__submit:disabled:active {
  filter: none;
  transform: none;
  box-shadow: none;
}

.lead__status {
  min-height: 0;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
  color: var(--alert);
}

.lead__status:empty {
  display: none;
}

.lead__fine {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.45;
  text-align: center;
  color: var(--ink-3);
}

/* Спиннер в кнопке на время отправки. */
.lead__spin {
  display: none;
  width: 15px;
  height: 15px;
  margin-right: 8px;
  border: 2px solid rgba(26, 26, 26, 0.25);
  border-top-color: var(--on-honey);
  border-radius: 50%;
  animation: lead-spin 0.7s linear infinite;
}

.is-sending .lead__spin {
  display: inline-block;
}

@keyframes lead-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .lead__spin {
    animation-duration: 1.6s;
  }
}

/* ── Успех ────────────────────────────────────────────────────────────*/
.lead__done {
  display: grid;
  gap: 14px;
  justify-items: center;
  text-align: center;
  padding: 12px 0 4px;
}

.lead__done-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: var(--r-pill);
  background: var(--honey-fill);
  border: 1px solid var(--honey-line-lit);
  color: var(--honey-deep);
}

.lead__done h3 {
  margin: 0;
  font-size: clamp(22px, 3vw, 27px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink-0);
}

/* Надзаголовок «Заявка принята» — тот же ритм, что у «Закрытый пилот» в форме. */
.lead__done .eyebrow {
  margin: 0;
}

.lead__done p {
  margin: 0;
  max-width: 38ch;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
}
