/* Styles pour les pages d'authentification */

/* Réinitialisation */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Montserrat', sans-serif;
  background-color: #f5f5f5;
  color: #333;
}

/* Header et navigation */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background-color: #bb0b0b;
  color: white;
  position: relative;
  z-index: 100;
  margin-bottom: 40px; /* Ajouter un espace entre le header et le contenu */
}

.header-logo img {
  height: 40px;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 20px;
}

.news-link, .add-event-link {
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

.user-icon-link img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
}

/* Conteneur principal */
.auth-container {
  max-width: 600px;
  margin: 50px auto;
  padding: 30px;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Titre de la page */
.auth-title {
  text-align: center;
  margin-bottom: 30px;
  color: #bb0b0b;
  font-size: 24px;
  font-weight: bold;
  position: relative;
  z-index: 5;
}

/* Conteneur principal */
.auth-container {
  max-width: 500px;
  margin: 10px auto 50px;
  padding: 30px;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 5;
}

/* Onglets pour basculer entre connexion et inscription */
.auth-tabs {
  display: flex;
  margin-bottom: 30px;
  border-bottom: 1px solid #ddd;
}

.auth-tab {
  flex: 1;
  padding: 15px;
  text-align: center;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.auth-tab.active {
  color: #bb0b0b;
  border-bottom: 3px solid #bb0b0b;
}

/* Formulaires */
.auth-form {
  display: none;
}

.auth-form.active, 
#reset-request-form,
#new-password-form {
  display: block;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #555;
}

.form-group input {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 16px;
  transition: border-color 0.3s;
}

.form-group input:focus {
  border-color: #bb0b0b;
  outline: none;
}

/* Sélection du rôle */
.role-selection {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}

.role-option {
  flex: 1;
  border: 2px solid #ddd;
  border-radius: 5px;
  padding: 15px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

.role-option.selected {
  border-color: #bb0b0b;
  background-color: rgba(0, 58, 112, 0.05);
}

.role-option h3 {
  margin-bottom: 8px;
  color: #bb0b0b;
}

.role-option p {
  font-size: 14px;
  color: #666;
}

/* Option Se souvenir de moi */
.remember-me {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.remember-me input {
  margin-right: 8px;
}

/* Bouton de soumission */
.auth-button {
  width: 100%;
  padding: 12px 0;
  background-color: #bb0b0b;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s;
}

.auth-button:hover {
  background-color: #a80b0b;
}

/* Messages d'erreur */
.error-message {
  color: #e74c3c;
  margin-top: 20px;
  padding: 10px;
  background-color: rgba(231, 76, 60, 0.1);
  border-radius: 5px;
  text-align: center;
  display: none;
}

/* Messages de succès */
.success-message {
  color: #27ae60;
  margin-top: 20px;
  padding: 10px;
  background-color: rgba(39, 174, 96, 0.1);
  border-radius: 5px;
  text-align: center;
  display: none;
}

/* Champ honeypot (invisible) */
.honeypot {
  display: none;
}

/* Responsive */
@media (max-width: 768px) {
  .auth-container {
    margin: 30px 15px;
    padding: 20px;
  }
  
  .role-selection {
    flex-direction: column;
  }
}

/* Lien "Mot de passe oublié" */
.forgot-password {
  text-align: right;
  margin-bottom: 20px;
}

.forgot-password a {
  color: #bb0b0b;
  text-decoration: none;
  font-size: 14px;
}

.forgot-password a:hover {
  text-decoration: underline;
}

/* Profil utilisateur connecté */
.user-profile {
  display: none; /* Caché par défaut */
}

.user-profile.active {
  display: block;
}

.profile-header {
  display: flex;
  align-items: center;
  margin-bottom: 30px;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  background-color: #bb0b0b;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 20px;
  color: white;
  font-size: 32px;
  font-weight: bold;
}

.profile-info h2 {
  color: #bb0b0b;
  margin-bottom: 5px;
}

.profile-info p {
  color: #666;
  font-size: 14px;
}

.profile-badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 8px;
}

.profile-badge.exposant {
  background-color: #e67e22;
  color: white;
}

.profile-badge.utilisateur {
  background-color: #3498db;
  color: white;
}

.profile-actions {
  margin-top: 30px;
}

.profile-actions button {
  padding: 10px 15px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  margin-right: 10px;
}

.profile-actions .logout-btn {
  background-color: #e74c3c;
  color: white;
}

.profile-actions .edit-btn {
  background-color: #f1f1f1;
  color: #333;
}

/* Indicateur de chargement */
.loader {
  display: none;
  text-align: center;
  margin: 20px 0;
}

.loader::after {
  content: "";
  display: inline-block;
  width: 30px;
  height: 30px;
  border: 3px solid #ddd;
  border-radius: 50%;
  border-top-color: #bb0b0b;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Styles spécifiques pour la réinitialisation de mot de passe */
.reset-info {
  text-align: center;
  margin-bottom: 20px;
  color: #555;
  font-size: 16px;
  line-height: 1.5;
}

.auth-alt-action {
  text-align: center;
  margin-top: 15px;
}

.auth-alt-action a {
  color: #bb0b0b;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s;
}

.auth-alt-action a:hover {
  text-decoration: underline;
  color: #a80b0b;
}