/* WIA Popups — Inference Edge skin. Navy tinted-glass window with the teal
   brand accent (core --wia-* tokens); "white" accent for a plain window.
   Bulma's .modal supplies show/hide + centering. */

/* .modal.wia-popup: the theme's Bulma build loads after this file and
   .modal alone would win the z-index back (40, under the fixed header) */
.modal.wia-popup {
  z-index: 9999;
}

.wia-popup .modal-background {
  background: rgb(var(--wia-text-blue-rgb) / 0.78);
  backdrop-filter: blur(4px);
}

.wia-popup-box {
  --box-accent: var(--wia-teal);

  position: relative;
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  padding: 36px 32px 32px;
  border: 1px solid rgb(var(--wia-teal-rgb) / 0.45);
  border-radius: var(--radius-lg);
  background: rgb(var(--wia-text-blue-rgb) / 0.94);
  box-shadow: 0 0 48px rgb(var(--wia-teal-rgb) / 0.22);
  backdrop-filter: blur(10px);
}

.wia-popup-close {
  position: absolute;
  top: 12px;
  right: 16px;
  border: 0;
  background: none;
  color: rgb(255 255 255 / 0.6);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.wia-popup-close:hover {
  color: #fff;
}

.wia-popup-title {
  margin-bottom: 10px;
  padding-right: 24px;
  color: #fff;
  font-size: 1.5rem;
  font-weight: var(--fw-bold);
  line-height: 1.25;
}

.wia-popup-content {
  color: rgb(230 234 246 / 0.85);
  font-size: 0.9375rem;
}

.wia-popup-content p {
  color: inherit;
}

/* embedded forms on the navy glass. HubSpot developer embeds render into
   .hs-form-html, which the theme styles for a white surface; the selectors
   below carry that class so they win over the theme's rules. */
.wia-popup-content label,
.wia-popup-content .hs-form-html label,
.wia-popup-content .hs-form-html .hs-form-booleancheckbox-display,
.wia-popup-content .hs-form-html .hs-form-checkbox-display,
.wia-popup-content .hs-form-html .hs-form-radio-display {
  color: rgb(230 234 246 / 0.85);
}

.wia-popup-content .hs-form-html .hs-field-desc,
.wia-popup-content .hs-form-html .hs-richtext,
.wia-popup-content .hs-form-html .legal-consent-container {
  color: rgb(230 234 246 / 0.7);
}

.wia-popup-content .hs-form-html .hs-richtext a {
  color: #fff;
  border-bottom-color: rgb(255 255 255 / 0.35);
}

.wia-popup-content input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]),
.wia-popup-content select,
.wia-popup-content textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid rgb(255 255 255 / 0.2);
  border-radius: var(--radius-sm);
  background: rgb(255 255 255 / 0.08);
  color: #fff;
}

.wia-popup-content input::placeholder,
.wia-popup-content textarea::placeholder {
  color: rgb(230 234 246 / 0.5);
}

.wia-popup-content input:focus,
.wia-popup-content select:focus,
.wia-popup-content textarea:focus {
  border-color: var(--box-accent);
  outline: none;
}

.wia-popup-content input[type="submit"],
.wia-popup-content button[type="submit"] {
  width: 100%;
  padding: 10px 16px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--box-accent);
  color: #fff;
  font-weight: var(--fw-bold);
  cursor: pointer;
}

.wia-popup-content input[type="submit"]:hover,
.wia-popup-content button[type="submit"]:hover {
  filter: brightness(1.1);
}

/* ---- deferred embeds ----
   popups.js builds these on first open (see includes/deferred-forms.php), so
   there is a short wait where the box would otherwise be blank.

   The spinner is its own element, inserted and removed by the JS, and
   .wia-popup-form carries no styling at all: HubSpot injects a self-resizing
   iframe into that div and reads its own geometry back, so giving the
   container a display mode or a min-height risks pinning the form at the
   wrong height. Style the sibling, never the target. */
.wia-popup-spinner {
  display: block;
  width: 28px;
  height: 28px;
  margin: 32px auto;
  border: 2px solid rgb(255 255 255 / 0.25);
  border-top-color: var(--box-accent);
  border-radius: 50%;
  animation: wia-popup-spin 0.7s linear infinite;
}

@keyframes wia-popup-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .wia-popup-spinner {
    animation-duration: 2.4s;
  }
}

/* ---- action button ---- */
.wia-popup-action {
  margin-top: 20px;
}

.wia-popup-button {
  box-sizing: border-box;
  width: 100%;
  border-color: transparent;
  background: var(--box-accent);
  color: #fff;
}

.wia-popup-button:hover {
  border-color: transparent;
  background: var(--box-accent);
  color: #fff;
  filter: brightness(1.1);
}

/* ---- white window — page popups (pop_up_maker) + is-accent-white ---- */
.wia-popup--page .wia-popup-box,
.wia-popup.is-accent-white .wia-popup-box {
  border-color: rgb(var(--wia-text-blue-rgb) / 0.12);
  background: #fff;
  box-shadow: 0 24px 64px rgb(var(--wia-text-blue-rgb) / 0.35);
  backdrop-filter: none;
}

.wia-popup--page .wia-popup-close,
.wia-popup.is-accent-white .wia-popup-close {
  color: rgb(var(--wia-text-blue-rgb) / 0.45);
}

.wia-popup--page .wia-popup-close:hover,
.wia-popup.is-accent-white .wia-popup-close:hover {
  color: var(--wia-text-blue);
}

.wia-popup--page .wia-popup-title,
.wia-popup.is-accent-white .wia-popup-title {
  color: var(--wia-text-blue);
}

.wia-popup--page .wia-popup-content,
.wia-popup.is-accent-white .wia-popup-content {
  color: rgb(var(--wia-text-blue-rgb) / 0.75);
}

/* on white the theme's own HubSpot styling is right; only generic labels
   and controls need the dark values */
.wia-popup--page .wia-popup-content label,
.wia-popup.is-accent-white .wia-popup-content label,
.wia-popup--page .wia-popup-content .hs-form-html label,
.wia-popup.is-accent-white .wia-popup-content .hs-form-html label {
  color: var(--wia-blue);
}

.wia-popup--page .wia-popup-content .hs-form-html .hs-form-booleancheckbox-display,
.wia-popup.is-accent-white .wia-popup-content .hs-form-html .hs-form-booleancheckbox-display,
.wia-popup--page .wia-popup-content .hs-form-html .hs-form-checkbox-display,
.wia-popup.is-accent-white .wia-popup-content .hs-form-html .hs-form-checkbox-display,
.wia-popup--page .wia-popup-content .hs-form-html .hs-form-radio-display,
.wia-popup.is-accent-white .wia-popup-content .hs-form-html .hs-form-radio-display {
  color: var(--wia-text-blue);
}

.wia-popup--page .wia-popup-content .hs-form-html .hs-field-desc,
.wia-popup.is-accent-white .wia-popup-content .hs-form-html .hs-field-desc,
.wia-popup--page .wia-popup-content .hs-form-html .hs-richtext,
.wia-popup.is-accent-white .wia-popup-content .hs-form-html .hs-richtext,
.wia-popup--page .wia-popup-content .hs-form-html .legal-consent-container,
.wia-popup.is-accent-white .wia-popup-content .hs-form-html .legal-consent-container {
  color: var(--fg-secondary);
}

.wia-popup--page .wia-popup-content .hs-form-html .hs-richtext a,
.wia-popup.is-accent-white .wia-popup-content .hs-form-html .hs-richtext a {
  color: var(--wia-blue);
  border-bottom-color: rgb(var(--wia-blue-rgb) / 0.35);
}

.wia-popup--page .wia-popup-content input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]),
.wia-popup.is-accent-white .wia-popup-content input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]),
.wia-popup--page .wia-popup-content select,
.wia-popup.is-accent-white .wia-popup-content select,
.wia-popup--page .wia-popup-content textarea,
.wia-popup.is-accent-white .wia-popup-content textarea {
  border-color: var(--wia-gray);
  background: #fff;
  color: var(--wia-text-blue);
}

.wia-popup--page .wia-popup-content input::placeholder,
.wia-popup.is-accent-white .wia-popup-content input::placeholder,
.wia-popup--page .wia-popup-content textarea::placeholder,
.wia-popup.is-accent-white .wia-popup-content textarea::placeholder {
  color: var(--wia-gray-dark);
}

/* the spinner's muted ring is invisible on white */
.wia-popup--page .wia-popup-spinner,
.wia-popup.is-accent-white .wia-popup-spinner {
  border-color: rgb(var(--wia-text-blue-rgb) / 0.15);
  border-top-color: var(--box-accent);
}
