/* Popup lead modal — shared across site pages */

.modal-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(10, 42, 74, 0.35), transparent 55%),
    rgba(10, 22, 36, 0.62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
  overflow: visible;
  z-index: 1000;
}

.modal {
  --popup-navy: #0a2a4a;
  --popup-gold: #c9a227;
  --popup-border: #d5dce5;
  --popup-muted: #6b7888;

  position: relative;
  width: min(440px, 92%);
  max-width: 440px;
  padding: 28px 26px 24px;
  border-radius: 18px;
  border: 1px solid rgba(213, 220, 229, 0.95);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(201, 162, 39, 0.12), transparent 45%),
    radial-gradient(90% 70% at 0% 100%, rgba(10, 42, 74, 0.06), transparent 50%),
    linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
  box-shadow:
    0 24px 60px rgba(10, 42, 74, 0.22),
    0 2px 8px rgba(10, 42, 74, 0.08);
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: center;
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--popup-navy);
  overflow: visible;
  animation: popupIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 3px;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(90deg, var(--popup-navy), var(--popup-gold), var(--popup-navy));
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  color: var(--popup-muted);
  background: rgba(10, 42, 74, 0.04);
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.modal-close:hover,
.modal-close:focus-visible {
  color: var(--popup-navy);
  background: rgba(10, 42, 74, 0.1);
  outline: none;
  transform: scale(1.04);
}

.modal-content-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px 0;
}

.modal-content {
  width: 100%;
}

.modal-content h3 {
  margin: 0 0 10px;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.35rem, 3.2vw, 1.65rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--popup-navy);
}

.modal-content h2 {
  margin: 0 auto 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 999px;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--popup-navy);
  background: rgba(201, 162, 39, 0.18);
  border: 1px solid rgba(201, 162, 39, 0.45);
  transform-origin: center center;
  animation: titlePulse 2.4s ease-in-out infinite;
}

.modal-content p {
  margin: 0 auto;
  max-width: 34ch;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--popup-muted);
}

.modal-form {
  display: flex;
  width: 100%;
  margin: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 11px;
}

.modal-form .input-text {
  width: 100%;
  height: 46px;
  box-sizing: border-box;
  padding: 0 14px;
  border: 1px solid var(--popup-border);
  border-radius: 10px;
  background: #fff;
  color: var(--popup-navy);
  font-size: 0.95rem;
  font-family: "DM Sans", system-ui, sans-serif;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.modal-form .input-text::placeholder {
  color: #93a0af;
}

.modal-form .input-text:focus {
  border-color: var(--popup-gold);
  box-shadow: 0 0 0 3px rgba(10, 42, 74, 0.1);
  outline: none;
}

.modal-form .input-submit {
  width: 100%;
  margin-top: 4px;
  padding: 12px 20px;
  border: 1.5px solid var(--popup-navy);
  border-radius: 10px;
  background: var(--popup-navy);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  font-family: "DM Sans", system-ui, sans-serif;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.modal-form .input-submit:hover {
  background: #fff;
  color: var(--popup-navy);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(10, 42, 74, 0.12);
}

.modal-form .input-submit:active {
  transform: translateY(0);
}

.modal-overlay .phone-row {
  width: 100%;
}

.modal-overlay .phone-row .iti {
  width: 100%;
  display: block;
}

.modal-overlay .phone-row .iti input,
.modal-overlay .phone-row input {
  width: 100%;
  height: 46px;
  box-sizing: border-box;
  border-radius: 10px;
  border: 1px solid var(--popup-border);
  background: #fff;
  color: var(--popup-navy);
  font-size: 0.95rem;
  font-family: "DM Sans", system-ui, sans-serif;
  padding-right: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.modal-overlay .phone-row .iti input:focus,
.modal-overlay .phone-row input:focus {
  border-color: var(--popup-gold);
  box-shadow: 0 0 0 3px rgba(10, 42, 74, 0.1);
  outline: none;
}

.modal-overlay .phone-row .iti__selected-flag {
  padding: 0 10px 0 12px;
  border-radius: 10px 0 0 10px;
}

.modal-overlay .phone-row .iti__country-list {
  border-radius: 10px;
  border-color: var(--popup-border);
  box-shadow: 0 12px 28px rgba(10, 42, 74, 0.14);
  text-align: left;
  z-index: 30;
}

@keyframes titlePulse {
  0%,
  100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

@keyframes popupIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 600px) {
  .modal {
    padding: 24px 18px 20px;
    gap: 14px;
  }

  .modal-content h3 {
    font-size: 1.3rem;
    padding-right: 24px;
  }

  .modal-content h2 {
    font-size: 0.98rem;
    margin-bottom: 10px;
  }

  .modal-content p {
    font-size: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal {
    animation: none;
  }

  .modal-content h2 {
    animation: none;
  }

  .modal-form .input-submit:hover {
    transform: none;
  }
}
