/* =====================================================================
   lead-form.css — модальная форма заявки
   Подключается на всех страницах. Открывается по клику на CTA с href="#demo"
   или элементах с data-lead-cta.
   ===================================================================== */

.lf-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: color-mix(in srgb, #0D3947 70%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.lf-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lf-modal {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: #FFFFFF;
  border-radius: 24px;
  padding: 36px 32px 32px;
  box-shadow: 0 30px 80px rgba(13, 57, 71, 0.30);
  transform: translateY(12px) scale(0.985);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.lf-overlay.is-open .lf-modal {
  transform: translateY(0) scale(1);
}

.lf-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: none;
  background: rgba(13, 57, 71, 0.06);
  color: #0D3947;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.lf-close:hover { background: rgba(13, 57, 71, 0.12); }
.lf-close svg { width: 16px; height: 16px; }

.lf-eyebrow {
  margin: 0 0 8px;
  font-family: "Inter", "DM Sans", sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #79F395;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.lf-eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  background: #79F395;
  border-radius: 999px;
}

.lf-title {
  margin: 0 0 8px;
  font-family: "Inter", "DM Sans", sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #0D3947;
}

.lf-subtitle {
  margin: 0 0 24px;
  font-family: "Inter", "DM Sans", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(13, 57, 71, 0.7);
}

.lf-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lf-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lf-label {
  font-family: "Inter", "DM Sans", sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: rgba(13, 57, 71, 0.7);
}

.lf-input {
  font-family: "Inter", "DM Sans", sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: #0D3947;
  background: #F5F7F8;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 14px 16px;
  outline: none;
  transition: background 0.2s ease, border-color 0.2s ease;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
}
.lf-input:focus {
  background: #FFFFFF;
  border-color: #79F395;
  box-shadow: 0 0 0 3px rgba(121, 243, 149, 0.25);
}
.lf-input::placeholder { color: rgba(13, 57, 71, 0.35); }

.lf-submit {
  margin-top: 6px;
  width: 100%;
  border: none;
  cursor: pointer;
  padding: 16px 20px;
  font-family: "Inter", "DM Sans", sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #FFFFFF;
  background: #0D3947;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.2s ease, transform 0.15s ease;
}
.lf-submit:hover:not(:disabled) {
  background: #15536A;
  transform: translateY(-1px);
}
.lf-submit:disabled { opacity: 0.6; cursor: progress; }
.lf-submit__arrow { width: 16px; height: 16px; }

.lf-privacy {
  margin: 14px 0 0;
  font-family: "Inter", "DM Sans", sans-serif;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(13, 57, 71, 0.55);
  text-align: center;
}
.lf-privacy a { color: rgba(13, 57, 71, 0.8); text-decoration: underline; }

.lf-error {
  margin: 0;
  padding: 10px 14px;
  font-family: "Inter", "DM Sans", sans-serif;
  font-size: 13px;
  color: #B43A3A;
  background: rgba(180, 58, 58, 0.08);
  border-radius: 10px;
  display: none;
}
.lf-error.is-visible { display: block; }

/* Success state */
.lf-modal[data-state="success"] .lf-form,
.lf-modal[data-state="success"] .lf-subtitle,
.lf-modal[data-state="success"] .lf-title,
.lf-modal[data-state="success"] .lf-eyebrow,
.lf-modal[data-state="success"] .lf-privacy { display: none; }

.lf-success {
  display: none;
  text-align: center;
  padding: 20px 0 8px;
}
.lf-modal[data-state="success"] .lf-success { display: block; }

.lf-success__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #79F395;
  border-radius: 999px;
}
.lf-success__icon svg { width: 28px; height: 28px; color: #0D3947; }
.lf-success__title {
  margin: 0 0 10px;
  font-family: "Inter", "DM Sans", sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0D3947;
}
.lf-success__text {
  margin: 0;
  font-family: "Inter", "DM Sans", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(13, 57, 71, 0.7);
}

/* Mobile tweaks */
@media (max-width: 540px) {
  .lf-modal { padding: 28px 22px 24px; border-radius: 20px; }
  .lf-title { font-size: 20px; }
}

/* Lock background scroll when modal open */
body.lf-locked { overflow: hidden; }
