/* ============================================
   SIGN-IN PAGE - MODERN DESIGN
   ============================================ */

/* Reset global pour la page de connexion */
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow-x: hidden;
}

/* Reset et configuration de base */
.sign-in-modern-page {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 50%, #a5d6a7 100%);
  position: relative;
  overflow: hidden;
}

/* Effet de fond animé */
.sign-in-modern-page::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%
  );
  animation: rotate 30s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Container principal */
.sign-in-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 480px;
  padding: 20px;
}

/* Carte de connexion */
.sign-in-card {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 50px 40px;
  position: relative;
  overflow: hidden;
  animation: slideUp 0.6s ease-out;
}

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

/* Logo WiiCmenu */
.sign-in-logo {
  text-align: center;
  margin-bottom: 40px;
}

.sign-in-logo img {
  max-width: 220px;
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
  animation: logoFadeIn 0.8s ease-out;
}

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

/* Titre de la page */
.sign-in-title {
  text-align: center;
  margin-bottom: 35px;
}

.sign-in-title h2 {
  font-family: 'Raleway-SemiBold', sans-serif;
  font-size: 28px;
  color: #333;
  margin: 0 0 10px 0;
  font-weight: 600;
}

.sign-in-title p {
  font-size: 15px;
  color: #666;
  margin: 0;
}

/* Formulaire */
.sign-in-form {
  margin-bottom: 0;
}

/* Groupe de champ */
.form-group-modern {
  margin-bottom: 25px;
  position: relative;
}

.form-group-modern label {
  display: block;
  font-family: 'Raleway-SemiBold', sans-serif;
  font-size: 14px;
  color: #333;
  margin-bottom: 8px;
  font-weight: 600;
}

.form-group-modern label .required {
  color: #e74c3c;
  margin-left: 3px;
}

/* Input wrapper pour les icônes */
.input-wrapper {
  position: relative;
  display: block;
}

.input-wrapper i {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: #94d8a8;
  font-size: 18px;
  z-index: 2;
  transition: color 0.3s ease;
}

.input-wrapper input:focus + i,
.input-wrapper input:focus ~ i {
  color: #368212;
}

/* Champs de saisie */
.input-modern {
  width: 100%;
  padding: 15px 20px 15px 50px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  font-size: 16px;
  font-family: 'Raleway-Regular', sans-serif;
  color: #333;
  background: #fff;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

/* Padding spécifique pour le champ mot de passe (avec icône œil) */
#password {
  padding-right: 50px;
}

.input-modern:focus {
  outline: none;
  border-color: #94d8a8;
  box-shadow: 0 0 0 4px rgba(148, 216, 168, 0.1);
  background: #fafffe;
}

.input-modern::placeholder {
  color: #aaa;
}

/* Bouton afficher/masquer mot de passe */
.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 18px;
  padding-right: 38px;
  z-index: 3;
  transition: color 0.3s ease;
  line-height: 1;
}

.password-toggle:hover {
  color: #368212;
}

.password-toggle:focus {
  outline: none;
}

/* Bouton de connexion */
.btn-sign-in {
  width: 100%;
  padding: 16px 20px;
  background: linear-gradient(135deg, #94d8a8 0%, #5fb878 100%);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 17px;
  font-family: 'Raleway-SemiBold', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(148, 216, 168, 0.4);
  margin-top: 10px;
  position: relative;
  overflow: hidden;
}

.btn-sign-in::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s;
}

.btn-sign-in:hover::before {
  left: 100%;
}

.btn-sign-in:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(148, 216, 168, 0.5);
  background: linear-gradient(135deg, #5fb878 0%, #368212 100%);
}

.btn-sign-in:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(148, 216, 168, 0.3);
}

/* Lien mot de passe oublié */
.forgot-password-link {
  text-align: center;
  margin-top: 20px;
}

.forgot-password-link a {
  color: #5fb878;
  text-decoration: none;
  font-size: 14px;
  font-family: 'Raleway-Regular', sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
}

.forgot-password-link a:hover {
  color: #368212;
  text-decoration: underline;
}

.forgot-password-link i {
  font-size: 13px;
}

/* Hint pour le mot de passe */
.password-hint {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: #999;
  font-family: 'Raleway-Regular', sans-serif;
}

/* Badge de sécurité */
.security-badge {
  text-align: center;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
}

.security-badge i {
  color: #94d8a8;
  font-size: 20px;
  margin-right: 8px;
}

.security-badge span {
  font-size: 13px;
  color: #999;
  font-family: 'Raleway-Regular', sans-serif;
}

/* Footer minimaliste */
.sign-in-footer {
  text-align: center;
  margin-top: 30px;
  padding: 20px;
}

.sign-in-footer a {
  color: #2e7d32;
  text-decoration: none;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.3s ease;
  font-weight: 500;
}

.sign-in-footer a:hover {
  opacity: 0.7;
}

.sign-in-footer img {
  filter: brightness(0) saturate(100%) invert(24%) sepia(18%) saturate(2447%)
    hue-rotate(93deg) brightness(95%) contrast(90%);
}

/* Responsive Design */
@media (max-width: 576px) {
  .sign-in-container {
    padding: 15px;
  }

  .sign-in-card {
    padding: 40px 25px;
    border-radius: 20px;
  }

  .sign-in-logo img {
    max-width: 180px;
  }

  .sign-in-title h2 {
    font-size: 24px;
  }

  .sign-in-title p {
    font-size: 14px;
  }

  .input-modern {
    padding: 14px 18px 14px 45px;
    font-size: 15px;
  }

  .input-wrapper i {
    left: 15px;
    font-size: 16px;
  }

  .btn-sign-in {
    padding: 15px 18px;
    font-size: 16px;
  }

  .password-toggle {
    right: 15px;
    font-size: 16px;
  }
}

@media (max-width: 400px) {
  .sign-in-card {
    padding: 35px 20px;
  }

  .sign-in-logo img {
    max-width: 160px;
  }

  .sign-in-title h2 {
    font-size: 22px;
  }
}

/* Animation de chargement sur le bouton */
.btn-sign-in.loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn-sign-in.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-left: -10px;
  margin-top: -10px;
  border: 2px solid #fff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Accessibilité - Focus visible */
.input-modern:focus-visible,
.btn-sign-in:focus-visible,
.password-toggle:focus-visible {
  outline: 3px solid #94d8a8;
  outline-offset: 2px;
}

/* Mode sombre forcé - La page de connexion reste toujours en mode sombre
   indépendamment des préférences système de l'utilisateur */
.sign-in-card {
  background: rgba(30, 30, 30, 0.95) !important;
}

.sign-in-title h2 {
  color: #fff !important;
}

.sign-in-title p {
  color: #ccc !important;
}

.form-group-modern label {
  color: #fff !important;
}

.input-modern {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
}

.input-modern:focus {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: #94d8a8 !important;
}

.input-modern::placeholder {
  color: #888 !important;
}

.security-badge {
  border-top-color: rgba(255, 255, 255, 0.1) !important;
}

.security-badge span {
  color: #aaa !important;
}
