/* ==========================================================================
   Newsletter Popup Styles
   ========================================================================== */
.newsletter-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10100; /* Higher than cookie modal (10000) */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  font-family: var(--font-ui), system-ui, -apple-system, sans-serif;
}

.newsletter-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.newsletter-modal__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px); /* glassmorphism blur */
}

.newsletter-modal__container {
  position: relative;
  width: 95%;
  max-width: 650px;
  background-color: var(--cookie-bg, #ffffff);
  border-radius: 16px; /* 16px rounded corners */
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  z-index: 10101;
  overflow-y: auto; /* Permettre le scroll si l'écran est trop petit */
  max-height: 90vh; /* Limiter la hauteur pour mobile */
  transform: scale(0.9) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid var(--cookie-border, #e2e8f0);
}

.newsletter-modal.active .newsletter-modal__container {
  transform: scale(1) translateY(0);
}

.newsletter-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #1e293b;
  transition: all 0.2s ease;
  line-height: 1;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

[data-theme="dark"] .newsletter-modal__close {
  background: #1e293b;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.newsletter-modal__close:hover {
  color: var(--accent-red, #dc2626);
  background: rgba(220, 38, 38, 0.1);
  transform: rotate(90deg);
}

.newsletter-modal__wrapper {
  display: flex;
  flex-direction: column;
}

/* Image side - top on mobile, left on desktop */
.newsletter-modal__image-side {
  background: linear-gradient(135deg, var(--accent-red, #dc2626) 0%, #7f1d1d 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  min-height: 140px; /* Fixed height for mobile so absolute images don't collapse */
}

.newsletter-modal__image-side::after {
  content: '';
  position: absolute;
  top: -20%;
  left: -20%;
  width: 140%;
  height: 140%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
  pointer-events: none;
}

.newsletter-modal__image-fallback svg {
  width: 32px; /* Réduit pour mobile */
  height: 32px;
  stroke: #ffffff;
  opacity: 0.9;
  animation: float-icon 4s ease-in-out infinite;
}

@keyframes float-icon {
  0% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
  100% { transform: translateY(0); }
}

/* Content side */
.newsletter-modal__content-side {
  padding: 16px 20px; /* Réduit pour mobile (était 24px) */
}

.newsletter-modal__title {
  font-family: var(--font-editorial), serif;
  font-size: 18px; /* Réduit pour mobile (était 20px) */
  font-weight: 800;
  line-height: 1.3;
  margin: 0 0 8px 0;
  color: var(--cookie-text, #1e293b);
}

.newsletter-modal__subtitle {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--cookie-text-muted, #64748b);
  margin: 0 0 12px 0; /* Réduit pour mobile */
}

.newsletter-modal__benefits {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--cookie-text, #1e293b);
}

.newsletter-modal__trust {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-red, #dc2626);
  margin: 0 0 12px 0;
  background-color: rgba(220, 38, 38, 0.05);
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
}

.newsletter-modal__form {
  margin-top: 10px;
}

.newsletter-modal__form .form-group {
  margin-bottom: 12px;
  position: relative;
}

.newsletter-modal__form .form-control {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-ui), sans-serif;
  font-size: 14px;
  background-color: var(--bg-accent, #f8fafc);
  border: 1px solid var(--cookie-border, #e2e8f0);
  border-radius: 8px;
  color: var(--cookie-text, #1e293b);
  outline: none;
  transition: all 0.2s ease;
  min-height: 44px;
}

.newsletter-modal__form .form-control:focus {
  border-color: var(--accent-red, #dc2626);
  background-color: var(--bg-secondary, #ffffff);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.form-error-msg {
  display: block;
  font-size: 11px;
  color: var(--accent-red, #dc2626);
  margin-top: 4px;
  font-weight: 600;
}

/* Button spinner */
.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  margin-left: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.newsletter-modal__footer-links {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.news-link-btn {
  background: none;
  border: none;
  color: var(--cookie-text-muted, #64748b);
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
  font-weight: 600;
  padding: 6px 12px;
  transition: color 0.2s ease;
  min-height: 44px;
}

.news-link-btn:hover {
  color: var(--cookie-text, #1e293b);
}

.newsletter-modal__privacy-note {
  font-size: 11px;
  color: var(--cookie-text-muted, #64748b);
  text-align: center;
  margin: 14px 0 0 0;
}

/* Success state styles */
#news-modal-state-success {
  text-align: center;
  padding: 20px 10px;
}

#news-modal-state-success .success-icon {
  font-size: 48px;
  margin-bottom: 16px;
  animation: bounce 1s ease infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Screen readers only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ==========================================================================
   Responsive Desktop Layout (min-width: 768px)
   ========================================================================== */
@media (min-width: 768px) {
  .newsletter-modal__container {
    max-width: 720px;
  }

  .newsletter-modal__wrapper {
    flex-direction: row;
  }

  .newsletter-modal__image-side {
    flex: 0 0 35%; /* 35% width image side */
    padding: 40px; /* Restauré pour desktop */
  }

  .newsletter-modal__image-fallback svg {
    width: 48px; /* Restauré pour desktop */
    height: 48px;
  }

  .newsletter-modal__content-side {
    flex: 1;
    padding: 32px; /* Restauré pour desktop */
  }
  
  .newsletter-modal__title {
    font-size: 22px; /* Restauré pour desktop */
    margin: 0 0 12px 0;
  }

  .newsletter-modal__subtitle {
    margin: 0 0 16px 0; /* Restauré pour desktop */
  }

  .newsletter-modal__container {
    overflow: hidden; /* Restauré pour desktop car pas besoin de scroll global */
  }
}
