/* ─────────────────────────────────────────────────────────────────────────
 * clever-prep-eyeq-modal.css
 * Auto-opening "Join the EyeQ beta" modal on /eyeq/.
 *
 * Animation language: backdrop fades + blurs in; panel scales up from
 * slightly smaller + translated, fades in. Soft expo-out easing for open
 * (smooth landing), faster ease-in for close — matches the modern "Vercel /
 * Framer Motion" modal feel.
 * ───────────────────────────────────────────────────────────────────────── */

.cp-eyeq-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483647;                 /* above page transition veil */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 32px);
  /* Initial (closed) state — backdrop fully transparent, no blur, no
     pointer events. Adding .is-open transitions to the open state. */
  background: rgba(15, 18, 23, 0);
  -webkit-backdrop-filter: blur(0) saturate(100%);
          backdrop-filter: blur(0) saturate(100%);
  opacity: 0;
  pointer-events: none;
  transition:
    background-color 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    -webkit-backdrop-filter 0.45s cubic-bezier(0.22, 1, 0.36, 1),
            backdrop-filter 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.cp-eyeq-modal.is-open {
  background: rgba(15, 18, 23, 0.55);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
          backdrop-filter: blur(14px) saturate(120%);
  opacity: 1;
  pointer-events: auto;
}
/* Faster, snappier easing for close (.is-closing wins over .is-open) */
.cp-eyeq-modal.is-closing {
  background: rgba(15, 18, 23, 0);
  -webkit-backdrop-filter: blur(0) saturate(100%);
          backdrop-filter: blur(0) saturate(100%);
  opacity: 0;
  transition:
    background-color 0.3s cubic-bezier(0.32, 0, 0.67, 0),
    -webkit-backdrop-filter 0.3s cubic-bezier(0.32, 0, 0.67, 0),
            backdrop-filter 0.3s cubic-bezier(0.32, 0, 0.67, 0),
    opacity 0.28s cubic-bezier(0.32, 0, 0.67, 0);
}

/* ── Modal panel ───────────────────────────────────────────────────────── */
.cp-eyeq-modal__panel {
  position: relative;
  background: #fff;
  border-radius: 24px;
  padding: clamp(28px, 4vw, 44px);
  max-width: 480px;
  width: 100%;
  box-shadow: 0 30px 80px -20px rgba(15, 18, 23, 0.35),
              0 6px 20px rgba(15, 18, 23, 0.08);
  /* Initial: slightly smaller + offset down + transparent */
  opacity: 0;
  transform: translateY(20px) scale(0.92);
  transform-origin: 50% 100%;
  transition:
    opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.cp-eyeq-modal.is-open .cp-eyeq-modal__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.cp-eyeq-modal.is-closing .cp-eyeq-modal__panel {
  opacity: 0;
  transform: translateY(20px) scale(0.94);
  transition:
    opacity 0.28s cubic-bezier(0.32, 0, 0.67, 0),
    transform 0.3s cubic-bezier(0.32, 0, 0.67, 0);
}

/* ── Close button (X top-right) ────────────────────────────────────────── */
.cp-eyeq-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(15, 18, 23, 0.05);
  color: var(--cp-text-headline, #28354A);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, transform 0.18s ease;
}
.cp-eyeq-modal__close:hover { background: rgba(15, 18, 23, 0.12); }
.cp-eyeq-modal__close:active { transform: scale(0.92); }
.cp-eyeq-modal__close svg { width: 14px; height: 14px; }

/* ── Content ───────────────────────────────────────────────────────────── */
.cp-eyeq-modal__label {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  background: rgba(40, 53, 74, 0.06);
  border-radius: 8px;
  font-family: var(--cp-font-mono, ui-monospace, monospace);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cp-text-headline, #28354A);
  margin-bottom: 16px;
}
.cp-eyeq-modal__title {
  font-family: var(--cp-font-heading, Georgia, serif);
  font-weight: 400;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--cp-text-headline, #28354A);
  margin: 0 0 12px;
}
.cp-eyeq-modal__body {
  font-family: var(--cp-font-body, system-ui, sans-serif);
  font-size: 15px;
  line-height: 1.55;
  color: var(--cp-text-secondary, #4a5568);
  margin: 0 0 22px;
}

/* ── Form (Brevo-wired) ────────────────────────────────────────────────── */
.cp-eyeq-modal__form { display: grid; gap: 12px; }
.cp-eyeq-modal__form label {
  font-family: var(--cp-font-mono, ui-monospace);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cp-text-meta, rgba(15, 18, 23, 0.55));
}
.cp-eyeq-modal__form input[type="email"],
.cp-eyeq-modal__form input[type="text"] {
  width: 100%;
  height: 50px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--cp-border-input, rgba(15, 18, 23, 0.14));
  border-radius: 12px;
  font-family: var(--cp-font-body, system-ui);
  font-size: 15px;
  color: var(--cp-text-headline, #28354A);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.cp-eyeq-modal__form input[type="email"]:focus,
.cp-eyeq-modal__form input[type="text"]:focus {
  outline: none;
  border-color: var(--cp-orange, #ED863C);
  box-shadow: 0 0 0 3px rgba(237, 134, 60, 0.18);
}
/* Spam honeypot injected by the Brevo capture script. The plugin
   registers its own offscreen-position style globally but it's not always
   enqueued on every page — belt-and-braces hide it here too. */
.cp-eyeq-modal__form .cpbrevo-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}
.cp-eyeq-modal__form input::placeholder {
  color: var(--cp-text-muted, rgba(15, 18, 23, 0.4));
}
.cp-eyeq-modal__form .cp-btn {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
}
.cp-eyeq-modal__note {
  font-family: var(--cp-font-body, system-ui);
  font-size: 12px;
  color: var(--cp-text-meta, rgba(15, 18, 23, 0.55));
  margin: 10px 0 0;
  text-align: center;
}

/* Brevo capture.js success/error states. */
.cpbrevo-success {
  font-family: var(--cp-font-body, system-ui);
  font-size: 15px;
  color: var(--cp-text-headline, #28354A);
  padding: 24px;
  text-align: center;
}
.cp-eyeq-modal .cpbrevo-error {
  font-size: 13px;
  color: var(--cp-pill-red, #EB4E53);
  margin: 4px 0 0;
}

/* prevent scroll when modal open */
html.cp-eyeq-modal-open, html.cp-eyeq-modal-open body { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .cp-eyeq-modal,
  .cp-eyeq-modal__panel { transition: opacity 0.15s linear !important; transform: none !important; }
}
