/* --- RESET & BASES --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(
      135deg,
      rgba(102, 126, 234, 0.85) 0%,
      rgba(118, 75, 162, 0.85) 100%
    ),
    url("../../images/montagne.avif");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  
  /* --- LES MODIFICATIONS ICI --- */
  min-height: 100vh; /* Permet au body de grandir si le contenu dépasse */
  display: flex;
  align-items: center; /* Centre verticalement si possible */
  justify-content: center;
  padding: 40px 20px; /* Ajoute de l'espace en haut et en bas pour le scroll */
  margin: 0;
  overflow-y: auto; /* Force l'apparition du scroll si nécessaire */
  position: relative;
}

/* --- ANIMATION DE FOND (SUBTILE) --- */
body::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  animation: moveBackground 20s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes moveBackground {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-3%, -3%); }
}

/* --- LE CONTENEUR PRINCIPAL --- */
.container {
  background: white;
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  max-width: 900px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  z-index: 1;
  backdrop-filter: blur(10px);
}

/* --- PANNEAU GAUCHE (INFOS) --- */
.left-panel {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 60px 40px;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.left-panel h1 {
  font-size: 32px;
  margin-bottom: 20px;
  font-weight: 600;
}

.left-panel p {
  font-size: 16px;
  line-height: 1.6;
  opacity: 0.95;
  margin-bottom: 30px;
}

.features {
  list-style: none;
}

.features li {
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  font-size: 14px;
}

.features li:before {
  content: "✓";
  display: inline-block;
  width: 24px; height: 24px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  margin-right: 12px;
  text-align: center;
  line-height: 24px;
  font-weight: bold;
}

/* --- PANNEAU DROIT (FORMULAIRE) --- */
.right-panel {
  padding: 40px;
  background: white;
}

.form-header {
  margin-bottom: 30px;
}

.form-header h2 {
  font-size: 26px;
  color: #333;
  margin-bottom: 8px;
}

.form-header p {
  color: #666;
  font-size: 14px;
}

/* --- ELEMENTS DU FORMULAIRE --- */
.input-group {
  margin-bottom: 18px;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.input-group label {
  display: block;
  margin-bottom: 6px;
  color: #333;
  font-size: 13px;
  font-weight: 600;
}

.input-group input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e1e8ed;
  border-radius: 8px;
  font-size: 15px;
  transition: all 0.3s ease;
  background: #f8f9fa;
}

.input-group input:focus {
  outline: none;
  border-color: #667eea;
  background: white;
}

/* Gestion de l'oeil (Visibilité Password) */
.password-wrapper {
  position: relative;
  width: 100%;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #999;
  z-index: 5;
  padding: 5px;
}

.password-toggle:hover {
  color: #667eea;
}

/* --- BOUTONS --- */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  width: 100%;
  padding: 12px;
  background: white;
  color: #666;
  border: 2px solid #e1e8ed;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: #f8f9fa;
  border-color: #ccc;
}

.login-link {
  text-align: center;
  margin-top: 20px;
  color: #666;
  font-size: 13px;
}

.login-link a {
  color: #667eea;
  text-decoration: none;
  font-weight: 700;
}

/* --- GESTION DES ERREURS --- */
.error-text {
  color: #e74c3c;
  font-size: 12px;
  margin-top: 4px;
  display: block;
  font-weight: 500;
}

/* --- POPUP MODAL (STATUS) --- */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: white;
  padding: 35px 25px;
  border-radius: 20px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

.modal-icon { font-size: 50px; margin-bottom: 15px; }
h3.success { color: #10b981; margin-bottom: 10px; }
h3.error { color: #ef4444; margin-bottom: 10px; }

.close-btn {
  position: absolute;
  top: 15px; right: 20px;
  font-size: 24px;
  color: #ccc;
  cursor: pointer;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  body {
    padding: 20px 10px; /* Plus petit padding sur mobile */
    align-items: flex-start; /* Aligne en haut pour éviter que le haut soit mangé */
  }

  .container {
    grid-template-columns: 1fr; /* Une seule colonne */
    border-radius: 15px;
  }

  .left-panel {
    padding: 30px;
    /* Optionnel : tu peux cacher le panneau gauche sur mobile pour raccourcir le scroll */
    /* display: none; */ 
  }

  .right-panel {
    padding: 30px 20px;
  }
}