/* ============================================================
   LEAD GENERATION COMPONENTS — Popup & Sticky CTA Styles
   Exit Intent Popup + Mobile Sticky CTA Bar
   ============================================================ */

/* ── Exit Intent Popup Overlay ─────────────────────────────── */
.exit-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 11, 24, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-normal) var(--ease-smooth),
              visibility var(--duration-normal) var(--ease-smooth);
  padding: var(--space-md);
}

.exit-popup-overlay--visible {
  opacity: 1;
  visibility: visible;
}

/* ── Exit Intent Popup Modal ───────────────────────────────── */
.exit-popup {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: rgba(13, 18, 36, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5),
              0 0 60px rgba(37, 99, 235, 0.08);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  overflow: hidden;

  /* Entrance animation */
  transform: scale(0.9) translateY(10px);
  opacity: 0;
  transition: transform var(--duration-slow) var(--ease-spring),
              opacity var(--duration-normal) var(--ease-smooth);
}

.exit-popup-overlay--visible .exit-popup {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Closing animation */
.exit-popup-overlay--closing .exit-popup {
  transform: scale(0.9) translateY(10px);
  opacity: 0;
}

.exit-popup-overlay--closing {
  opacity: 0;
}

/* Decorative top gradient line */
.exit-popup::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary-400), var(--color-accent-400));
}

/* Subtle mesh glow behind popup */
.exit-popup::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -30%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Close Button ──────────────────────────────────────────── */
.exit-popup__close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.125rem;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
  z-index: 2;
  line-height: 1;
}

.exit-popup__close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.15);
}

/* ── Popup Content ─────────────────────────────────────────── */
.exit-popup__body {
  position: relative;
  z-index: 1;
}

.exit-popup__icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
  display: block;
}

.exit-popup__title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-white);
  line-height: 1.25;
  margin-bottom: var(--space-sm);
  letter-spacing: -0.015em;
}

.exit-popup__subtitle {
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.6;
  margin-bottom: var(--space-xl);
}

/* ── Popup Form ────────────────────────────────────────────── */
.exit-popup__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.exit-popup__input {
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-size: 1rem;
  font-family: var(--font-body);
  transition: all 0.3s var(--ease-out);
  outline: none;
}

.exit-popup__input:focus {
  border-color: var(--color-primary-400);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12),
              0 0 24px rgba(37, 99, 235, 0.08);
  background: rgba(255, 255, 255, 0.06);
}

.exit-popup__input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

/* Invalid shake animation */
.exit-popup__input--error {
  border-color: var(--color-error-500) !important;
  animation: popup-shake 0.4s ease;
}

/* ── Submit Button ─────────────────────────────────────────── */
.exit-popup__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 16px 24px;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-white);
  background: var(--gradient-cta);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.3),
              var(--shadow-inner-glow);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.01em;
}

.exit-popup__btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 60%);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-smooth);
}

.exit-popup__btn:hover {
  background: var(--gradient-cta-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.exit-popup__btn:hover::before {
  opacity: 1;
}

.exit-popup__btn:active {
  transform: translateY(0);
}

.exit-popup__btn--loading {
  pointer-events: none;
  opacity: 0.7;
}

/* ── Privacy Note ──────────────────────────────────────────── */
.exit-popup__privacy {
  text-align: center;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.35);
  margin-top: var(--space-sm);
}

/* ── Success State ─────────────────────────────────────────── */
.exit-popup__success {
  text-align: center;
  padding: var(--space-xl) 0;
}

.exit-popup__success-icon {
  font-size: 3.5rem;
  margin-bottom: var(--space-lg);
  display: block;
  animation: popup-bounce-in 0.6s var(--ease-spring);
}

.exit-popup__success-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: var(--space-sm);
}

.exit-popup__success-text {
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.65;
}

/* ── Popup Animations ──────────────────────────────────────── */
@keyframes popup-shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(3px); }
}

@keyframes popup-bounce-in {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* ── Popup Responsive ──────────────────────────────────────── */
@media (max-width: 480px) {
  .exit-popup {
    padding: var(--space-xl) var(--space-lg);
  }

  .exit-popup__title {
    font-size: 1.25rem;
  }

  .exit-popup__subtitle {
    font-size: 0.875rem;
  }
}


/* ============================================================
   STICKY CTA BAR — Mobile Only
   ============================================================ */

.sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: rgba(13, 18, 36, 0.92);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.35);

  /* Hidden by default (slides down) */
  transform: translateY(100%);
  transition: transform var(--duration-normal) var(--ease-out);
}

.sticky-cta--visible {
  transform: translateY(0);
}

.sticky-cta__inner {
  display: flex;
  gap: 4px;
  padding: 8px;
  max-width: var(--container-max);
  margin: 0 auto;
}

/* ── CTA Buttons ───────────────────────────────────────────── */
.sticky-cta__btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 4px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.6875rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.sticky-cta__btn:active {
  transform: scale(0.95);
}

.sticky-cta__icon {
  font-size: 1.25rem;
  line-height: 1;
}

.sticky-cta__label {
  line-height: 1;
  white-space: nowrap;
}

/* Call Button — Green tint */
.sticky-cta__btn--call {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.15);
  color: var(--color-accent-400);
}

.sticky-cta__btn--call:hover {
  background: rgba(16, 185, 129, 0.18);
  color: var(--color-accent-300);
}

/* WhatsApp Button — WhatsApp green */
.sticky-cta__btn--whatsapp {
  background: rgba(37, 211, 102, 0.1);
  border-color: rgba(37, 211, 102, 0.15);
  color: #25D366;
}

.sticky-cta__btn--whatsapp:hover {
  background: rgba(37, 211, 102, 0.18);
  color: #2EE673;
}

/* NEET Button — Primary blue/purple */
.sticky-cta__btn--neet {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.15);
  color: var(--color-primary-400);
}

.sticky-cta__btn--neet:hover {
  background: rgba(37, 99, 235, 0.18);
  color: var(--color-primary-300);
}

/* ── Body padding offset when CTA is visible ───────────────── */
body.sticky-cta-active {
  padding-bottom: 72px;
}

/* ── Hide Sticky CTA on Desktop ────────────────────────────── */
@media (min-width: 769px) {
  .sticky-cta {
    display: none !important;
  }

  body.sticky-cta-active {
    padding-bottom: 0;
  }
}

/* ── Fine-tune on very small screens ───────────────────────── */
@media (max-width: 360px) {
  .sticky-cta__btn {
    padding: 8px 2px;
    font-size: 0.625rem;
  }

  .sticky-cta__icon {
    font-size: 1.125rem;
  }
}
