/* Marketing lead-capture popup (Funnel C) — "fill a short survey, get a discount code".
   Injected + shown only when GET /external/marketing/promo-availability says there's an active
   campaign for the visitor's country; see promo-popup.js. Uses the site's existing design tokens
   (hubtoll.css :root vars) so it reads as part of the site, not a bolted-on widget. */

.promo-popup__overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 41, 0.55);
  backdrop-filter: blur(2px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  /* Closed but NOT display:none (needed for the fade transition) — pointer-events:none is essential here:
     without it this full-viewport overlay stays fully mouse-interactive while merely invisible, silently
     intercepting every click/hover on the page underneath (the exact class of bug found + fixed today in the
     products mega menu — visibility:hidden alone isn't reliable across a whole subtree if any descendant
     resets it, and opacity:0 alone never blocks interactivity at all). */
  pointer-events: none;
  transition: opacity 0.22s var(--ease, ease);
}
.promo-popup__overlay.is-open {
  pointer-events: auto;
  opacity: 1;
}

.promo-popup {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--bg, #fff);
  border-radius: var(--radius-lg, 22px);
  box-shadow: var(--shadow-lg, 0 30px 70px rgba(13, 19, 64, 0.18));
  padding: 32px 28px 26px;
  transform: translateY(14px) scale(0.98);
  transition: transform 0.24s var(--ease, ease);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
.promo-popup__overlay.is-open .promo-popup {
  transform: translateY(0) scale(1);
}

.promo-popup__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg-soft, #f6f8fc);
  color: var(--muted, #5d6a85);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.promo-popup__close:hover {
  background: var(--bg-soft-2, #eef2fa);
  color: var(--text-strong, #14193a);
}

.promo-popup__badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: var(--radius-pill, 999px);
  background: var(--grad-accent, linear-gradient(135deg, #ff9c5b, #ee6a16));
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.promo-popup__title {
  margin: 0 0 6px;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-strong, #14193a);
  line-height: 1.25;
}

/* The specific offer's own terms (PromoCode.description) — set apart from the generic subtitle below it so
   the two read as distinct sentences ("here's the deal" vs "here's what happens next"), not one run-on
   paragraph. A left accent bar + tinted background keep it from being mistaken for a warning/error block. */
.promo-popup__terms {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-left: 3px solid var(--accent-500, #f97e30);
  border-radius: 6px;
  background: var(--bg-soft, #f6f8fc);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-strong, #14193a);
  line-height: 1.45;
}

.promo-popup__subtitle {
  margin: 0 0 18px;
  font-size: 0.92rem;
  color: var(--muted, #5d6a85);
  line-height: 1.5;
}

.promo-popup__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.promo-popup__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 420px) {
  .promo-popup__row {
    grid-template-columns: 1fr;
  }
}

.promo-popup__field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-strong, #14193a);
  margin-bottom: 5px;
}
.promo-popup__field input,
.promo-popup__field select {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius-sm, 10px);
  border: 1.5px solid var(--line-strong, #d6dcea);
  font-family: inherit;
  font-size: 0.94rem;
  color: var(--text-strong, #14193a);
  background: #fff;
  transition: border-color 0.15s ease;
}
.promo-popup__field input:focus,
.promo-popup__field select:focus {
  outline: none;
  border-color: var(--accent-500, #f97e30);
}

.promo-popup__consent {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 4px;
}
.promo-popup__consent input {
  margin-top: 3px;
  flex: 0 0 auto;
}
.promo-popup__consent span {
  font-size: 0.78rem;
  color: var(--muted, #5d6a85);
  line-height: 1.45;
}

.promo-popup__error {
  font-size: 0.82rem;
  color: #c0392b;
  margin: 0;
  display: none;
}
.promo-popup__error.is-visible {
  display: block;
}

.promo-popup__submit {
  margin-top: 6px;
  width: 100%;
  border: none;
}
.promo-popup__submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Success state — the popup swaps its body to this once a code is issued. */
.promo-popup__success {
  display: none;
  text-align: center;
}
.promo-popup__success.is-visible {
  display: block;
}
.promo-popup__success-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--bg-soft-2, #eef2fa);
  color: var(--accent-600, #ee6a16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}
.promo-popup__code-box {
  margin: 16px 0;
  padding: 18px;
  border-radius: var(--radius, 16px);
  background: var(--bg-soft-2, #eef2fa);
  border: 1.5px dashed var(--accent-500, #f97e30);
}
.promo-popup__code-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-600, #ee6a16);
  margin: 0 0 6px;
}
.promo-popup__code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--navy-700, #131b44);
  margin: 0;
  word-break: break-all;
}

.promo-popup__copy {
  margin-top: 10px;
  border: none;
  background: none;
  color: var(--accent-600, #ee6a16);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
}
.promo-popup__copy:hover {
  text-decoration: underline;
}

/* Respect the visitor's motion preference (site.js reads this same media query app-wide). */
@media (prefers-reduced-motion: reduce) {
  .promo-popup__overlay,
  .promo-popup {
    transition: none !important;
  }
}
