/*
 * EventPassHero — WooCommerce Checkout Processing Overlay
 *
 * Self-contained styles for #eph-wc-checkout-overlay.
 * z-index 9998: above WC blockUI (~1000) and Stripe Elements iframes,
 * but below the Stripe 3DS challenge modal (~999998+) so the bank's
 * verification UI remains interactive.
 *
 * Suppresses WC's built-in blockUI spinner only while our overlay is
 * active (body.eph-overlay-active) — WC blockUI continues to work for
 * unrelated AJAX (cart fragments, coupon updates, etc.).
 */

#eph-wc-checkout-overlay[hidden] {
  display: none !important;
}

#eph-wc-checkout-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  color: #1c1c1e;
  -webkit-font-smoothing: antialiased;
  animation: eph-wc-overlay-fadein 180ms ease-out;
}

#eph-wc-checkout-overlay * {
  box-sizing: border-box;
}

@keyframes eph-wc-overlay-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}

#eph-wc-checkout-overlay .eph-wc-overlay__card {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 16px;
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.12),
    0 2px 6px rgba(0, 0, 0, 0.06);
  padding: 32px 28px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* ----- Spinner (CSS-only, palette-tinted) -------------------------- */

#eph-wc-checkout-overlay .eph-wc-overlay__spinner {
  position: relative;
  width: 56px;
  height: 56px;
  margin-bottom: 4px;
}

#eph-wc-checkout-overlay .eph-wc-overlay__spinner div {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid transparent;
  border-top-color: #EE4B2A; /* matches default palette primary */
  animation: eph-wc-overlay-spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}
#eph-wc-checkout-overlay .eph-wc-overlay__spinner div:nth-child(2) { animation-delay: -0.15s; opacity: 0.75; }
#eph-wc-checkout-overlay .eph-wc-overlay__spinner div:nth-child(3) { animation-delay: -0.3s;  opacity: 0.5; }
#eph-wc-checkout-overlay .eph-wc-overlay__spinner div:nth-child(4) { animation-delay: -0.45s; opacity: 0.25; }

@keyframes eph-wc-overlay-spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ----- Headline + body --------------------------------------------- */

#eph-wc-checkout-overlay .eph-wc-overlay__headline {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  line-height: 1.25;
  letter-spacing: -0.2px;
  color: #1c1c1e;
}

#eph-wc-checkout-overlay .eph-wc-overlay__body {
  font-size: 14px;
  line-height: 1.55;
  color: #4a4a4f;
  margin: 0;
  max-width: 440px;
}

#eph-wc-checkout-overlay .eph-wc-overlay__body a {
  color: #EE4B2A;
  font-weight: 600;
  text-decoration: underline;
}

/* ----- Step indicator ---------------------------------------------- */

#eph-wc-checkout-overlay .eph-wc-overlay__steps {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  gap: 6px;
  width: 100%;
  max-width: 440px;
  justify-content: space-between;
}

#eph-wc-checkout-overlay .eph-wc-overlay__step {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #c7c7cc;
  font-weight: 500;
  text-align: center;
  letter-spacing: 0.3px;
  position: relative;
}

#eph-wc-checkout-overlay .eph-wc-overlay__step-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #e5e5ea;
  border: 2px solid #e5e5ea;
  transition: background 200ms, border-color 200ms;
}

#eph-wc-checkout-overlay .eph-wc-overlay__step.is-active .eph-wc-overlay__step-dot {
  background: #EE4B2A;
  border-color: #EE4B2A;
  box-shadow: 0 0 0 4px rgba(238, 75, 42, 0.18);
  animation: eph-wc-overlay-pulse 1.6s ease-in-out infinite;
}

#eph-wc-checkout-overlay .eph-wc-overlay__step.is-done .eph-wc-overlay__step-dot {
  background: #1F7A53;
  border-color: #1F7A53;
}

#eph-wc-checkout-overlay .eph-wc-overlay__step.is-active,
#eph-wc-checkout-overlay .eph-wc-overlay__step.is-done {
  color: #1c1c1e;
}

@keyframes eph-wc-overlay-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(238, 75, 42, 0.18); }
  50%      { box-shadow: 0 0 0 8px rgba(238, 75, 42, 0.10); }
}

/* ----- Elapsed counter --------------------------------------------- */

#eph-wc-checkout-overlay .eph-wc-overlay__elapsed {
  font-size: 11px;
  color: #8a8a8e;
  margin: 0;
  letter-spacing: 0.4px;
}

#eph-wc-checkout-overlay .eph-wc-overlay__elapsed-label {
  text-transform: uppercase;
  font-weight: 600;
}

#eph-wc-checkout-overlay .eph-wc-overlay__elapsed-value {
  font-variant-numeric: tabular-nums;
  color: #1c1c1e;
}

/* ----- Footer reassurance ------------------------------------------ */

#eph-wc-checkout-overlay .eph-wc-overlay__footer {
  font-size: 11px;
  color: #6e6e73;
  margin: 4px 0 0;
  padding-top: 12px;
  border-top: 1px solid #f2f2f7;
  width: 100%;
  max-width: 440px;
  letter-spacing: 0.2px;
  line-height: 1.45;
}

/* ----- WC blockUI suppression -------------------------------------- *
 * Hide WC's small built-in spinner while our overlay is up so users
 * don't see two competing loading states. Scoped strictly to when our
 * overlay is active — WC blockUI continues to work for fragment
 * updates, coupon application, etc.
 */
body.eph-overlay-active .blockUI,
body.eph-overlay-active .blockOverlay,
body.eph-overlay-active .blockMsg {
  display: none !important;
}

/* ----- Accessibility / motion preferences -------------------------- */

@media (prefers-reduced-motion: reduce) {
  #eph-wc-checkout-overlay {
    animation: none;
  }
  #eph-wc-checkout-overlay .eph-wc-overlay__spinner div {
    animation: none;
    border-top-color: transparent;
    border: 4px solid #EE4B2A;
    opacity: 0.85;
  }
  #eph-wc-checkout-overlay .eph-wc-overlay__step.is-active .eph-wc-overlay__step-dot {
    animation: none;
  }
}

/* ----- Mobile -------------------------------------------------------- */

@media (max-width: 480px) {
  #eph-wc-checkout-overlay {
    padding: 16px;
  }
  #eph-wc-checkout-overlay .eph-wc-overlay__card {
    padding: 24px 18px 18px;
  }
  #eph-wc-checkout-overlay .eph-wc-overlay__headline {
    font-size: 18px;
  }
  #eph-wc-checkout-overlay .eph-wc-overlay__body {
    font-size: 13px;
  }
  #eph-wc-checkout-overlay .eph-wc-overlay__step-label {
    font-size: 10px;
    line-height: 1.2;
  }
}
