/* ===========================================================
   Lead capture popup modal
   Used by the "Get a Quote" and "Request a Free Consultation"
   buttons. Fully responsive: centered card on desktop,
   near-full-screen sheet on mobile.
=========================================================== */

.lead-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 22, 28, 0.6);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.lead-modal-overlay.is-open {
  display: flex;
  opacity: 1;
}

.lead-modal {
  background: #fff;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 14px;
  padding: 32px;
  position: relative;
  transform: translateY(16px);
  transition: transform 0.25s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.lead-modal-overlay.is-open .lead-modal {
  transform: translateY(0);
}

.lead-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: #f2f2f2;
  color: #333;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.lead-modal-close:hover { background: #e4e4e4; }

.lead-modal h3 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 700;
  color: #1c1f26;
  padding-right: 30px;
}
.lead-modal p.lead-modal-sub {
  color: #666;
  margin: 0 0 24px;
  font-size: 14px;
}

.lead-modal .form-row {
  margin-bottom: 16px;
}
.lead-modal .form-row.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.lead-modal label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
}
.lead-modal label .req { color: #e0453c; }
.lead-modal input[type="text"],
.lead-modal input[type="email"],
.lead-modal input[type="tel"],
.lead-modal select,
.lead-modal textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #dcdfe4;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: #222;
  transition: border-color 0.15s ease;
  background: #fff;
}
.lead-modal input:focus,
.lead-modal select:focus,
.lead-modal textarea:focus {
  outline: none;
  border-color: #76b413;
}
.lead-modal textarea { resize: vertical; min-height: 90px; }

.lead-modal .field-error {
  color: #e0453c;
  font-size: 12px;
  margin-top: 5px;
  display: none;
}
.lead-modal .form-row.has-error input,
.lead-modal .form-row.has-error select,
.lead-modal .form-row.has-error textarea {
  border-color: #e0453c;
}
.lead-modal .form-row.has-error .field-error { display: block; }

.lead-modal-submit {
  width: 100%;
  border: none;
  background: #76b413;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  padding: 13px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.lead-modal-submit:hover { background: #65a00f; }
.lead-modal-submit:disabled { opacity: 0.65; cursor: not-allowed; }

.lead-modal-alert {
  display: none;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}
.lead-modal-alert.is-error {
  display: block;
  background: #fdecea;
  color: #c0392b;
}
.lead-modal-alert.is-success {
  display: block;
  background: #eaf7e6;
  color: #2f7a1f;
}

.lead-modal-success-state {
  text-align: center;
  padding: 20px 0;
}
.lead-modal-success-state i {
  font-size: 52px;
  color: #76b413;
  margin-bottom: 16px;
  display: block;
}
.lead-modal-success-state h3 { padding-right: 0; }

@media (max-width: 575px) {
  .lead-modal-overlay { padding: 0; align-items: flex-end; }
  .lead-modal {
    max-width: 100%;
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
    padding: 24px 20px;
  }
  .lead-modal .form-row.two-col {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
