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

.lead-modal {
  position: fixed;
  inset: 0;
  z-index: 1250;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(12px, 4vh, 32px) clamp(12px, 3vw, 20px);
  box-sizing: border-box;
  overflow-y: auto;
  overscroll-behavior: contain;
}

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

.lead-modal:not([hidden]) {
  display: flex;
}

.lead-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 14, 0.78);
  backdrop-filter: blur(10px);
  z-index: 0;
  cursor: pointer;
}

.lead-modal__surface {
  position: relative;
  z-index: 1;
  width: min(480px, 100%);
  padding: clamp(24px, 4vw, 32px);
  border-radius: 16px;
  background: #fff;
  color: #111827;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  animation: leadModalIn 0.28s ease-out;
}

@keyframes leadModalIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

.lead-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: #f3f4f6;
  color: #374151;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-family: inherit;
  transition: background 0.15s ease;
}

.lead-modal__close:hover {
  background: #e5e7eb;
}

.lead-modal__title {
  margin: 0 36px 10px 0;
  font-size: clamp(24px, 4vw, 30px);
  font-weight: 800;
  line-height: 1.2;
  color: #0b0e14;
}

.lead-modal__lead {
  margin: 0 0 22px;
  font-size: 15px;
  line-height: 1.5;
  color: #4b5563;
}

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

.lead-modal__form input,
.lead-modal__form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  color: #111827;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.lead-modal__form input::placeholder,
.lead-modal__form textarea::placeholder {
  color: #9ca3af;
}

.lead-modal__form input:focus,
.lead-modal__form textarea:focus {
  outline: none;
  border-color: #0f8b80;
  box-shadow: 0 0 0 3px rgba(44, 212, 179, 0.22);
}

.lead-modal__form textarea {
  min-height: 110px;
  resize: vertical;
}

.lead-modal__phone {
  display: flex;
  align-items: stretch;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.lead-modal__phone:focus-within {
  border-color: #0f8b80;
  box-shadow: 0 0 0 3px rgba(44, 212, 179, 0.22);
}

.lead-modal__phone-code {
  max-width: 118px;
  padding: 0 28px 0 10px;
  border: none;
  border-right: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #374151;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.lead-modal__phone-code:focus {
  outline: none;
}

.lead-modal__phone input {
  border: none;
  border-radius: 0;
  box-shadow: none !important;
  flex: 1;
  min-width: 0;
}

.lead-modal__phone input:focus {
  box-shadow: none;
}

.lead-modal__submit {
  margin-top: 4px;
  width: 100%;
  padding: 15px 20px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  background: linear-gradient(135deg, #0f8b80, #2cd4b3);
  box-shadow: 0 8px 24px rgba(15, 139, 128, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.lead-modal__submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(44, 212, 179, 0.45);
}

.lead-modal__submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.lead-modal__legal {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: #6b7280;
  text-align: center;
}

.lead-modal__legal a {
  color: #0f8b80;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.lead-modal__legal a:hover {
  color: #0a6b62;
}

.lead-modal__error {
  display: none;
  margin: -4px 0 0;
  font-size: 12px;
  color: #dc2626;
}

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

.lead-modal__phone.is-invalid,
.lead-modal__form input.is-invalid,
.lead-modal__form textarea.is-invalid {
  border-color: #dc2626;
}

.lead-modal__phone.is-invalid:focus-within {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}
