/* Lead popup (partials/lead_popup.html). Brand navy + accent green, matching .cta-section. */
dialog.lead-popup {
  --lp-bg: #001327;
  --lp-panel: #04203a;
  --lp-border: #0f3a5e;
  --lp-text: #F9FAFB;
  --lp-muted: #A8B4C2;
  --lp-accent: #39FF12;
  --lp-accent-ink: #001327;
  --lp-error: #ff8a80;

  /* Centre explicitly: article.css resets `* { margin: 0 }`, which strips the
     browser's own auto margin and pins a modal dialog to the top-left. */
  position: fixed;
  inset: 0;
  margin: auto;
  height: fit-content;
  width: min(30rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  padding: 2rem;
  border: 1px solid var(--lp-border);
  border-radius: 14px;
  background: linear-gradient(135deg, var(--lp-bg) 0%, #002a4a 100%);
  color: var(--lp-text);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.lead-popup::backdrop {
  background: rgba(0, 10, 20, 0.6);
}

.lead-popup[open] {
  animation: lead-popup-in 0.25s ease-out;
}

@keyframes lead-popup-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.lead-popup-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  background: none;
  color: var(--lp-muted);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.lead-popup-close:hover,
.lead-popup-close:focus-visible {
  color: var(--lp-text);
}

.lead-popup-title {
  margin: 0 2rem 0.5rem 0;
  font-size: 1.5rem;
  line-height: 1.25;
  color: var(--lp-text);
}

.lead-popup-text {
  margin: 0 0 1.25rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--lp-muted);
}

.lead-popup-row {
  margin-bottom: 0.875rem;
}

.lead-popup-row label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--lp-text);
}

.lead-popup-optional {
  font-weight: 400;
  color: var(--lp-muted);
}

.lead-popup-row input {
  box-sizing: border-box;
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--lp-border);
  border-radius: 6px;
  background: var(--lp-panel);
  color: var(--lp-text);
  font: inherit;
  font-size: 1rem; /* 16px stops iOS zooming on focus */
}

.lead-popup-row input:focus {
  outline: 2px solid var(--lp-accent);
  outline-offset: 1px;
  border-color: transparent;
}

.lead-popup-row input[aria-invalid="true"] {
  border-color: var(--lp-error);
}

/* Honeypot: off-screen rather than display:none, which some bots skip. */
.lead-popup-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.lead-popup-error {
  margin: 0 0 0.875rem;
  font-size: 0.9rem;
  color: var(--lp-error);
}

.lead-popup-submit {
  display: block;
  box-sizing: border-box;
  width: 100%;
  padding: 0.9rem 1.5rem;
  border: 0;
  border-radius: 6px;
  background: var(--lp-accent);
  color: var(--lp-accent-ink);
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.2s;
}

.lead-popup-submit:hover {
  filter: brightness(0.92);
}

.lead-popup-submit:disabled {
  opacity: 0.6;
  cursor: wait;
}

.lead-popup-legal {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  color: var(--lp-muted);
}

.lead-popup-legal a {
  color: var(--lp-text);
}

/* Phones: a bottom sheet instead of a centred card. */
@media (max-width: 600px) {
  dialog.lead-popup {
    width: 100vw;
    max-width: 100vw;
    margin: auto 0 0;
    inset: auto 0 0;
    padding: 1.5rem 1rem calc(1.5rem + env(safe-area-inset-bottom));
    border-radius: 14px 14px 0 0;
    border-bottom: 0;
  }

  .lead-popup-title {
    font-size: 1.3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lead-popup[open] {
    animation: none;
  }
}
