/* --- Correction globale du sizing --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', sans-serif;
  margin: 0;
  padding: 0;
  height: 100vh;
  background: url("/assets/img/home.png") no-repeat center center fixed;
  background-size: cover;
  display: flex;
  justify-content: flex-end; /* 👈 place le form sur le côté droit */
  align-items: center;
  padding-right: 14%; /* 👈 espace du bord droit */
}

/* --- Carte du formulaire --- */
.overlay {
  width: 100%;
  max-width: 515px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 20px;
  padding: 45px 40px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(6px);
  text-align: center;
  animation: fadeIn 0.8s ease-in-out;
}

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

/* --- Logo --- */
.avatar img {
  width: 100px;
  height: 100px;
}

/* --- Titre --- */
.overlay h2 {
  font-family: 'Nunito', sans-serif;
  color: #0e0147;
  font-size: 26px;
  margin-bottom: 25px;
}

/* --- Champs et bouton (identiques) --- */
.overlay input[type="email"],
.overlay input[type="password"] {
  width: 100%;
  padding: 14px;
  margin-bottom: 18px;
  border-radius: 10px;
  border: 1px solid #ccc;
  background-color: #f8f8f8;
  font-size: 15px;
  transition: all 0.2s ease;
}
.overlay input:focus {
  border-color: #0e0147;
  outline: none;
  background-color: #fff;
}
.overlay button {
  width: 100%;
  background-color: #0e0147;
  color: white;
  border: none;
  padding: 14px;
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
}
.overlay button:hover {
  background-color: #1a0b6e;
  transform: translateY(-2px);
}

/* --- Checkbox + lien --- */
/* --- Correction parfaite d’alignement du checkbox --- */
.checkbox {
  display: flex;
  align-items: center;       /* ✅ centre verticalement */
  gap: 8px;                  /* espace entre la case et le texte */
  text-align: left;
  width: 100%;
  font-size: 14px;
  color: #555;
  margin-bottom: 20px;
}

.checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;                 /* ✅ retire le décalage par défaut */
  appearance: none;          /* supprime le style natif */
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 2px solid #999;
  border-radius: 4px;
  display: inline-block;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 1px 1px 1px 1px;
}

.checkbox input[type="checkbox"]:checked {
  background-color: #0e0147;
  border-color: #0e0147;
}

.checkbox input[type="checkbox"]:checked::after {
  content: "✔";
  color: white;
  font-size: 12px;
  position: absolute;
  top: 0;
  left: 3px;
}

.checkbox label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  line-height: 1; /* ✅ empêche le texte de descendre trop bas */
}


p.message {
  color: #555;
  font-size: 14px;
  margin-top: 20px;
}
p.message a {
  color: #0e0147;
  text-decoration: none;
  font-weight: 600;
}
p.message a:hover {
  text-decoration: underline;
}

/* --- Responsive --- */
@media (max-width: 992px) {
  body {
    justify-content: center;
    padding: 20px;
    background-position: center;
  }
}
.role-selection {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.role-option {
  flex: 1;
  padding: 10px 15px;
  border: 2px solid #ccc;
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.role-option.selected {
  border-color: #0e0147;
  background-color: rgba(14, 1, 71, 0.08);
  color: #0e0147;
  font-weight: 600;
}

.role-title {
  text-align: left;
  font-size: 15px;
  color: #333;
  margin-bottom: 10px;
}
/* --- Uniformiser les champs générés par Symfony --- */
.overlay input,
.overlay select,
.overlay textarea {
  width: 100%;
  padding: 14px;
  margin-bottom: 18px;
  border-radius: 10px;
  border: 1px solid #ccc;
  background-color: #f8f8f8;
  font-size: 15px;
  transition: all 0.2s ease;
  box-sizing: border-box;
  font-family: 'Roboto', sans-serif;
}

.overlay input:focus,
.overlay select:focus,
.overlay textarea:focus {
  border-color: #0e0147;
  outline: none;
  background-color: #fff;
  box-shadow: 0 0 5px rgba(14, 1, 71, 0.2);
}
/* --- Uniformisation du style des menus déroulants --- */
.overlay select {
  width: 100%;
  padding: 14px;
  margin-bottom: 18px;
  border-radius: 10px;
  border: 1px solid #ccc;
  background-color: #f8f8f8;
  font-size: 15px;
  font-family: 'Roboto', sans-serif;
  color: #333;
  transition: all 0.2s ease;
  box-sizing: border-box;
  appearance: none; /* enlève le style natif */
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%230e0147' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  cursor: pointer;
}

/* Effet au survol et au focus */
.overlay select:hover {
  border-color: #0e0147;
}

.overlay select:focus {
  outline: none;
  border-color: #0e0147;
  box-shadow: 0 0 5px rgba(14, 1, 71, 0.2);
  background-color: #fff;
}

/* Couleur quand désactivé */
.overlay select:disabled {
  background-color: #eee;
  color: #999;
  cursor: not-allowed;
}

/* Correction Safari / Firefox */
.overlay option {
  background-color: #fff;
  color: #333;
}
/* --- Style pour les messages d’erreur de formulaire --- */
.overlay .error-message,
.overlay .form-error-message,
.overlay ul li {
  background-color: rgba(220, 53, 69, 0.1); /* rouge doux transparent */
  color: #b30000;
  border: 1px solid rgba(220, 53, 69, 0.3);
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 14px;
  font-family: 'Roboto', sans-serif;
  text-align: left;
  list-style: none; /* supprime le point des <li> */
}

/* Si Symfony affiche des <ul> autour des erreurs */
.overlay ul {
  padding: 0;
  margin: 0;
}

/* Petites animations pour le confort visuel */
.overlay .error-message {
  animation: fadeIn 0.3s ease-in-out;
}

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

.overlay .success-message {
  background-color: rgba(40, 167, 69, 0.1);
  color: #155724;
  border: 1px solid rgba(40, 167, 69, 0.3);
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 14px;
  font-family: 'Roboto', sans-serif;
  text-align: left;
  animation: fadeIn 0.3s ease-in-out;
}
/* --- Messages d’erreur Symfony (connexion, sécurité, etc.) --- */
.overlay .alert,
.overlay .alert-danger {
  background-color: rgba(220, 53, 69, 0.1); /* rouge doux transparent */
  color: #b30000;
  border: 1px solid rgba(220, 53, 69, 0.3);
  padding: 12px 15px;
  border-radius: 8px;
  margin-bottom: 15px;
  font-size: 14px;
  font-family: 'Roboto', sans-serif;
  text-align: left;
  animation: fadeIn 0.3s ease-in-out;
}

/* Messages de succès (ex: inscription validée) */
.overlay .alert-success,
.overlay .success-message {
  background-color: rgba(40, 167, 69, 0.1);
  color: #155724;
  border: 1px solid rgba(40, 167, 69, 0.3);
  padding: 12px 15px;
  border-radius: 8px;
  margin-bottom: 15px;
  font-size: 14px;
  font-family: 'Roboto', sans-serif;
  text-align: left;
  animation: fadeIn 0.3s ease-in-out;
}
/* --- Image de fond différente sur mobile --- */
@media (max-width: 768px) {
  body {
    background: url("/assets/img/hero2.png") no-repeat center center fixed;
    background-size: cover;
    justify-content: center; /* 👈 le form centré sur mobile */
    padding: 20px;
  }
}
