/**
 * Styles pour l'authentification
 */

/* Modale */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-content h2 {
  margin-top: 0;
  margin-bottom: 10px;
  color: #2c3e50;
  font-size: 1.5em;
}

.modal-content p {
  margin-bottom: 20px;
  color: #666;
}

/* Formulaires */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: #2c3e50;
  font-size: 0.9em;
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 1em;
  transition: border-color 0.3s;
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: #3498db;
}

.form-group small {
  display: block;
  margin-top: 5px;
  font-size: 0.85em;
  color: #666;
}

/* Password input wrapper */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  flex: 1;
  padding-right: 45px;
}

.toggle-password {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2em;
  padding: 5px 8px;
  border-radius: 4px;
  transition: background 0.2s;
  user-select: none;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
}

.toggle-password:hover {
  background: rgba(0, 0, 0, 0.05);
}

.toggle-password:active {
  transform: scale(0.95);
}

.toggle-password:focus {
  outline: 2px solid #3498db;
  outline-offset: 2px;
}

/* Messages d'erreur */
.error-message {
  background: #fee;
  color: #c33;
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 15px;
  font-size: 0.9em;
  border-left: 3px solid #c33;
}

/* Boutons */
.form-actions {
  margin-top: 25px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary {
  background: #3498db;
  color: white;
}

.btn-primary:hover {
  background: #2980b9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-primary:disabled {
  background: #95a5a6;
  cursor: not-allowed;
  transform: none;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.85em;
}

/* Info utilisateur */
#userInfo {
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .modal-content {
    padding: 20px;
    width: 95%;
  }

  #userInfo {
    top: 5px;
    right: 5px;
    padding: 8px 12px;
    font-size: 0.9em;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .modal-content {
    background: #2c3e50;
    color: #ecf0f1;
  }

  .modal-content h2 {
    color: #ecf0f1;
  }

  .form-group label {
    color: #ecf0f1;
  }

  .form-group input {
    background: #34495e;
    border-color: #4a5f7f;
    color: #ecf0f1;
  }

  .form-group input:focus {
    border-color: #3498db;
  }

  #userInfo {
    background: #34495e;
    color: #ecf0f1;
  }
}
