/* ================================================
   SAHEL OFFICE - LOGIN PAGE DESIGN
   Couleurs de marque: #2D2F36 (principal) et #FECB45 (accent)
   ================================================ */

/* ===== ARRIÈRE-PLAN PRINCIPAL ===== */
body {
  background: linear-gradient(135deg, #2D2F36 0%, #3a3c43 50%, #2D2F36 100%);
  color: #ffffff;
  font-family: 'Poppins', sans-serif;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ===== ÉLÉMENTS DÉCORATIFS ===== */
body::before {
  content: "";
  background: radial-gradient(circle, rgba(254, 203, 69, 0.1) 0%, transparent 70%);
  position: fixed;
  top: -200px;
  left: -250px;
  height: 500px;
  width: 500px;
  border-radius: 50%;
  z-index: 0;
}

body::after {
  content: "";
  background: radial-gradient(circle, rgba(254, 203, 69, 0.08) 0%, transparent 70%);
  position: fixed;
  bottom: -300px;
  right: -300px;
  height: 600px;
  width: 600px;
  border-radius: 50%;
  z-index: 0;
}

/* ===== EFFETS DÉCORATIFS ADDITIONNELS ===== */
body::after {
  box-shadow: 
    0 0 100px rgba(254, 203, 69, 0.1),
    inset 0 0 100px rgba(254, 203, 69, 0.05);
}

/* ===== CONTAINER ET POSITIONNEMENT ===== */
.container {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.container .row {
  width: 100%;
}

/* ===== CARTE DE CONNEXION ===== */
.card-signin {
  border: 0;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 
    0 25px 50px rgba(45, 47, 54, 0.3),
    0 0 0 1px rgba(254, 203, 69, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(254, 203, 69, 0.2);
  overflow: hidden;
  position: relative;
  width: 100%;
  max-width: 420px; /* Largeur fixe optimale pour tous les écrans */
  margin: 0 auto; /* Centrage automatique */
}

.card-signin::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #FECB45, #e6b63d, #FECB45);
  z-index: 1;
}

.card-signin .card-body {
  padding: 1rem 1.5rem; /* Réduit pour éviter le chevauchement */
  position: relative;
  z-index: 2;
}

/* Harmonisation avec le formulaire 2FA */
.card-signin.shadow-lg .card-body {
  padding: 1rem;
}

/* ===== LOGO AVEC CONTAINER ===== */
.logo-container {
  text-align: center;
  margin-bottom: 0.5rem; /* Réduit de 1rem */
  position: relative;
}

.logo-container::after {
  content: "";
  position: absolute;
  bottom: -5px; /* Réduit de -10px */
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #FECB45, transparent);
}

/* ===== TEXTE DE BIENVENUE ===== */
.welcome-text p {
  color: rgba(45, 47, 54, 0.7);
  font-size: 13px; /* Réduit de 14px */
  margin-bottom: 0.75rem; /* Réduit de 1.25rem */
  font-weight: 400;
}

/* ===== LOGO ===== */
.logo {
  max-width: 130px; /* Réduit pour hauteur compacte */
  border-radius: 15px;
  transform: translateX(-50%);
  margin-left: 50%;
  padding: 8px; /* Réduit de 12px */
  margin-bottom: 5px; /* Réduit de 10px */
  filter: drop-shadow(0 4px 8px rgba(45, 47, 54, 0.1));
  transition: all 0.3s ease;
}

.logo:hover {
  transform: translateX(-50%) scale(1.05);
  filter: drop-shadow(0 6px 12px rgba(45, 47, 54, 0.2));
}

/* ===== TITRE DE CONNEXION ===== */
.card-signin h5 {
  color: #2D2F36;
  font-weight: 600;
  font-size: 1.15rem; /* Réduit pour compacité */
  margin-bottom: 0.75rem; /* Réduit de 1.25rem */
  position: relative;
}

.card-signin h5::after {
  content: "";
  position: absolute;
  bottom: -5px; /* Réduit de -10px */
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #FECB45, #e6b63d);
  border-radius: 2px;
}

/* ===== CHAMPS DE FORMULAIRE ===== */
.form-signin .form-control {
  padding: 9px 16px; /* Réduit pour compacité */
  border: 2px solid rgba(45, 47, 54, 0.1);
  border-radius: 10px; /* Réduit légèrement */
  background: rgba(255, 255, 255, 0.9);
  color: #2D2F36;
  font-size: 14px;
  transition: all 0.3s ease;
  text-align: left;
  margin-bottom: 0.5rem; /* Réduit de 0.75rem */
}

.form-signin .form-control::placeholder {
  color: rgba(45, 47, 54, 0.6);
  font-weight: 400;
}

.form-signin .form-control:focus {
  border-color: #FECB45;
  background: #ffffff;
  box-shadow: 
    0 0 0 3px rgba(254, 203, 69, 0.1),
    0 4px 12px rgba(254, 203, 69, 0.15);
  outline: none;
  transform: translateY(-2px);
}

.form-signin .form-control.is-invalid {
  border-color: #e74c3c;
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* ===== BOUTON PRINCIPAL ===== */
.btn-primary {
  background: linear-gradient(135deg, #FECB45 0%, #e6b63d 100%);
  border: none;
  color: #2D2F36;
  font-weight: 600;
  font-size: 15px;
  padding: 10px 24px; /* Réduit pour hauteur compacte */
  border-radius: 10px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(254, 203, 69, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #e6b63d 0%, #d1a235 100%);
  color: #2D2F36;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(254, 203, 69, 0.4);
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(254, 203, 69, 0.3);
}

/* ===== CHECKBOX PERSONNALISÉE ===== */
.custom-control-label {
  color: #2D2F36;
  font-weight: 500;
  margin-bottom: 0;
  margin-top: 0; /* Réduit de 2px */
  user-select: none;
  font-size: 14px; /* Ajout pour compacité */
}

.custom-control-label::before {
  background: rgba(254, 203, 69, 0.1);
  border: 2px solid rgba(45, 47, 54, 0.2);
  border-radius: 6px;
  transition: all 0.3s ease;
}

.custom-control-input:checked ~ .custom-control-label::before {
  background: #FECB45;
  border-color: #FECB45;
}

.custom-control-input:checked ~ .custom-control-label::after {
  color: #2D2F36;
}

/* ===== LIENS ===== */
.btn-link {
  color: #2D2F36;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
}

.btn-link::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #FECB45;
  transition: width 0.3s ease;
}

.btn-link:hover {
  color: #FECB45;
  text-decoration: none;
}

.btn-link:hover::after {
  width: 100%;
}

.btn-register {
  color: #2D2F36;
  font-size: 15px; /* Réduit de 16px */
  display: block;
  text-align: center;
  margin-top: 10px; /* Réduit de 15px */
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-register:hover {
  color: #FECB45;
  text-decoration: none;
}

/* ===== ALERTES ===== */
.alert-danger {
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.2);
  color: #e74c3c;
  border-radius: 10px;
  border-left: 4px solid #e74c3c;
  padding: 0.6rem 1rem; /* Réduit pour compacité */
  margin-bottom: 0.75rem; /* Ajout pour contrôler l'espacement */
}

.alert-success {
  background: rgba(46, 204, 113, 0.1);
  border: 1px solid rgba(46, 204, 113, 0.2);
  color: #2ecc71;
  border-radius: 10px;
  border-left: 4px solid #2ecc71;
  padding: 0.6rem 1rem; /* Réduit pour compacité */
  margin-bottom: 0.75rem; /* Ajout pour contrôler l'espacement */
}

/* ===== MESSAGES D'ERREUR ===== */
.invalid-feedback {
  color: #e74c3c;
  font-size: 13px; /* Réduit de 14px */
  font-weight: 500;
  margin-top: 3px; /* Réduit de 5px */
}

/* ===== RESPONSIVE ===== */
/* Adaptation pour petits écrans uniquement */
@media (max-width: 480px) {
  .card-signin {
    margin: 0.5rem;
    border-radius: 15px;
    max-width: calc(100% - 1rem); /* Marges minimales sur mobile */
  }
  
  .card-signin .card-body {
    padding: 0.75rem 1rem; /* Réduit encore pour mobile */
  }
  
  .logo {
    max-width: 110px; /* Réduit de 140px */
    padding: 6px;
  }
  
  .card-signin h5 {
    font-size: 1.1rem;
    padding: 0.5rem 0 !important; /* Réduit le py-2 */
  }
  
  .welcome-text p {
    font-size: 12px;
    margin-bottom: 0.5rem;
  }
}

/* Très petits mobiles */
@media (max-width: 360px) {
  .card-signin .card-body {
    padding: 0.6rem 0.85rem;
  }
  
  .logo {
    max-width: 100px;
    padding: 5px;
  }
  
  .card-signin h5 {
    font-size: 1.05rem;
  }
  
  .btn-primary {
    padding: 9px 20px;
    font-size: 14px;
  }
}

/* ===== ANIMATION D'ENTRÉE DÉSACTIVÉE ===== */
/* Animation retirée pour correspondre au formulaire 2FA */

/* ===== EFFETS SUPPLÉMENTAIRES ===== */
.form-group {
  position: relative;
  margin-bottom: 0.5rem; /* Réduit pour compacité verticale */
}

.form-group.row {
  margin-bottom: 0.5rem; /* Contrôle l'espacement entre les champs */
}

.form-group .form-control:focus + .floating-label {
  color: #FECB45;
}

/* ===== AJUSTEMENTS FINAUX ===== */
::selection {
  background: rgba(254, 203, 69, 0.3);
  color: #2D2F36;
}

::-moz-selection {
  background: rgba(254, 203, 69, 0.3);
  color: #2D2F36;
}

/* ===== COPYRIGHT ===== */
.copyright-text {
  position: fixed;
  bottom: 30px;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 100;
}

.copyright-text small {
  background: rgba(255, 255, 255, 0.9);
  padding: 6px 16px;
  border-radius: 20px;
  display: inline-block;
  box-shadow: 0 2px 10px rgba(45, 47, 54, 0.1);
  font-size: 12px;
}

/* ===== ANIMATION ENTRÉE CARTE ===== */
@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.card-signin {
  animation: cardFadeIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ===== LUEUR PULSANTE DERRIÈRE LA CARTE ===== */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 25px 50px rgba(45,47,54,0.3), 0 0 0 1px rgba(254,203,69,0.1), 0 0 40px rgba(254,203,69,0.07); }
  50%       { box-shadow: 0 25px 60px rgba(45,47,54,0.35), 0 0 0 1px rgba(254,203,69,0.2), 0 0 70px rgba(254,203,69,0.13); }
}

.card-signin {
  animation: cardFadeIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both,
             glowPulse 4s ease-in-out 0.7s infinite;
}