/* ==========================================================================
   Exit Intent Banner - CreatorFlow
   Clean white modal matching reference design
   ========================================================================== */

/* Exit Banner Container - Fixed overlay */
.exit-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: exitBannerFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.exit-banner.active {
  display: flex;
}

@keyframes exitBannerFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Overlay - Dark backdrop */
.exit-banner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Modal - White background matching reference */
.exit-banner-modal {
  position: relative;
  background: #ffffff;
  border-radius: 20px;
  max-width: 460px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  animation: exitBannerSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1;
}

@keyframes exitBannerSlideUp {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Close Button - Circular gray background matching reference */
.exit-banner-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: #f3f4f6;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #9ca3af;
  transition: all 0.15s ease;
  z-index: 10;
}

.exit-banner-close:hover {
  background: #e5e7eb;
  color: #374151;
}

.exit-banner-close:focus {
  outline: 2px solid #000000;
  outline-offset: 2px;
}

.exit-banner-close:focus:not(:focus-visible) {
  outline: none;
}

.exit-banner-close:focus-visible {
  outline: 2px solid #000000;
  outline-offset: 2px;
}

.exit-banner-close svg {
  width: 20px;
  height: 20px;
}

/* Content - Centered layout with proper spacing */
.exit-banner-content {
  padding: 2.75rem 2.5rem 2rem;
  box-sizing: border-box;
}

/* Header */
.exit-banner-header {
  margin-bottom: 2rem;
}

.exit-banner-title {
  font-family: 'Stack Sans Headline', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1.625rem;
  font-weight: 700;
  color: #000000;
  margin: 0 0 0.625rem 0;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.exit-banner-sparkle {
  font-style: normal;
}

.exit-banner-subtitle {
  font-family: 'Stack Sans Headline', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1rem;
  color: #4b5563;
  margin: 0;
  line-height: 1.5;
}

/* Form - Native form matching reference design */
.exit-banner-form {
  margin-bottom: 1.25rem;
}

/* Input wrapper - contains email and submit button */
.exit-banner-input-wrapper {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1.5px solid #1f2937;
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 1.25rem;
  padding: 0.25rem;
}

.exit-banner-email {
  flex: 1;
  min-width: 0;
  padding: 0.875rem 1.25rem;
  font-family: 'Stack Sans Headline', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1rem;
  color: #000000;
  background: transparent;
  border: none;
  outline: none;
}

.exit-banner-email::placeholder {
  color: #9ca3af;
}

.exit-banner-email:focus {
  outline: none;
}

/* Submit button - black pill inside input */
.exit-banner-submit {
  flex-shrink: 0;
  padding: 0.875rem 1.75rem;
  font-family: 'Stack Sans Headline', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  background: #000000;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  white-space: nowrap;
}

.exit-banner-submit:hover {
  background: #1f2937;
}

.exit-banner-submit:focus {
  outline: 2px solid #000000;
  outline-offset: 2px;
}

.exit-banner-submit:focus:not(:focus-visible) {
  outline: none;
}

.exit-banner-submit:focus-visible {
  outline: 2px solid #000000;
  outline-offset: 2px;
}

/* Checkbox wrapper */
.exit-banner-checkbox-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  justify-content: center;
}

/* Custom checkbox matching reference */
.exit-banner-checkbox {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 0;
  margin-top: 3px;
  appearance: none;
  -webkit-appearance: none;
  background: #ffffff;
  border: 1.5px solid #d1d5db;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.exit-banner-checkbox:hover {
  border-color: #9ca3af;
}

.exit-banner-checkbox:checked {
  background: #000000;
  border-color: #000000;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-size: 12px;
  background-position: center;
  background-repeat: no-repeat;
}

.exit-banner-checkbox:focus {
  outline: 2px solid #000000;
  outline-offset: 2px;
}

.exit-banner-checkbox:focus:not(:focus-visible) {
  outline: none;
}

.exit-banner-checkbox-label {
  font-family: 'Stack Sans Headline', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.9375rem;
  color: #1f2937;
  line-height: 1.5;
  cursor: pointer;
}

.exit-banner-privacy-link {
  color: #1f2937;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.exit-banner-privacy-link:hover {
  color: #374151;
}

/* Footer text */
.exit-banner-footer {
  font-family: 'Stack Sans Headline', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.875rem;
  color: #9ca3af;
  margin: 1rem 0 0 0;
  text-align: center;
}

/* ==========================================================================
   Tablet Styles (768px - 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
  .exit-banner-modal {
    max-width: 440px;
  }

  .exit-banner-content {
    padding: 2rem 2rem 1.75rem;
  }

  .exit-banner-title {
    font-size: 1.5rem;
  }

  .exit-banner-subtitle {
    font-size: 0.9375rem;
  }
}

/* ==========================================================================
   Mobile Styles (<=768px) - Bottom sheet design
   ========================================================================== */
@media (max-width: 768px) {
  .exit-banner {
    padding: 0;
    align-items: flex-end;
  }

  .exit-banner-modal {
    max-width: 100%;
    width: 100%;
    border-radius: 24px 24px 0 0;
    max-height: 85vh;
    margin-bottom: 0;
    animation: exitBannerSlideUpMobile 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  }

  /* Handle indicator for bottom sheet */
  .exit-banner-modal::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
    margin: 0.75rem auto 0;
  }

  @keyframes exitBannerSlideUpMobile {
    from {
      opacity: 0;
      transform: translateY(100%);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .exit-banner-close {
    top: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
  }

  .exit-banner-close svg {
    width: 18px;
    height: 18px;
  }

  .exit-banner-content {
    padding: 1rem 1.5rem 1.75rem;
  }

  .exit-banner-header {
    margin-bottom: 1.25rem;
  }

  .exit-banner-title {
    font-size: 1.375rem;
  }

  .exit-banner-subtitle {
    font-size: 0.9375rem;
  }

  .exit-banner-input-wrapper {
    flex-direction: column;
    border-radius: 12px;
    border-width: 1px;
  }

  .exit-banner-email {
    padding: 1rem 1rem;
    border-bottom: 1px solid #e5e7eb;
  }

  .exit-banner-submit {
    margin: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
  }

  .exit-banner-checkbox-wrapper {
    gap: 0.625rem;
  }

  .exit-banner-checkbox-label {
    font-size: 0.875rem;
  }

  .exit-banner-footer {
    font-size: 0.8125rem;
  }
}

/* ==========================================================================
   Small Mobile Styles (<=480px)
   ========================================================================== */
@media (max-width: 480px) {
  .exit-banner-modal {
    border-radius: 20px 20px 0 0;
  }

  .exit-banner-modal::before {
    width: 36px;
    margin-top: 0.625rem;
  }

  .exit-banner-content {
    padding: 0.75rem 1.25rem 1.5rem;
  }

  .exit-banner-header {
    margin-bottom: 1rem;
  }

  .exit-banner-title {
    font-size: 1.25rem;
  }

  .exit-banner-subtitle {
    font-size: 0.875rem;
  }

  .exit-banner-email {
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
  }

  .exit-banner-submit {
    padding: 0.75rem 1.25rem;
    font-size: 0.9375rem;
  }

  .exit-banner-checkbox {
    width: 18px;
    height: 18px;
  }

  .exit-banner-checkbox:checked {
    background-size: 12px;
  }

  .exit-banner-checkbox-label {
    font-size: 0.8125rem;
  }

  .exit-banner-footer {
    font-size: 0.75rem;
  }
}

/* ==========================================================================
   Accessibility: Reduced Motion Support
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .exit-banner,
  .exit-banner-modal,
  .exit-banner-close,
  .exit-banner-submit,
  .exit-banner-checkbox {
    animation: none !important;
    transition: none !important;
  }

  .exit-banner.active {
    opacity: 1;
  }

  .exit-banner-modal {
    transform: none !important;
  }
}

/* ==========================================================================
   High Contrast Mode Support
   ========================================================================== */
@media (prefers-contrast: high) {
  .exit-banner-modal {
    border: 2px solid #000000;
  }

  .exit-banner-close {
    border: 1px solid currentColor;
  }

  .exit-banner-input-wrapper {
    border-width: 2px;
  }

  .exit-banner-checkbox {
    border-width: 2px;
  }
}

/* ==========================================================================
   Print Styles - Hide banner in print
   ========================================================================== */
@media print {
  .exit-banner {
    display: none !important;
  }
}
