/**
 * Mailchimp Forms Styling
 * Aventico Theme - 2024
 * Styles pour les formulaires de newsletter
 */

/* ================================
   FORMULAIRE NEWSLETTER MAILCHIMP
   ================================ */

/* Container principal du formulaire */
.mc4wp-form {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(255, 255, 255, 0.05) 100%
  );
  backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 24px;
  padding: var(--space-6);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Effet de brillance au survol */
.mc4wp-form::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left 0.6s ease;
}

.mc4wp-form:hover::before {
  left: 100%;
}

/* Groupe de champs */
.mc4wp-form .form-group {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  align-items: stretch;
}

/* Champ email */
.mc4wp-form input[type="email"] {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  color: #1a1a1a;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 52px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.mc4wp-form input[type="email"]:focus {
  outline: none;
  border-color: var(--c-primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(30, 111, 159, 0.2), 0 4px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.mc4wp-form input[type="email"]::placeholder {
  color: #666;
  opacity: 0.9;
  font-weight: 400;
}

/* Bouton de soumission */
.mc4wp-form button[type="submit"] {
  padding: var(--space-3) var(--space-4);
  border-radius: 14px;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  min-height: 52px;
  background: linear-gradient(135deg, var(--c-primary) 0%, #1a5a7f 100%);
  color: white;
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(30, 111, 159, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mc4wp-form button[type="submit"]:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 35px rgba(30, 111, 159, 0.5),
    0 0 0 3px rgba(255, 255, 255, 0.2);
  background: linear-gradient(135deg, #1a5a7f 0%, var(--c-primary) 100%);
}

.mc4wp-form button[type="submit"]:active {
  transform: translateY(-1px) scale(0.98);
  box-shadow: 0 6px 20px rgba(30, 111, 159, 0.4);
}

.mc4wp-form button[type="submit"]:active {
  transform: translateY(0);
}

.mc4wp-form button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Icône dans le bouton */
.mc4wp-form button[type="submit"] svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

.mc4wp-form button[type="submit"]:hover svg {
  transform: translateX(2px);
}

/* Messages de statut */
.mc4wp-form .mc4wp-response {
  margin-top: var(--space-4);
  text-align: center;
  animation: slideInDown 0.4s ease-out;
}

.mc4wp-form .mc4wp-alert {
  padding: var(--space-3) var(--space-4);
  border-radius: 16px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 2px solid;
  position: relative;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Message de succès */
.mc4wp-form .mc4wp-alert.mc4wp-notice {
  background: rgba(34, 197, 94, 0.15);
  color: #059669;
  border-color: rgba(34, 197, 94, 0.4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Message d'erreur */
.mc4wp-form .mc4wp-alert.mc4wp-error {
  background: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Message d'info */
.mc4wp-form .mc4wp-alert.mc4wp-info {
  background: rgba(59, 130, 246, 0.15);
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.mc4wp-alert p {
  color: white;
}

/* Message de succès spécifique */
.mc4wp-form .mc4wp-alert.mc4wp-success {
  background: rgba(34, 197, 94, 0.15);
  color: #059669;
  border-color: rgba(34, 197, 94, 0.4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Animation d'apparition */
@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Champs cachés (anti-spam) */
.mc4wp-form input[type="hidden"],
.mc4wp-form input[name="website"] {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Responsive */
@media (max-width: 768px) {
  .mc4wp-form {
    padding: var(--space-4);
  }

  .mc4wp-form .form-group {
    flex-direction: column;
    gap: var(--space-3);
  }

  .mc4wp-form button[type="submit"] {
    justify-content: center;
    width: 100%;
  }

  .mc4wp-form input[type="email"] {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .mc4wp-form {
    padding: var(--space-4);
    border-radius: 20px;
  }

  .mc4wp-form input[type="email"],
  .mc4wp-form button[type="submit"] {
    min-height: 48px;
    font-size: 1rem;
  }

  .mc4wp-form button[type="submit"] {
    font-size: 0.9rem;
    padding: var(--space-3) var(--space-3);
  }
}

/* ================================
   ÉTATS SPÉCIAUX DU FORMULAIRE
   ================================ */

/* Formulaire en cours de soumission */
.mc4wp-form.mc4wp-loading button[type="submit"] {
  opacity: 0.7;
  cursor: wait;
}

.mc4wp-form.mc4wp-loading button[type="submit"] span {
  opacity: 0.8;
}

/* Formulaire avec erreur */
.mc4wp-form.mc4wp-error input[type="email"] {
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.1);
}

/* Formulaire avec succès */
.mc4wp-form.mc4wp-success input[type="email"] {
  border-color: rgba(34, 197, 94, 0.5);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.1);
}

/* ================================
   PERSONNALISATION DES LABELS
   ================================ */

.mc4wp-form label {
  display: none; /* Cacher les labels par défaut */
}

/* Si vous voulez afficher les labels */
.mc4wp-form label.show-label {
  display: block;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: var(--space-2);
}

/* ================================
   ANIMATIONS ET TRANSITIONS
   ================================ */

.mc4wp-form {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mc4wp-form:hover {
  transform: translateY(-4px);
  box-shadow: 0 35px 100px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  border-color: rgba(255, 255, 255, 0.35);
}

/* Focus sur le container */
.mc4wp-form:focus-within {
  border-color: rgba(30, 111, 159, 0.6);
  box-shadow: 0 0 0 3px rgba(30, 111, 159, 0.2), 0 30px 90px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

/* ================================
   ACCESSIBILITÉ
   ================================ */

/* Focus visible pour l'accessibilité */
.mc4wp-form input[type="email"]:focus-visible,
.mc4wp-form button[type="submit"]:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

/* Réduction des animations si préféré */
@media (prefers-reduced-motion: reduce) {
  .mc4wp-form,
  .mc4wp-form *,
  .mc4wp-form .mc4wp-response {
    animation: none !important;
    transition: none !important;
  }
}

/* ================================
   NEWSLETTER SECTION COMPLÈTE
   ================================ */

/* Newsletter CTA Section */
.newsletter-cta {
  background: linear-gradient(135deg, var(--c-primary) 0%, #1a5a7f 100%);
  color: white;
  padding: var(--space-10) 0;
  position: relative;
  overflow: hidden;
}

.newsletter-cta::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><defs><pattern id="mountains" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><polygon points="0,20 10,0 20,20" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="20" fill="url(%23mountains)"/></svg>');
  opacity: 0.1;
}

.newsletter-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  align-items: center;
  position: relative;
  z-index: 2;
}

.newsletter-text h2 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  margin: 0 0 var(--space-3);
  font-weight: 800;
}

.newsletter-text p {
  font-size: 1.1rem;
  opacity: 0.9;
  line-height: 1.6;
  margin: 0;
}

/* Style les paragraphes Mailchimp pour ressembler aux form-group */
.newsletter-form .mc4wp-form p {
  display: flex;
  gap: var(--space-3);
  width: 100%;
  max-width: 450px;
  align-items: stretch;
  margin: 0 auto var(--space-4);
}

.newsletter-form .mc4wp-form p:last-child {
  margin-bottom: 0;
  color: white;
}

.newsletter-form .mc4wp-form input[type="email"] {
  flex: 1;
  margin: 0;
}

.newsletter-form .mc4wp-form input[type="submit"] {
  margin: 0;
  min-width: 150px;
}

.newsletter-form .mc4wp-form label {
  display: none; /* Hide labels if any */
}

/* Form disclaimer avec couleur */
.form-disclaimer {
  display: block;
  margin-top: var(--space-2);
  font-size: 0.85rem;
  opacity: 0.9;
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.4;
}

/* Messages Mailchimp avec couleurs de texte corrigées */
.newsletter-form .mc4wp-alert {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius);
  color: white;
  padding: var(--space-3);
  margin-top: var(--space-3);
  text-align: center;
  backdrop-filter: blur(10px);
}

.newsletter-form .mc4wp-success {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.4);
  color: #16a34a;
}

.newsletter-form .mc4wp-error {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #dc2626;
}

.newsletter-form .mc4wp-notice {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
  color: #2563eb;
}

/* Newsletter Fallback Form - Design Premium */
.newsletter-fallback-form .form-group {
  display: flex;
  gap: 0;
  background: white;
  border-radius: 12px;
  padding: 4px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.newsletter-fallback-form .form-group:focus-within {
  border-color: var(--c-accent);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 0 0 4px rgba(30, 111, 159, 0.1);
}

.newsletter-fallback-form input[type="email"] {
  flex: 1;
  padding: 16px 20px;
  border: none;
  background: transparent;
  font-size: 1rem;
  color: var(--c-text);
  border-radius: 8px;
}

.newsletter-fallback-form input[type="email"]:focus {
  outline: none;
}

.newsletter-fallback-form input[type="email"]::placeholder {
  color: #9ca3af;
  font-weight: 400;
}

.newsletter-fallback-form .btn {
  padding: 16px 24px;
  margin: 0;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--c-primary), #3b82f6);
  color: white;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.newsletter-fallback-form .btn:hover {
  transform: translateX(2px);
  background: linear-gradient(135deg, #1a5a7f, #2563eb);
  box-shadow: 0 4px 20px rgba(30, 111, 159, 0.3);
}

.newsletter-fallback-form .btn-icon {
  transition: transform 0.3s ease;
  font-weight: bold;
}

.newsletter-fallback-form .btn:hover .btn-icon {
  transform: translateX(4px);
}

.newsletter-fallback-form .form-legal {
  display: block;
  margin-top: var(--space-2);
  font-size: 0.85rem;
  opacity: 0.8;
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
}

/* Responsive Newsletter */
@media (max-width: 768px) {
  .newsletter-content {
    grid-template-columns: 1fr;
    gap: var(--space-5);
    text-align: center;
  }

  .newsletter-form .mc4wp-form p {
    flex-direction: column;
    max-width: 300px;
  }

  .newsletter-form .mc4wp-form input[type="email"],
  .newsletter-form .mc4wp-form input[type="submit"] {
    width: 100%;
  }

  /* Newsletter Fallback Form - Mobile */
  .newsletter-fallback-form .form-group {
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-2);
  }

  .newsletter-fallback-form .btn {
    justify-content: center;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .newsletter-form .mc4wp-form p {
    flex-direction: column;
    max-width: 300px;
  }

  .newsletter-form .mc4wp-form input[type="email"],
  .newsletter-form .mc4wp-form input[type="submit"] {
    width: 100%;
  }
}
