/* ============================================
   CSS Complémentaire pour intégration CAS
   À ajouter APRÈS cas-login-modern.css
   ============================================ */

/* Configuration Owl Carousel cachée */
.owl-carousel-config {
  display: none !important;
}

.owl-carousel.owl-drag .owl-item{
  padding: 10px;
}

/* Adaptation du footer pour Owl Carousel */
.login-footer .owl-carousel-opac {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.login-footer .owl-carousel .item {
  padding: 0 1rem;
}

/* Style des sections de bibliothèque dans le carrousel */
.footer-section {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.3s ease;
  min-height: 250px;
}

.footer-section:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.footer-address {
  font-style: normal;
  margin-top: 1rem;
}

/* Personnalisation des contrôles Owl Carousel */
.login-footer .owl-nav {
  margin-top: 1.5rem;
  text-align: center;
}

.login-footer .owl-nav button {
  background: rgba(255, 255, 255, 0.2) !important;
  color: white !important;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin: 0 0.5rem;
  transition: all 0.3s ease;
  border: 2px solid rgba(255, 255, 255, 0.3) !important;
}

.login-footer .owl-nav button:hover {
  background: var(--primary-green) !important;
  border-color: var(--primary-green) !important;
  transform: scale(1.1);
}

.login-footer .owl-nav button.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Dots de pagination Owl Carousel */
.login-footer .owl-dots {
  text-align: center;
  margin-top: 1rem;
}

.login-footer .owl-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin: 0 0.3rem;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transition: all 0.3s ease;
  border: none;
}

.login-footer .owl-dot.active {
  background: var(--primary-orange);
  transform: scale(1.3);
}

.login-footer .owl-dot:hover {
  background: rgba(255, 255, 255, 0.6);
}

/* Messages d'erreur personnalisés CAS */
.cas-login-message {
  margin: 1rem 0;
  padding: 0;
  min-height: 0;
  transition: all 0.3s ease;
}

.cas-login-message.error-message {
  background: linear-gradient(135deg, #ffe5e5 0%, #ffcccc 100%);
  border-left: 4px solid #e74c3c;
  padding: 1rem;
  border-radius: 8px;
  color: #c0392b;
  font-size: 0.875rem;
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  animation: slideDown 0.3s ease-out;
}

.cas-login-message.error-message::before {
  content: '⚠️';
  font-size: 1.25rem;
  flex-shrink: 0;
}

.cas-login-message:empty {
  display: none !important;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Style spécifique pour les messages de succès (si besoin) */
.cas-login-message.success-message {
  background: linear-gradient(135deg, #e8f5d7 0%, #d5f0c1 100%);
  border-left: 4px solid var(--primary-green);
  padding: 1rem;
  border-radius: 8px;
  color: #2d5016;
  font-size: 0.875rem;
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  animation: slideDown 0.3s ease-out;
}

.cas-login-message.success-message::before {
  content: '✓';
  font-size: 1.25rem;
  flex-shrink: 0;
  color: var(--primary-green);
}

/* Adaptation du body pour éviter les conflits */
body {
  opacity: 0;
  transition: opacity 0.3s ease-in;
}

body.loaded {
  opacity: 1;
}

/* Assurez-vous que le carrousel ne déborde pas */
.login-footer .owl-stage-outer {
  overflow: hidden;
}

/* Responsive pour le carrousel */
@media (max-width: 768px) {
  .footer-section {
    min-height: auto;
    padding: 1rem;
  }

  .login-footer .owl-nav {
    margin-top: 1rem;
  }

  .login-footer .owl-nav button {
    width: 35px;
    height: 35px;
    font-size: 1.25rem;
  }
}

/* Compatibilité avec les anciens sélecteurs W3.CSS si nécessaire */
.w3-hide {
  display: none !important;
}

.nopadding {
  padding: 0 !important;
}

.padding {
  padding: 16px !important;
}

.padding2 {
  padding: 32px !important;
}

/* Animation de chargement améliorée pour le bouton */
.btn-login.cas-login-validate.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
  cursor: wait;
}

/* Préchargement des polices d'icônes si vous utilisez Font Awesome */
.footer-text .fa,
.footer-text .fal,
.footer-text .far,
.footer-text .fas {
  margin-right: 0.5rem;
  color: var(--primary-orange);
}

/* Amélioration du contraste pour les liens dans le footer */
.footer-link {
  font-weight: 500;
  position: relative;
}

.footer-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-orange);
  transition: width 0.3s ease;
}

.footer-link:hover::after {
  width: 100%;
}

/* Support pour les anciennes classes de couleur du carrousel */
.footer-section[style*="background: #0392cf"],
.footer-section[style*="background: #96ceb4"],
.footer-section[style*="background: #ffeead"],
.footer-section[style*="background: #ff6f69"],
.footer-section[style*="background: #ffcc5c"],
.footer-section[style*="background: #88d8b0"],
.footer-section[style*="background: #d11141"],
.footer-section[style*="background: #00b159"] {
  background: rgba(255, 255, 255, 0.1) !important;
}

/* Animation d'entrée pour les items du carrousel */
.owl-carousel .owl-item {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.owl-carousel .owl-item.active {
  opacity: 1;
}

/* Indicateur visuel de chargement initial */
.login-wrapper {
  animation: fadeInScale 0.6s ease-out;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Styles pour l'état désactivé du bouton */
.btn-login:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* Message de configuration incorrecte amélioré */
.login-card h2 {
  margin: 0;
  line-height: 1.4;
}

.login-card p {
  margin: 0;
  line-height: 1.6;
}

/* Correction pour les espaces dans les numéros de téléphone */
.footer-link[href^="tel:"] {
  white-space: nowrap;
}

/* Assurer que les icônes emoji sont bien alignées */
.footer-title::before,
.error-message::before,
.success-message::before {
  display: inline-block;
  vertical-align: middle;
}

/* Mode plein écran sur mobile pour éviter les problèmes de viewport */
@media (max-width: 480px) {
  .login-container {
    min-height: calc(100vh - 280px);
  }

  .login-footer {
    position: relative;
  }
}

/* Support du mode dark avec préférence système */
@media (prefers-color-scheme: dark) {
  .footer-section {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
  }

  .footer-section:hover {
    background: rgba(255, 255, 255, 0.12);
  }

  .cas-login-message.error-message {
    background: rgba(231, 76, 60, 0.2);
    color: #ff6b6b;
  }

  .cas-login-message.success-message {
    background: rgba(122, 181, 29, 0.2);
    color: #b8e986;
  }
}

/* Impression (si nécessaire pour des rapports) */
@media print {
  .login-footer,
  .password-toggle,
  .btn-login {
    display: none !important;
  }

  .login-card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

/* Accessibilité : focus visible sur tous les éléments interactifs */
.owl-nav button:focus-visible,
.owl-dot:focus-visible {
  outline: 3px solid var(--primary-orange);
  outline-offset: 2px;
}

/* Transition douce pour le changement d'état du formulaire */
.login-form {
  transition: opacity 0.3s ease;
}

.login-form.submitting {
  opacity: 0.7;
  pointer-events: none;
}
