.lead-popup {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.lead-popup[hidden] { display: none !important; }

.lead-popup__backdrop {
  position: absolute; inset: 0;
  background: rgba(15,20,25,.55);
  backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .25s ease;
}
.lead-popup.is-open .lead-popup__backdrop { opacity: 1; }

.lead-popup__card {
  position: relative; z-index: 1;
  background: #fff; border-radius: 20px;
  padding: 32px 28px 28px;
  width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  transform: translateY(20px) scale(.97); opacity: 0;
  transition: transform .28s cubic-bezier(.34,1.46,.64,1), opacity .22s ease;
}
.lead-popup.is-open .lead-popup__card { transform: translateY(0) scale(1); opacity: 1; }

/* Reset browser default margins on all p/h inside popup */
.lead-popup p,
.lead-popup h3 { margin: 0; }

.lead-popup__close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; cursor: pointer;
  font-size: 18px; color: #9CA3AF; line-height: 1;
  padding: 6px; border-radius: 6px;
  transition: color .15s, background .15s;
}
.lead-popup__close:hover { color: #374151; background: #F3F4F6; }

.lead-popup__title {
  font: 700 22px/1.2 var(--font-sans, system-ui);
  color: var(--fg-1, #0F1419);
  margin-bottom: 4px !important;
}
.lead-popup__sub {
  font-size: 14px; color: var(--fg-2, #6B7280);
  margin-bottom: 20px !important;
}

.lead-popup__hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* Form: flex column, gap controls ALL spacing between items */
.lead-popup__form {
  display: flex; flex-direction: column; gap: 12px;
}

/* Override any .field margin-bottom that might come from other CSS files */
.lead-popup__form .field { margin-bottom: 0 !important; }

/* Errors: no space when empty */
.lead-popup__form .field__error {
  margin: 0 !important; padding: 0;
  font-size: 12px; color: #dc2626; line-height: 1.4;
}
.lead-popup__form .field__error:empty { display: none; }

.lead-popup__row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.lead-popup__row > .field { min-width: 0; }

/* Force selects and inputs to fill their container */
.lead-popup__form .field__input,
.lead-popup__form .field__select { width: 100%; min-width: 0; }

@media (max-width: 400px) { .lead-popup__row { grid-template-columns: 1fr; } }

.lead-popup__consent {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px; color: var(--fg-2, #6B7280);
  cursor: pointer; line-height: 1.4;
}
.lead-popup__consent input[type="checkbox"] { margin: 1px 0 0; flex-shrink: 0; accent-color: var(--accent, #FF5436); }
.lead-popup__consent a { color: var(--accent, #FF5436); }

.lead-popup__submit {
  width: 100%; justify-content: center;
  padding: 14px 24px; font-size: 16px; margin-top: 4px;
}
.lead-popup__submit:disabled { opacity: .6; cursor: default; }

.lead-popup__global-err {
  font-size: 13px; color: #dc2626;
  margin: 0 !important; line-height: 1.4;
}
.lead-popup__global-err:empty { display: none; }

/* Success state */
.lead-popup__success { text-align: center; padding: 12px 0; }
.lead-popup__success-icon {
  width: 60px; height: 60px; margin: 0 auto 14px;
  background: #dcfce7; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: #16a34a;
}
.lead-popup__success h3 { font: 700 20px/1.2 var(--font-sans, system-ui); margin-bottom: 6px !important; }
.lead-popup__success p { color: var(--fg-2, #6B7280); font-size: 14px; }

@media (max-width: 480px) {
  .lead-popup__card { padding: 24px 18px 22px; }
  .lead-popup__title { font-size: 20px; }
}
