/* =====================================================================
   Homepage lead-capture pop-up (spec section 2)

   Rendered by officedesk_assessment_popup() on wp_footer, front page only.
   The panel borrows .glass-light-panel from style.css for its surface, so only
   the dialog mechanics and the pop-up's own type live here.

   The markup always ships and starts with the [hidden] attribute; popup.js
   removes that and adds .is-open when it decides to show it. Everything below
   is therefore inert until JS runs, which is what keeps a cached copy of the
   homepage from flashing a dialog at someone who has already dismissed it.
   ===================================================================== */

.od-popup {
  position: fixed;
  inset: 0;
  z-index: 1200; /* above .back-to-top-btn and the sticky header */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.od-popup[hidden] { display: none; }

.od-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 28, 56, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.28s ease;
}
.od-popup.is-open .od-popup-backdrop { opacity: 1; }

/* ---- Panel ---------------------------------------------------------- */
.od-popup-panel {
  position: relative;
  width: 100%;
  max-width: 520px;
  padding: 2.75rem 2.5rem 2.5rem;
  text-align: center;
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.od-popup.is-open .od-popup-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* A brand hairline along the top edge, the same tertiary -> primary -> accent
   sweep the assessment progress bar uses, so the two read as one flow. */
.od-popup-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 2.5rem;
  right: 2.5rem;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, var(--tertiary) 0%, var(--primary) 55%, var(--accent) 100%);
}

/* ---- Close ---------------------------------------------------------- */
.od-popup-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.od-popup-close:hover,
.od-popup-close:focus-visible {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ---- Type ----------------------------------------------------------- */
.od-popup-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.9rem;
}
.od-popup-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--secondary);
  margin: 0 0 0.75rem;
}
.od-popup-sub {
  color: #475569;
  font-size: 1rem;
  line-height: 1.65;
  margin: 0 auto 1.35rem;
  max-width: 40ch;
}
.od-popup-incentive {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  text-align: left;
  margin: 0 0 1.75rem;
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  background: rgba(161, 247, 254, 0.22);
  border: 1px solid rgba(69, 125, 191, 0.28);
  color: var(--secondary);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.55;
}
.od-popup-incentive i {
  color: var(--accent);
  margin-top: 0.2rem;
}

.od-popup-cta {
  width: 100%;
  justify-content: center;
  padding: 14px 28px;
  font-size: 1rem;
}

/* ---- Background scroll lock ---------------------------------------- */
/* Set by popup.js while the dialog is open. overflow:hidden alone would let the
   page jump to the top on some browsers, so the scroll position is pinned too. */
body.od-popup-open {
  overflow: hidden;
}

/* ---- Responsive ----------------------------------------------------- */
@media (max-width: 575px) {
  .od-popup { padding: 1rem; }
  .od-popup-panel { padding: 2.5rem 1.4rem 1.75rem; }
  .od-popup-panel::before { left: 1.4rem; right: 1.4rem; }
  .od-popup-title { font-size: 1.45rem; }
  .od-popup-sub { font-size: 0.95rem; }
}

/* ---- Reduced motion ------------------------------------------------- */
/* The dialog still appears, it just arrives rather than animating in. */
@media (prefers-reduced-motion: reduce) {
  .od-popup-backdrop,
  .od-popup-panel {
    transition: none;
  }
  .od-popup-panel { transform: none; }
}
