/* ==========================================================================
   Wiztra Chat — exit-intent popup
   Pairs with js/exit-popup.js. Currently loaded by index.html only.

   The whole dialog ships as markup with the `hidden` attribute; the script only
   removes/reapplies that attribute and moves focus. No markup is built in JS and
   no style rule is assigned from JS, per the project conventions.

   NOTE ON TOKENS: this file is kept byte-identical in both builds. The gold
   folder predates the component-token refactor, so --primary-500c and friends
   do not exist there; every oklch() below therefore carries a var() fallback
   holding the gold value. The orange build has the tokens and picks them up.
   ========================================================================== */

/* --------------------------------------------------------------------------
   QA trigger — remove this block, and its markup in index.html, before
   the CMS upload. Not part of the shipped experience.
   -------------------------------------------------------------------------- */

.exitpop-test-btn {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 90;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid oklch(var(--background-200c, 0.92 0.006 80) / 0.9);
  background: #fff;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--foreground-700);
  box-shadow: 0 4px 14px rgb(0 0 0 / 0.18);
  cursor: pointer;
  transition: background-color .2s ease, transform .2s ease;
}
.exitpop-test-btn:hover { background: var(--background-100); transform: translateY(-1px); }

/* --------------------------------------------------------------------------
   Overlay
   -------------------------------------------------------------------------- */

.exitpop {
  position: fixed;
  inset: 0;
  z-index: 200;              /* above .site-nav (50) and .mobile-menu (60) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.exitpop[hidden] { display: none; }

.exitpop-scrim {
  position: absolute;
  inset: 0;
  background: oklch(var(--background-950c, 0.18 0.003 80) / 0.55);
  backdrop-filter: blur(3px);
  animation: exitpopFade .25s ease-out;
}

.exitpop-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 540px;
  margin: auto;
  border-radius: 24px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 30px 70px rgb(0 0 0 / 0.28);
  transform: scale(.9);            /* 10% smaller overall, incl. type & spacing */
  animation: exitpopRise .32s cubic-bezier(.2, .7, .3, 1);
}

@keyframes exitpopFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes exitpopRise {
  from { opacity: 0; transform: translateY(18px) scale(.873); }
  to   { opacity: 1; transform: translateY(0) scale(.9); }
}

/* --------------------------------------------------------------------------
   Close button
   -------------------------------------------------------------------------- */

.exitpop-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  width: 38px; height: 38px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--foreground-700);
  background: rgb(255 255 255 / 0.92);
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.12);
  transition: background-color .2s ease, transform .2s ease;
}
.exitpop-close:hover {
  background: #fff;
  transform: scale(1.06);
}

/* --------------------------------------------------------------------------
   Gradient header
   -------------------------------------------------------------------------- */

.exitpop-head {
  position: relative;
  overflow: hidden;
  padding: 34px 28px 30px;
  text-align: center;
  background: linear-gradient(125deg,
              var(--primary-600) 0%,
              var(--primary-500) 42%,
              #4bb894 100%);
}
@media (min-width: 480px) { .exitpop-head { padding: 40px 40px 34px; } }

/* Decorative bar-chart motif. Heights are fixed classes, not inline styles. */
.exitpop-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 7px;
  height: 62px;
  margin-bottom: 18px;
}
.exitpop-bars span {
  width: 12px;
  border-radius: 3px 3px 0 0;
  background: rgb(255 255 255 / 0.45);
}
.exitpop-bars span:nth-child(1) { height: 38%; }
.exitpop-bars span:nth-child(2) { height: 62%; }
.exitpop-bars span:nth-child(3) { height: 48%; }
.exitpop-bars span:nth-child(4) { height: 88%; }
.exitpop-bars span:nth-child(5) { height: 56%; }
.exitpop-bars span:nth-child(6) { height: 40%; }
.exitpop-bars span:nth-child(7) { height: 74%; }
.exitpop-bars span:nth-child(8) { height: 52%; }
.exitpop-bars span:nth-child(9) { height: 96%; }
.exitpop-bars span:nth-child(10){ height: 68%; }

/* Two faint floating dots, matching the reference. */
.exitpop-dot {
  position: absolute;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.28);
}
.exitpop-dot-1 { top: 30%; right: 16%; width: 10px; height: 10px; }
.exitpop-dot-2 { bottom: 12%; right: 27%; width: 13px; height: 13px; }

.exitpop-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 18px;
  margin-bottom: 18px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.22);
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
}
.exitpop-badge span {
  width: 8px; height: 8px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.85);
  animation: exitpopBlink 1.6s ease-in-out infinite;
}
@keyframes exitpopBlink {
  0%, 100% { opacity: .4; }
  50%      { opacity: 1; }
}

.exitpop-title {
  font-size: 28px;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 14px;
}
@media (min-width: 480px) { .exitpop-title { font-size: 34px; } }

.exitpop-sub {
  font-size: 14.5px;
  line-height: 1.6;
  color: rgb(255 255 255 / 0.9);
  max-width: 400px;
  margin-inline: auto;
}

/* --------------------------------------------------------------------------
   Body
   -------------------------------------------------------------------------- */

.exitpop-body {
  padding: 24px 24px 26px;
  text-align: center;
}
@media (min-width: 480px) { .exitpop-body { padding: 28px 36px 30px; } }

.exitpop-trust {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
  font-size: 14px;
  color: var(--foreground-700);
}
.exitpop-stars {
  display: inline-flex;
  gap: 3px;
  color: #10b981;
  font-size: 15px;
}

.exitpop-feats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-bottom: 22px;
}
.exitpop-feat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid oklch(var(--background-200c, 0.92 0.006 80) / 0.9);
  background: var(--background-100);
  font-size: 13px;
  color: var(--foreground-800);
}
.exitpop-feat i { font-size: 14px; color: var(--primary-600); }

/* ---- Email capture ---- */

.exitpop-form { margin-bottom: 14px; }

.exitpop-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
@media (min-width: 480px) { .exitpop-row { flex-direction: row; } }

.exitpop-input {
  flex: 1;
  min-width: 0;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid oklch(var(--background-200c, 0.92 0.006 80) / 0.9);
  background: var(--background-50);
  font-size: 14px;
  color: var(--foreground-900);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.exitpop-input::placeholder { color: var(--foreground-400); }
.exitpop-input:focus {
  outline: none;
  border-color: var(--primary-400);
  box-shadow: 0 0 0 3px oklch(var(--primary-300c, 0.88 0.15 85) / 0.4);
}

.exitpop-submit {
  flex-shrink: 0;
  padding: 13px 24px;
  font-size: 14px;
}

.exitpop-form .form-status { text-align: center; }

.exitpop-alt {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--primary-700);
  transition: color .2s ease;
}
.exitpop-alt:hover { color: var(--primary-800); }
.exitpop-alt i { font-size: 14px; }

.exitpop-dismiss {
  display: block;
  width: 100%;
  padding-top: 4px;
  font-size: 12.5px;
  color: var(--foreground-400);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .2s ease;
}
.exitpop-dismiss:hover { color: var(--foreground-600); }

.exitpop-fineprint {
  margin-top: 12px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--foreground-400);
}

/* --------------------------------------------------------------------------
   Reduced motion — the global rule in styles.css shortens these, but the
   entrance is explicitly removed so nothing slides.
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .exitpop-card,
  .exitpop-scrim { animation: none; }
  .exitpop-badge span { animation: none; opacity: .9; }
}
