/* Style général */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
  transition: all 0.3s ease;
}

body {
  background: #080710;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
}

/* Arrière-plan avec formes organiques */
.background {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  overflow: hidden;
}

.shape {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  filter: blur(70px);
  animation: float 15s infinite ease-in-out;
}

.shape:nth-child(1) {
  background: linear-gradient(35deg, #4158D0, #C850C0);
  top: -150px;
  left: -80px;
  animation-delay: 0s;
}

.shape:nth-child(2) {
  background: linear-gradient(35deg, #FF9966, #FF5E62);
  bottom: -150px;
  right: -80px;
  animation-delay: -7.5s;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
  25% {
    transform: translate(50px, 25px) rotate(5deg) scale(1.05);
  }
  50% {
    transform: translate(25px, 50px) rotate(10deg) scale(1.1);
  }
  75% {
    transform: translate(-25px, 25px) rotate(5deg) scale(1.05);
  }
}

/* Container principal */
.container {
  width: 100%;
  max-width: 430px;
  padding: 0 20px;
  z-index: 1;
}

form {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 40px rgba(8, 7, 16, 0.6);
  border-radius: 10px;
  padding: 35px;
  color: #ffffff;
  letter-spacing: 0.5px;
  transform: translateY(0);
  transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1), box-shadow 0.3s ease;
  will-change: transform; /* Optimisation pour les animations */
}

form:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 50px rgba(8, 7, 16, 0.8);
}

h3 {
  font-size: 32px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 30px;
  background: linear-gradient(to right, #4158D0, #C850C0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient 5s ease infinite;
  background-size: 200% auto;
}

@keyframes gradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Groupes d'entrée */
.input-group {
  margin-bottom: 25px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
}

.input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.input-container i {
  position: absolute;
  left: 15px;
  color: #aaa;
  z-index: 1;
  transition: color 0.3s ease;
}

.input-container .toggle-password {
  left: auto;
  right: 15px;
  cursor: pointer;
}

input {
  display: block;
  height: 50px;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.07);
  border: none;
  color: #ffffff;
  border-radius: 5px;
  padding: 0 45px;
  font-size: 14px;
  font-weight: 300;
  outline: none;
  position: relative;
  z-index: 0;
}

input::placeholder {
  color: #aaa;
}

.focus-border {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(to right, #4158D0, #C850C0);
  transition: width 0.4s ease;
  z-index: 1;
  border-radius: 2px;
}

input:focus + .focus-border,
input:valid + .focus-border {
  width: 100%;
}

input:focus + .focus-border + i,
input:valid + .focus-border + i {
  color: #C850C0;
}

/* Options (Se souvenir de moi et Mot de passe oublié) */
.options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  font-size: 13px;
}

.remember-me {
  display: flex;
  align-items: center;
}

.remember-me input {
  width: auto;
  height: auto;
  margin-right: 8px;
}

.forgot-password {
  color: #C850C0;
  text-decoration: none;
  transition: color 0.3s ease;
}

.forgot-password:hover {
  color: #4158D0;
  text-decoration: underline;
}

/* Bouton de connexion */
.login-btn {
  width: 100%;
  background: linear-gradient(to right, #4158D0, #C850C0);
  color: #ffffff;
  padding: 15px 0;
  font-size: 18px;
  font-weight: 600;
  border-radius: 5px;
  cursor: pointer;
  border: none;
  margin-bottom: 20px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.login-btn:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, #C850C0, #4158D0);
  transition: all 0.5s ease;
  z-index: -1;
}

.login-btn:hover:before {
  left: 0;
}

.login-btn:hover {
  box-shadow: 0 5px 15px rgba(192, 80, 192, 0.4);
  transform: translateY(-3px);
}

.login-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 5px rgba(192, 80, 192, 0.4);
}

/* Section d'inscription */
.register {
  text-align: center;
  margin-bottom: 20px;
  font-size: 14px;
}

.register a {
  color: #C850C0;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.register a:hover {
  color: #4158D0;
  text-decoration: underline;
}


.social-icon:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
}

/* Styles pour la page de succès */
.success-container {
  text-align: center;
  padding: 40px 20px;
}

.success-container h2 {
  font-size: 32px;
  margin-bottom: 20px;
  background: linear-gradient(to right, #4158D0, #C850C0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.welcome-message {
  font-size: 20px;
  margin-bottom: 15px;
  color: #fff;
}

.back-button {
  display: inline-block;
  margin-top: 20px;
  padding: 10px 20px;
  background: linear-gradient(to right, #4158D0, #C850C0);
  color: #ffffff;
  border-radius: 5px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.back-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(192, 80, 192, 0.4);
}

.error-message {
  background-color: rgba(255, 0, 0, 0.1);
  border-left: 3px solid #ff0000;
  color: #ff0000;
  padding: 10px;
  margin-bottom: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
}

.error-message i {
  margin-right: 10px;
}

.success-message {
  background-color: rgba(0, 128, 0, 0.1);
  border-left: 3px solid #008000;
  color: #008000;
  padding: 10px;
  margin-bottom: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
}

.success-message i {
  margin-right: 10px;
}

.info-text {
  color: #666;
  font-size: 0.9em;
  margin-bottom: 20px;
  text-align: center;
}

/* Responsive design */
@media (max-width: 768px) {
  .container {
    padding: 0 15px;
  }
  
  form {
    padding: 25px;
  }
  
  h3 {
    font-size: 28px;
  }
  
  .options {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .social-icons {
    gap: 10px;
  }
}

@media (max-width: 480px) {
  form {
    padding: 20px;
  }
  
  h3 {
    font-size: 24px;
    margin-bottom: 20px;
  }
  
  .login-btn {
    padding: 12px 0;
    font-size: 16px;
  }
  
  .input-container i {
    left: 10px;
  }
  
  .input-container .toggle-password {
    right: 10px;
  }
  
  input {
    padding: 0 35px;
  }
}