/* ============================================================
   NPF Core — the "verify your email" popup.

   WHAT THIS IS
   ------------
   wpjobster-child's `display_email_verification_popup()` (functions.php) prints
   a blocking overlay in `wp_footer` for every logged-in user whose
   `uz_email_verification` meta is not 1. It predates the redesign, so it still
   arrived as a peach gradient panel with 28px navy text — the one element on
   the dashboard that was not wearing the /account design. This is that popup
   wearing it.

   WHY CSS ONLY
   ------------
   The markup and the JavaScript stay with the child theme, untouched: the
   resend AJAX (`resend_verification_email` + its nonce), the 3-second
   `check_verification_status` poll, the `iscu_email_verified` postMessage
   listener and the gw_ads_flow redirect are all security- or flow-critical and
   none of them are presentation. Deleting this file returns the popup to its
   old look and changes nothing else.

   WHY IT IS ALL SCOPED TO #email-verify-popup
   -------------------------------------------
   The child theme's rules are in an inline <style> block printed in the footer,
   i.e. *after* this stylesheet in the document. Source order would hand every
   tie to the theme, so each rule here is anchored on the overlay's id — that
   outweighs the theme's single-class selectors on specificity and wins without
   a single !important.

   The envelope is drawn as a background image on ::before rather than added to
   the markup, so the design gains its icon while the child theme's template
   stays exactly as it emits it.
   ============================================================ */

#email-verify-popup {
  --npf-primary: #4f84c3;
  --npf-primary-dark: #3e6ea6;
  --npf-primary-soft: #e1eeff;
  --npf-ink: #020b18;
  --npf-muted: #677489;
  --npf-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --npf-font-body: "Inter", system-ui, -apple-system, sans-serif;
  --npf-font-display: "Inter Tight", "Inter", system-ui, sans-serif;

  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Padding, so the card never touches the viewport edge on small screens. */
  padding: 24px;
  /* Deep navy rather than neutral black: the same ink the rest of the design
     dims with, so the page behind reads as tinted instead of greyed out. */
  background: rgba(2, 11, 24, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-family: var(--npf-font-body);
  animation: npf-verify-fade 0.32s var(--npf-ease) both;
}

/* ---------- The card ---------- */

#email-verify-popup .email-verify-popup {
  box-sizing: border-box;
  width: 100%;
  max-width: 460px;
  padding: 40px 36px 36px;
  /* 24px is the auth panel's radius; see npf-auth.css. */
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(2, 11, 24, 0.24);
  text-align: center;
  animation: npf-verify-rise 0.38s var(--npf-ease) both;
}

/* The envelope. Inlined as a data URI so the popup needs no extra request and
   no file the child theme would have to reference. */
#email-verify-popup .email-verify-popup::before {
  content: "";
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background-color: var(--npf-primary-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233e6ea6' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='4.5' width='19' height='15' rx='3'/%3E%3Cpath d='m3.5 7.5 7.9 5.27a1 1 0 0 0 1.2 0L20.5 7.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 34px 34px;
}

#email-verify-popup .email-verify-popup h2 {
  margin: 0 0 12px;
  font-family: var(--npf-font-display);
  font-size: 25px;
  line-height: 1.28;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--npf-ink);
  text-transform: none;
}

#email-verify-popup .email-verify-popup p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  font-weight: 400;
  color: var(--npf-muted);
}

/* "Click here" is the only action in the popup, but the sentence continues
   outside the anchor ("… to resend."), so it stays a link rather than becoming
   a button — a button mid-sentence would read as a broken line. */
#email-verify-popup .email-verify-popup a {
  color: var(--npf-primary-dark);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.28s var(--npf-ease);
}

#email-verify-popup .email-verify-popup a:hover,
#email-verify-popup .email-verify-popup a:focus-visible {
  color: var(--npf-ink);
}

/* ---------- Resend feedback ----------
   Base = the transient "Sending…" state, which carries no class. The theme's
   JS reveals it with jQuery .show(), which writes an inline display, so the
   `display: none` here only ever hides it before the first click. */
#email-verify-popup #verification-message {
  display: none;
  margin-top: 22px;
  padding: 12px 16px;
  border: 1px solid #e4e7e9;
  border-radius: 12px;
  background: #f7f8fa;
  color: var(--npf-muted);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
}

#email-verify-popup #verification-message.success {
  display: block;
  border-color: #b7ecd0;
  background: #ecfdf3;
  color: #14804a;
}

#email-verify-popup #verification-message.error {
  display: block;
  border-color: #fbd5d5;
  background: #fef2f2;
  color: #b42318;
}

/* ---------- Motion ---------- */

@keyframes npf-verify-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes npf-verify-rise {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  #email-verify-popup,
  #email-verify-popup .email-verify-popup {
    animation: none;
  }
}

/* ---------- Small screens ---------- */

@media (max-width: 480px) {
  #email-verify-popup {
    padding: 16px;
  }

  #email-verify-popup .email-verify-popup {
    padding: 32px 24px 28px;
    border-radius: 20px;
  }

  #email-verify-popup .email-verify-popup::before {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    background-size: 30px 30px;
  }

  #email-verify-popup .email-verify-popup h2 {
    font-size: 21px;
  }

  #email-verify-popup .email-verify-popup p {
    font-size: 14px;
  }
}
