/* RESET DE BASE */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #0088cc, #004080);
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  color: white;
}

/* CONTENEUR DU FORMULAIRE */
.login-container {
  background-color: rgba(255, 255, 255, 0.08);
  padding: 40px 30px;
  border-radius: 15px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  width: 90%;
  max-width: 400px;
  text-align: center;
  animation: fadeIn 0.6s ease;
}

/* TITRE */
h1.title {
  font-size: 2rem;
  margin-bottom: 25px;
}

/* CHAMPS DE TEXTE */
input {
  width: 100%;
  padding: 12px 15px;
  margin: 10px 0;
  border-radius: 8px;
  border: 1px solid #005c99;
  background-color: rgba(255, 255, 255, 0.07);
  color: white;
  font-size: 1rem;
  text-align: center;
}

input::placeholder {
  color: #cccccc;
}

input:focus {
  outline: none;
  background-color: rgba(255, 255, 255, 0.1);
  border-color: #00aaff;
}

/* BOUTON DE CONNEXION */
button {
  width: 100%;
  padding: 12px;
  margin-top: 20px;
  border: none;
  border-radius: 8px;
  background-color: #00aaff;
  color: white;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #008ecc;
}

/* MESSAGE D'ERREUR */
.error-msg {
  color: #ff8888;
  margin-top: 10px;
  font-size: 0.9em;
}

/* LIEN DE RETOUR */
.back-link {
  display: inline-block;
  margin-top: 20px;
  color: #cccccc;
  font-size: 0.9em;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
  color: white;
}

/* FOOTER */
.footer {
  margin-top: 30px;
  font-size: 0.85em;
  color: #eeeeee;
  user-select: none;
  text-align: center;
}

/* LIEN D'INSCRIPTION */
.register-wrapper {
  margin-top: 20px;
  font-size: 0.9em;
  color: white;
}

.register-link {
  color: white;
  font-weight: bold;
  text-decoration: none;
  position: relative;
  display: inline-block;
  animation: floatIn 1s ease forwards;
}

.register-link::after {
  content: "";
  position: absolute;
  width: 0%;
  height: 2px;
  left: 0;
  bottom: -2px;
  background-color: white;
  transition: width 0.3s ease;
}

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

/* ANIMATIONS */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* MODAL GÉNÉRALE */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 999;
}

.modal-content {
  padding: 30px;
  border-radius: 15px;
  color: white;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s ease-out;
}

.modal-buttons button {
  padding: 12px 25px;
  margin-top: 20px;
  border: none;
  border-radius: 8px;
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

/* MODAL D'ERREUR */
#errorModal .modal-content {
  background: linear-gradient(135deg, #cc4444, #660000);
}

#errorModal .modal-buttons button {
  background-color: #ffaa00;
}

#errorModal .modal-buttons button:hover {
  background-color: #cc8800;
}

/* MODAL DE SUCCÈS */
#successModal .modal-content {
  background: linear-gradient(135deg, #28a745, #155724);
  animation: successPop 0.4s ease-out;
}

#successModal .modal-buttons button {
  background-color: #20c997;
}

#successModal .modal-buttons button:hover {
  background-color: #17a2b8;
  transform: scale(1.05);
}

@keyframes successPop {
  0% {
    opacity: 0;
    transform: scale(0.7) translateY(-20px);
  }
  50% {
    transform: scale(1.05) translateY(0);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}