/* Lead capture modal — centered professional card */

body {
  overflow-x: hidden;
}

body.lead-modal-open .expert-cta-bar,
body.modal-open:not(.listing-modal-open) .expert-cta-bar {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body.lead-modal-open.has-expert-cta,
body.listing-modal-open.has-expert-cta,
body.modal-open.has-expert-cta {
  padding-bottom: 0;
}

body.lead-modal-open,
body.modal-open.lead-modal-open {
  overflow: hidden;
  touch-action: none;
}

.lead-modal {
  position: fixed;
  inset: 0;
  z-index: 1500;
  padding: max(0.5rem, env(safe-area-inset-top, 0px)) 0.75rem
    max(0.5rem, env(safe-area-inset-bottom, 0px));
  align-items: center;
  justify-content: center;
  overflow: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

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

.lead-modal.is-open {
  display: flex !important;
  pointer-events: auto;
}

.lead-modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.lead-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(520px, calc(100vw - 1.5rem));
  max-width: min(520px, calc(100vw - 1.5rem));
  max-height: min(90dvh, 720px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(7, 21, 38, 0.28);
  box-sizing: border-box;
}

.lead-modal-dialog,
.lead-modal-body,
.lead-modal-form,
.lead-modal-form .lead-step {
  box-sizing: border-box;
  max-width: 100%;
}

.lead-modal-form input,
.lead-modal-form select,
.lead-modal-form textarea,
.lead-modal-form label,
.lead-modal-form p,
.lead-modal-form button {
  max-width: 100%;
}

.lead-modal-dialog > .lead-modal-close {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 30;
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.65rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  background: rgba(255, 255, 255, 0.95);
  color: var(--navy);
  border: 1px solid rgba(7, 21, 38, 0.12);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.lead-modal-header {
  padding: 1.15rem 2.75rem 0.85rem 1.25rem;
  background: linear-gradient(165deg, #071526 0%, #0f2844 100%);
  color: #fff;
  text-align: center;
  flex-shrink: 0;
}

.lead-modal-header .lead-modal-kw {
  display: block;
  margin: 0 auto 0.6rem;
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

.lead-modal-header #lead-modal-title {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}

.lead-modal-header .lead-modal-lead {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.88);
}

.lead-modal-body {
  padding: 1.1rem 1rem 1.25rem;
  overflow-x: hidden;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.lead-modal-form.lead-form-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
}

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

.lead-modal-form .lead-step:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.lead-step-hint {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.lead-modal-form .listing-field,
.lead-modal-form .lead-field {
  display: block;
  margin-bottom: 0.55rem;
}

.lead-modal-form .listing-field-label,
.lead-modal-form .lead-field-label {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--navy);
}

.lead-modal-form input[type='text'],
.lead-modal-form input[type='tel'],
.lead-modal-form input[type='email'],
.lead-modal-form select {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  margin-bottom: 0;
  border: 1px solid rgba(7, 21, 38, 0.14);
  border-radius: 8px;
  background: #fafbfc;
  box-sizing: border-box;
}

.lead-modal-form input:focus,
.lead-modal-form select:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(7, 21, 38, 0.08);
  background: #fff;
}

.lead-modal-form .contact-or {
  margin: 0.15rem 0;
  font-size: 0.72rem;
  text-align: center;
  color: var(--text-muted);
}

.lead-modal-form .consent--compact {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
  margin: 0.5rem 0 0.75rem;
  padding: 0;
  font-size: 0.68rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.lead-modal-form .consent--compact input[type='checkbox'] {
  flex: 0 0 auto;
  width: 1.1rem;
  height: 1.1rem;
  min-width: 1.1rem;
  margin: 0.15rem 0 0;
}

.lead-modal-form .consent--compact span {
  flex: 1 1 auto;
  min-width: 0;
}

.lead-modal-form .lead-step-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.lead-modal-form .lead-step-actions .btn {
  flex: 1;
  min-height: 44px;
  border-radius: 8px;
  font-weight: 600;
}

.lead-modal-form > .btn-block {
  width: 100%;
  min-height: 44px;
  margin-top: 0;
  border-radius: 8px;
}

.lead-modal-footer-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.35rem;
  width: 100%;
}

.lead-modal-cancel {
  width: 100%;
  min-height: 44px;
  margin: 0;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.lead-modal-body .form-error {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
}

.lead-modal-body .lead-success {
  text-align: center;
  padding: 1.5rem 0.5rem;
}

.lead-modal-body .lead-success .success-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
}

@media (max-width: 768px) {
  .lead-modal {
    padding: 0;
    align-items: flex-end;
    justify-content: flex-end;
  }

  .lead-modal-dialog {
    width: 92vw;
    max-width: 92vw;
    max-height: min(92dvh, 92svh);
    margin: 0 auto;
    border-radius: 14px 14px 0 0;
  }

  .lead-modal-header {
    padding-top: 1rem;
    padding-left: 1rem;
    padding-right: 2.85rem;
  }

  .lead-modal-body {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }
}

.lead-modal-dialog {
  position: relative;
}

.lead-modal-dialog.is-submitting .lead-modal-body {
  pointer-events: none;
  opacity: 0.45;
}

.lead-form-loading {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(255, 255, 255, 0.92);
}

.lead-form-loading.hidden {
  display: none !important;
}

.lead-form-loading .swmo-house-loader--panel {
  margin: 0 auto;
  max-width: 280px;
}
