/* =====================================================================
   lead-modal.css — единая модалка заявки (ред. 2026-11-25)
   Четыре режима: price, consultation, callback, service (см. lead-modal.js).
   Подключается из include/footer.php, поэтому доступна на всех страницах.
   ===================================================================== */

.lead-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lead-modal.is-open {
  display: flex;
}

.lead-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(12, 46, 66, 0.55);
  backdrop-filter: blur(2px);
}

.lead-modal__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: #ffffff;
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 24px 60px rgba(12, 46, 66, 0.25);
  animation: lead-modal-in 0.18s ease-out;
}

@keyframes lead-modal-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.lead-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: #5b6e8c;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
}

.lead-modal__close:hover,
.lead-modal__close:focus-visible {
  background: #eef3fc;
  color: #0c2e42;
}

.lead-modal__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #eef3fc;
  color: #1e6f9f;
  border-radius: 40px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.lead-modal__title {
  margin: 0 0 8px;
  font-size: 1.45rem;
  line-height: 1.25;
  color: #0c2e42;
  font-weight: 700;
}

.lead-modal__sub {
  margin: 0 0 18px;
  font-size: 14px;
  color: #5b6e8c;
  line-height: 1.5;
}

.lead-form__field {
  display: block;
  margin-bottom: 12px;
}

.lead-form__field > span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #5b6e8c;
  margin-bottom: 4px;
}

.lead-form input[type="text"],
.lead-form input[type="tel"],
.lead-form input[type="email"],
.lead-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid #cfdfed;
  border-radius: 12px;
  background: #fff;
  font-family: inherit;
  font-size: 15px;
  color: #1a2b3c;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.lead-form input:focus,
.lead-form textarea:focus {
  outline: none;
  border-color: #1e6f9f;
  box-shadow: 0 0 0 3px rgba(30, 111, 159, 0.18);
}

.lead-form textarea {
  resize: vertical;
  min-height: 64px;
}

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

.lead-form .consent-block {
  margin: 14px 0 4px;
}

.lead-form .consent-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12.5px;
  line-height: 1.45;
  color: #5b6e8c;
}

.lead-form .consent-row input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
}

.lead-form .consent-row a {
  color: #1e6f9f;
  text-decoration: underline;
}

.lead-form__submit {
  width: 100%;
  margin-top: 10px;
  padding: 14px 20px;
  border: none;
  border-radius: 40px;
  background: #1e6f9f;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, transform 0.15s;
}

.lead-form__submit:hover {
  background: #0f5a85;
}

.lead-form__submit:disabled {
  opacity: 0.6;
  cursor: default;
}

.lead-form__note {
  margin: 10px 0 0;
  font-size: 12px;
  color: #8a99ae;
  text-align: center;
}

.lead-form__status {
  margin: 10px 0 0;
  font-size: 13px;
  text-align: center;
  min-height: 18px;
}

.lead-form__status.is-error {
  color: #c0392b;
}

.lead-form__status.is-success {
  color: #1e7a4f;
}

/* видимость полей задаёт lead-modal.js атрибутом hidden: в price одни поля,
   в consultation другие, в callback только имя и телефон, в service модель и проблема */
.lead-form__field[hidden] {
  display: none !important;
}

/* широкие поля (комментарий, описание проблемы) — на всю ширину диалога */
.lead-form__field--wide {
  display: block;
}

/* компактный режим обратного звонка: меньше воздуха, диалог ниже */
.lead-modal[data-mode="callback"] .lead-modal__dialog {
  padding-bottom: 24px;
}

.lead-modal[data-mode="callback"] .lead-modal__sub {
  margin-bottom: 14px;
}

.lead-modal__success {
  display: none;
  text-align: center;
  padding: 12px 0 4px;
}

.lead-modal__success .lead-modal__success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: #e8f6ee;
  color: #1e7a4f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.lead-modal.is-sent .lead-form {
  display: none;
}

.lead-modal.is-sent .lead-modal__success {
  display: block;
}

@media (max-width: 480px) {
  .lead-modal {
    padding: 10px;
    align-items: flex-end;
  }

  .lead-modal__dialog {
    padding: 24px 20px;
    border-radius: 18px 18px 0 0;
    max-height: calc(100vh - 10px);
  }

  .lead-modal__title {
    font-size: 1.25rem;
  }

  /* 16px на телефоне — иначе iOS зумит страницу при фокусе в поле */
  .lead-form input[type="text"],
  .lead-form input[type="tel"],
  .lead-form input[type="email"],
  .lead-form textarea {
    font-size: 16px;
  }

  .lead-form .consent-row {
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lead-modal__dialog {
    animation: none;
  }
}
