/* ═══════════════════════════════════════════════════════════════
   Поп-ап «Получить доступ»
   ═══════════════════════════════════════════════════════════════
   Токены взяты из style.min.css, чтобы поп-ап не выбивался:
   акцент #e50000, текст #212529, приглушённый #8d868f,
   светлый #f3f1ed, шрифты Comfortaa / Montserrat.
   ═══════════════════════════════════════════════════════════════ */

.lead-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  justify-content: center;
  padding: 20px;
  /* Скроллим подложку целиком. Вложенный скролл внутри диалога
     на низких экранах (телефон в альбомной ориентации) прятал
     кнопку отправки ниже видимой границы */
  overflow-y: auto;
}

.lead-modal[hidden] { display: none; }

.lead-modal__overlay {
  /* fixed, а не absolute: подложка должна закрывать экран
     и когда содержимое прокручено */
  position: fixed;
  inset: 0;
  background: rgba(33, 37, 41, .65);
  animation: leadFade .2s ease-out;
}

.lead-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 520px;
  /* margin:auto вместо align-items:center — так диалог стоит по центру,
     когда места хватает, и не обрезается, когда нет */
  margin: auto;
  background: #fff;
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .25);
  animation: leadRise .25s cubic-bezier(.16, 1, .3, 1);
}

.lead-modal__close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 32px;
  line-height: 1;
  color: #8d868f;
  transition: color .2s;
}

.lead-modal__close:hover { color: #212529; }

.lead-modal__title {
  margin: 0 0 24px;
  padding-right: 24px;
  font-family: "Comfortaa", sans-serif;
  font-weight: 600;
  font-size: 24px;
  line-height: 1.3;
  color: #212529;
}

/* ── Форма ───────────────────────────────────────────────────── */

.lead-modal__form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.lead-modal__field {
  display: block;
  position: relative;
}

.lead-modal__field input {
  width: 100%;
  padding: 14px 0;
  border: none;
  outline: none;
  background: none;
  border-bottom: 1px solid #212529;
  font-family: "Montserrat", sans-serif;
  font-size: 16px;
  color: #212529;
  transition: border-color .2s;
}

.lead-modal__field input::placeholder { color: #8d868f; }
.lead-modal__field input:focus { border-bottom-color: #e50000; }

.lead-modal__field input[aria-invalid="true"] { border-bottom-color: #e50000; }

.lead-modal__error {
  display: none;
  padding-top: 6px;
  font-family: "Montserrat", sans-serif;
  font-size: 13px;
  color: #e50000;
}

.lead-modal__error--visible { display: block; }

.lead-modal__submit {
  margin-top: 8px;
  width: 100%;
  height: 60px;
  border: none;
  border-radius: 32px;
  background: #e50000;
  color: #fff;
  font-family: "Comfortaa", sans-serif;
  font-weight: 500;
  font-size: 19px;
  cursor: pointer;
  transition: transform .3s, opacity .2s;
}

.lead-modal__submit:hover:not(:disabled) { transform: scale(1.03); }

.lead-modal__submit:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.lead-modal__note {
  margin: 0;
  text-align: center;
  font-family: "Montserrat", sans-serif;
  font-size: 14px;
  color: #e50000;
}

.lead-modal__note[hidden] { display: none; }

/* ── Успех ───────────────────────────────────────────────────── */

.lead-modal__step--success { text-align: center; }
.lead-modal__step[hidden]  { display: none; }

.lead-modal__success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: #4ab99c;
  color: #fff;
  font-size: 34px;
  line-height: 64px;
}

.lead-modal__success-text {
  margin: 0 0 28px;
  font-family: "Montserrat", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: #8d868f;
}

.lead-modal__tg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 60px;
  border-radius: 32px;
  background: #e50000;
  color: #fff;
  text-decoration: none;
  font-family: "Comfortaa", sans-serif;
  font-weight: 500;
  font-size: 19px;
  transition: transform .3s;
}

.lead-modal__tg:hover {
  transform: scale(1.03);
  color: #fff;
}

/* ── Выпадающий список должностей ────────────────────────────── */
/* Используется в поп-апе и в форме «Оформите подписку» (sec-4)   */

.pos-picker { position: relative; }

/* В flex-колонке sec-4 обёртка занимает место инпута */
.sec-4-form .pos-picker { width: 100%; }

.pos-picker__list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 10001;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
  max-height: 260px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.pos-picker__list[hidden] { display: none; }

.pos-picker__item {
  padding: 10px 16px;
  cursor: pointer;
}

.pos-picker__item span {
  display: block;
  font-family: "Montserrat", sans-serif;
  font-size: 15px;
  color: #212529;
}

.pos-picker__item small {
  display: block;
  margin-top: 2px;
  font-family: "Montserrat", sans-serif;
  font-size: 12px;
  color: #8d868f;
}

.pos-picker__item:hover,
.pos-picker__item--active { background: #f6f2ee; }

@media (max-width: 576px) {
  .pos-picker__list { max-height: 210px; }
}

/* ── Блокировка прокрутки фона ───────────────────────────────── */

body.lead-modal-open { overflow: hidden; }

/* ── Анимации ────────────────────────────────────────────────── */

@keyframes leadFade { from { opacity: 0; } to { opacity: 1; } }

@keyframes leadRise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .lead-modal__overlay,
  .lead-modal__dialog { animation: none; }
  .lead-modal__submit:hover:not(:disabled),
  .lead-modal__tg:hover { transform: none; }
}

/* ── Мобильные ───────────────────────────────────────────────── */

@media (max-width: 576px) {
  .lead-modal { padding: 12px; }

  .lead-modal__dialog {
    padding: 32px 20px 24px;
    border-radius: 18px;
  }

  .lead-modal__title { font-size: 20px; }

  .lead-modal__form { gap: 16px; }

  .lead-modal__submit,
  .lead-modal__tg {
    height: 54px;
    font-size: 17px;
  }
}
