/* ==========================================================================
   components.css — les briques réutilisables de l'interface

   Chaque bloc ici est indépendant des pages : boutons, cartes, badges,
   barres de progression, éditeur, résultats de tests…
   ========================================================================== */

/* --------------------------------------------------------------------------
   Boutons
   -------------------------------------------------------------------------- */

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--esp-2);
  padding: var(--esp-3) var(--esp-5);
  border: 1px solid transparent;
  border-radius: var(--rayon-m);
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-align: center;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition);
}

.bouton:hover {
  text-decoration: none;
}

.bouton:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.bouton-principal {
  background-color: var(--accent);
  color: var(--sur-accent);
}

.bouton-principal:hover:not(:disabled) {
  background-color: var(--accent-sombre);
}

.bouton-secondaire {
  background-color: var(--surface-active);
  border-color: var(--bordure);
  color: var(--texte);
}

.bouton-secondaire:hover:not(:disabled) {
  border-color: var(--bordure-claire);
  background-color: var(--surface-haute);
}

.bouton-discret {
  background-color: transparent;
  border-color: var(--bordure);
  color: var(--texte-doux);
  font-weight: 500;
  padding: var(--esp-2) var(--esp-4);
}

.bouton-discret:hover:not(:disabled) {
  color: var(--texte);
  border-color: var(--bordure-claire);
}

.bouton-danger {
  background-color: transparent;
  border-color: rgba(255, 107, 107, 0.4);
  color: var(--erreur);
}

.bouton-danger:hover:not(:disabled) {
  background-color: rgba(255, 107, 107, 0.1);
  border-color: var(--erreur);
}

.bouton kbd {
  margin-left: var(--esp-1);
}

/* --------------------------------------------------------------------------
   Puces, étiquettes, badges
   -------------------------------------------------------------------------- */

.puce {
  display: inline-flex;
  align-items: center;
  padding: 3px var(--esp-3);
  border: 1px solid var(--bordure);
  border-radius: 999px;
  background-color: var(--surface);
  color: var(--texte-doux);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.puce-accent {
  color: var(--accent);
  border-color: rgba(46, 230, 168, 0.35);
  background-color: var(--accent-voile);
}

.etiquettes {
  display: flex;
  flex-wrap: wrap;
  gap: var(--esp-2);
}

.etiquette {
  display: inline-block;
  padding: 2px var(--esp-3);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon-s);
  background-color: var(--fond-eleve);
  color: var(--texte-discret);
  font-size: 0.78rem;
  white-space: nowrap;
}

.etiquette-accent {
  color: var(--accent);
  border-color: rgba(46, 230, 168, 0.3);
}

.badge {
  display: inline-block;
  padding: var(--esp-1) var(--esp-3);
  border-radius: var(--rayon-s);
  font-size: 0.82rem;
  font-weight: 600;
}

.badge-succes {
  background-color: var(--accent-voile);
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   Difficulté et métadonnées
   -------------------------------------------------------------------------- */

.etoiles {
  letter-spacing: 1px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.etoiles-pleines {
  color: var(--accent);
}

.etoiles-vides {
  color: var(--bordure-claire);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--esp-3);
  margin: var(--esp-3) 0;
  color: var(--texte-discret);
  font-size: 0.84rem;
}

.meta-item {
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Barre de progression
   -------------------------------------------------------------------------- */

.barre {
  height: 8px;
  width: 100%;
  border-radius: 999px;
  background-color: var(--surface-active);
  overflow: hidden;
}

.barre-remplissage {
  height: 100%;
  border-radius: 999px;
  background-color: var(--accent);
  transition: width 0.4s ease;
}

/* --------------------------------------------------------------------------
   Cartes et panneaux
   -------------------------------------------------------------------------- */

.carte {
  position: relative;
  background-color: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon-l);
  padding: var(--esp-5);
  transition: border-color var(--transition);
}

.carte:hover {
  border-color: var(--bordure-claire);
}

.carte-numero {
  display: block;
  color: var(--accent);
  font-family: var(--police-code);
  font-size: 0.82rem;
  margin-bottom: var(--esp-2);
}

.carte-titre {
  font-size: 1.02rem;
  margin-bottom: var(--esp-2);
}

.carte-texte {
  color: var(--texte-doux);
  font-size: 0.92rem;
  margin: 0;
}

.panneau {
  background-color: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon-l);
  padding: var(--esp-5);
}

.panneau-entete {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--esp-4);
  margin-bottom: var(--esp-4);
}

.panneau-titre {
  font-size: 1.1rem;
  margin: 0;
}

.panneau-valeur {
  color: var(--accent);
  font-size: 1.5rem;
  font-weight: 700;
}

.panneau-etiquette {
  color: var(--texte-discret);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--esp-2);
}

.panneau-texte {
  color: var(--texte-doux);
  font-size: 0.94rem;
  max-width: 75ch;
}

.panneau-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--esp-3);
  margin-top: var(--esp-4);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--esp-4);
  background-color: var(--fond-eleve);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon-m);
}

.stat-valeur {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--texte);
  line-height: 1.1;
}

.stat-libelle {
  color: var(--texte-discret);
  font-size: 0.82rem;
}

/* --------------------------------------------------------------------------
   Alertes et notifications
   -------------------------------------------------------------------------- */

.alerte {
  padding: var(--esp-3) var(--esp-4);
  border-radius: var(--rayon-m);
  border: 1px solid var(--bordure);
  font-size: 0.9rem;
}

.alerte-erreur {
  border-color: rgba(255, 107, 107, 0.4);
  background-color: rgba(255, 107, 107, 0.08);
  color: #ffb3b3;
}

.alerte-attention {
  border-color: rgba(242, 193, 78, 0.4);
  background-color: rgba(242, 193, 78, 0.08);
  color: #f5d68a;
}

.notification {
  pointer-events: auto;
  padding: var(--esp-3) var(--esp-4);
  border-radius: var(--rayon-m);
  border: 1px solid var(--bordure-claire);
  background-color: var(--surface-haute);
  color: var(--texte);
  font-size: 0.9rem;
  box-shadow: var(--ombre-m);
  animation: notification-entree 0.25s ease;
}

.notification-succes {
  border-color: rgba(46, 230, 168, 0.5);
  color: var(--accent);
}

.notification-attention {
  border-color: rgba(242, 193, 78, 0.5);
  color: #f5d68a;
}

.notification-sortie {
  opacity: 0;
  transition: opacity 0.3s ease;
}

@keyframes notification-entree {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --------------------------------------------------------------------------
   Onglets
   -------------------------------------------------------------------------- */

.onglet {
  padding: var(--esp-2) var(--esp-4);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--texte-discret);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}

.onglet:hover {
  color: var(--texte);
}

.onglet.actif {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.onglet-note {
  color: var(--texte-discret);
  font-weight: 400;
  font-size: 0.75rem;
}

/* --------------------------------------------------------------------------
   Éditeur, aperçu, console
   -------------------------------------------------------------------------- */

.editeur,
.sortie {
  background-color: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon-l);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.editeur-onglets,
.sortie-onglets {
  display: flex;
  gap: var(--esp-1);
  padding: 0 var(--esp-3);
  border-bottom: 1px solid var(--bordure);
  background-color: var(--fond-eleve);
  overflow-x: auto;
}

.editeur-zone {
  flex: 1;
  width: 100%;
  min-height: 320px;
  padding: var(--esp-4);
  border: none;
  background-color: var(--surface);
  color: var(--texte);
  font-family: var(--police-code);
  font-size: 0.88rem;
  line-height: 1.7;
  resize: vertical;
  tab-size: 2;
}

.editeur-zone:focus {
  outline: none;
  box-shadow: inset 0 0 0 1px var(--accent);
}

.editeur-lecture {
  flex: 1;
  min-height: 320px;
  max-height: 480px;
  overflow: auto;
  padding: var(--esp-4);
  margin: 0;
  background-color: var(--fond-eleve);
  color: var(--texte-doux);
  font-size: 0.86rem;
  line-height: 1.7;
}

.editeur-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--esp-3);
  padding: var(--esp-3) var(--esp-4);
  border-top: 1px solid var(--bordure);
  background-color: var(--fond-eleve);
}

.editeur-actions .bouton-principal {
  margin-left: auto;
}

.sortie-corps {
  flex: 1;
  min-height: 260px;
  display: flex;
}

.apercu {
  flex: 1;
  width: 100%;
  min-height: 260px;
  border: none;
  background-color: var(--fond);
}

.console {
  flex: 1;
  min-height: 260px;
  max-height: 420px;
  overflow: auto;
  padding: var(--esp-4);
  background-color: var(--fond);
  color: var(--texte-doux);
  font-size: 0.84rem;
  line-height: 1.7;
}

.console-erreur {
  color: var(--erreur);
}

.console-traduit {
  color: var(--texte-doux);
  white-space: pre;
  overflow: auto;
}

/* --------------------------------------------------------------------------
   Disque simulé (niveau Node.js)
   -------------------------------------------------------------------------- */

.disque {
  flex: 1;
  min-height: 260px;
  max-height: 44vh;
  overflow: auto;
  padding: var(--esp-4);
  background-color: var(--fond);
  display: flex;
  flex-direction: column;
  gap: var(--esp-3);
}

.disque-fichier {
  border: 1px solid var(--bordure);
  border-radius: var(--rayon-m);
  overflow: hidden;
}

.disque-nom {
  margin: 0;
  padding: var(--esp-2) var(--esp-3);
  background-color: var(--fond-eleve);
  border-bottom: 1px solid var(--bordure);
  color: var(--accent);
  font-family: var(--police-code);
  font-size: 0.78rem;
}

.disque-contenu {
  margin: 0;
  padding: var(--esp-3);
  max-height: 220px;
  overflow: auto;
  color: var(--texte-doux);
  font-size: 0.78rem;
  line-height: 1.6;
  white-space: pre;
}

.disque-vide {
  margin: 0;
  color: var(--texte-discret);
  font-size: 0.86rem;
}

/* --------------------------------------------------------------------------
   Diagnostics du compilateur TypeScript
   -------------------------------------------------------------------------- */

.diagnostics {
  flex: 1;
  min-height: 260px;
  max-height: 44vh;
  overflow: auto;
  padding: var(--esp-4);
  background-color: var(--fond);
}

.diagnostic-vide {
  margin: 0;
  color: var(--accent);
  font-size: 0.88rem;
}

.diagnostics-liste {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--esp-2);
}

.diagnostics-liste li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: var(--esp-3);
  padding: var(--esp-3);
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-left: 3px solid var(--erreur);
  border-radius: var(--rayon-s);
  background-color: rgba(255, 107, 107, 0.06);
}

.diagnostic-position {
  color: var(--texte-discret);
  font-family: var(--police-code);
  font-size: 0.76rem;
  white-space: nowrap;
}

.diagnostic-message {
  color: #ffb3b3;
  font-size: 0.86rem;
  min-width: 0;
}

.diagnostic-code {
  color: var(--texte-discret);
  font-family: var(--police-code);
  font-size: 0.72rem;
  opacity: 0.7;
}

.chargement-ts {
  text-align: center;
}

@media (max-width: 640px) {
  .diagnostics-liste li {
    grid-template-columns: 1fr;
    gap: var(--esp-1);
  }
}

/* Aperçu React : le composant est monté ici même, dans un Shadow DOM. */
.apercu-react {
  flex: 1;
  min-height: 260px;
  max-height: 44vh;
  overflow: auto;
  padding: var(--esp-5);
  background-color: var(--fond);
}

/* --------------------------------------------------------------------------
   Terminal (niveau Git)
   -------------------------------------------------------------------------- */

.terminal {
  display: flex;
  flex-direction: column;
  background-color: #050807;
  border: 1px solid var(--bordure);
  border-radius: var(--rayon-l);
  overflow: hidden;
}

.terminal-entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--esp-3);
  padding: var(--esp-2) var(--esp-3) var(--esp-2) var(--esp-4);
  background-color: var(--fond-eleve);
  border-bottom: 1px solid var(--bordure);
}

.terminal-titre {
  color: var(--texte-discret);
  font-size: 0.82rem;
  font-family: var(--police-code);
}

.terminal-sortie {
  min-height: 300px;
  max-height: 44vh;
  overflow-y: auto;
  padding: var(--esp-4);
  margin: 0;
  color: var(--texte-doux);
  font-size: 0.84rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  display: flex;
  flex-direction: column;
}

.terminal-invite {
  color: var(--accent);
  font-weight: 700;
  user-select: none;
}

.terminal-echo {
  color: var(--texte);
}

/* Les commandes du prélude sont jouées par la plateforme, pas par l'apprenant :
   elles doivent se distinguer de ce qu'il a tapé lui-même. */
.terminal-prelude {
  color: var(--texte-discret);
  opacity: 0.65;
}

.terminal-note {
  color: var(--texte-discret);
  font-style: italic;
  padding: var(--esp-2) 0;
}

.terminal-erreur {
  color: var(--erreur);
}

.terminal-ligne {
  display: flex;
  align-items: center;
  gap: var(--esp-2);
  padding: var(--esp-3) var(--esp-4);
  border-top: 1px solid var(--bordure);
  background-color: #050807;
}

.terminal-saisie {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  color: var(--texte);
  font-family: var(--police-code);
  font-size: 0.88rem;
}

.terminal-saisie:focus {
  outline: none;
}

.terminal-saisie::placeholder {
  color: var(--texte-discret);
  opacity: 0.6;
}

/* --------------------------------------------------------------------------
   Visualisation du dépôt
   -------------------------------------------------------------------------- */

.panneau-depot {
  background-color: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon-l);
  padding: var(--esp-4);
}

.depot-entete {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--esp-2);
  margin-bottom: var(--esp-3);
}

.depot-branche {
  padding: 2px var(--esp-3);
  border-radius: 999px;
  background-color: var(--accent-voile);
  border: 1px solid rgba(46, 230, 168, 0.3);
  color: var(--accent);
  font-family: var(--police-code);
  font-size: 0.78rem;
}

.depot-compte {
  color: var(--texte-discret);
  font-size: 0.78rem;
}

.depot-zones {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--esp-3);
}

.depot-zone {
  padding: var(--esp-3);
  background-color: var(--fond-eleve);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon-m);
  min-width: 0;
}

.depot-zone-index {
  border-color: rgba(242, 193, 78, 0.35);
}

.depot-zone-commits {
  border-color: rgba(46, 230, 168, 0.3);
}

.depot-zone-titre {
  margin: 0 0 var(--esp-2);
  color: var(--texte-discret);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.depot-liste {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.depot-liste li {
  color: var(--texte-doux);
  font-family: var(--police-code);
  font-size: 0.76rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.depot-liste code {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
}

.depot-vide {
  margin: 0;
  color: var(--texte-discret);
  font-size: 0.76rem;
  opacity: 0.7;
}

@media (max-width: 640px) {
  .depot-zones {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   Résultats de validation
   -------------------------------------------------------------------------- */

.resultats {
  margin-top: var(--esp-4);
  padding: var(--esp-4) var(--esp-5);
  background-color: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon-l);
}

.resultats.est-reussi {
  border-color: rgba(46, 230, 168, 0.45);
  background-color: rgba(46, 230, 168, 0.05);
}

.resultats-titre {
  font-size: 1.02rem;
  margin-bottom: var(--esp-3);
}

.resultats.est-reussi .resultats-titre {
  color: var(--accent);
}

.resultats-liste {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--esp-2);
}

.resultats-liste li {
  display: flex;
  align-items: flex-start;
  gap: var(--esp-3);
  font-size: 0.9rem;
  color: var(--texte-doux);
}

.resultats-liste .est-ok {
  color: var(--texte);
}

.resultat-marqueur {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 700;
}

.est-ok .resultat-marqueur {
  background-color: var(--accent-voile);
  color: var(--accent);
}

.est-ko .resultat-marqueur {
  background-color: rgba(255, 107, 107, 0.12);
  color: var(--erreur);
}

.resultats-vide {
  margin-top: var(--esp-4);
  padding: var(--esp-4);
  border: 1px dashed var(--bordure);
  border-radius: var(--rayon-l);
  color: var(--texte-discret);
  font-size: 0.88rem;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Aide : indices et solution
   -------------------------------------------------------------------------- */

.indice {
  margin-bottom: var(--esp-2);
}

.indice .bouton {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

.indice-cout {
  color: var(--texte-discret);
  font-size: 0.78rem;
  font-weight: 400;
}

.indice-titre {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--esp-1);
}

.indice-contenu,
.solution-contenu {
  padding: var(--esp-3);
  background-color: var(--fond);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon-m);
  color: var(--texte-doux);
  font-size: 0.82rem;
  line-height: 1.6;
  overflow-x: auto;
}

.solution-langage {
  color: var(--texte-discret);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: var(--esp-3) 0 var(--esp-1);
}

.solution-bloquee {
  padding: var(--esp-3) var(--esp-4);
  border: 1px dashed var(--bordure);
  border-radius: var(--rayon-m);
  color: var(--texte-discret);
  font-size: 0.88rem;
  margin: 0;
}

.solution.est-revele .bouton {
  margin-top: var(--esp-3);
  width: 100%;
}

.separateur {
  border-top: 1px dashed var(--bordure);
}

/* --------------------------------------------------------------------------
   Compte et synchronisation
   -------------------------------------------------------------------------- */

.puce-compte,
.puce-connexion {
  gap: var(--esp-2);
  color: var(--texte-doux);
  transition: border-color var(--transition), color var(--transition);
}

.puce-compte:hover,
.puce-connexion:hover {
  color: var(--texte);
  border-color: var(--bordure-claire);
  text-decoration: none;
}

.puce-compte {
  color: var(--texte);
}

.puce-point {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-voile);
  flex-shrink: 0;
}

/* Bandeau sous l'en-tête : visible uniquement quand il y a un problème. */
.bandeau-sync {
  padding: var(--esp-2) var(--esp-5);
  font-size: 0.84rem;
  text-align: center;
  border-top: 1px solid var(--bordure);
}

.bandeau-sync-erreur {
  background-color: rgba(255, 107, 107, 0.1);
  color: #ffb3b3;
}

.bandeau-sync-attention {
  background-color: rgba(242, 193, 78, 0.1);
  color: #f5d68a;
}

.compte-actif {
  display: flex;
  align-items: center;
  gap: var(--esp-3);
  padding: var(--esp-3) var(--esp-4);
  margin-bottom: var(--esp-4);
  background-color: var(--fond-eleve);
  border: 1px solid rgba(46, 230, 168, 0.3);
  border-radius: var(--rayon-m);
}

.compte-pastille {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-voile);
  flex-shrink: 0;
}

.compte-pseudo {
  margin: 0;
  font-size: 0.95rem;
}

.compte-detail {
  margin: 0;
  color: var(--texte-discret);
  font-size: 0.82rem;
}

.sauvegarde-bloc + .sauvegarde-bloc {
  margin-top: var(--esp-4);
}

.sauvegarde-titre {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--texte-discret);
  margin-bottom: var(--esp-2);
}

.alerte-info {
  border-color: rgba(46, 230, 168, 0.35);
  background-color: var(--accent-voile);
  color: var(--texte);
  margin-bottom: var(--esp-4);
}

/* --------------------------------------------------------------------------
   Formulaires
   -------------------------------------------------------------------------- */

.formulaire {
  display: flex;
  flex-direction: column;
  gap: var(--esp-4);
  max-width: 420px;
}

.champ {
  display: flex;
  flex-direction: column;
  gap: var(--esp-2);
}

.champ-libelle {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--texte-doux);
}

.champ-saisie {
  width: 100%;
  padding: var(--esp-3) var(--esp-4);
  background-color: var(--fond);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon-m);
  color: var(--texte);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color var(--transition);
}

.champ-saisie:hover {
  border-color: var(--bordure-claire);
}

.champ-saisie:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-voile);
}

.champ-aide {
  margin: 0;
  color: var(--texte-discret);
  font-size: 0.8rem;
}

/* Le message d'erreur reste dans le flux même vide : sans cela, son apparition
   décalerait le bouton au moment précis où l'utilisateur clique dessus. */
.formulaire-erreur {
  margin: 0;
  min-height: 1.2em;
  color: var(--erreur);
  font-size: 0.86rem;
}

.formulaire-erreur.est-visible {
  padding: var(--esp-2) var(--esp-3);
  background-color: rgba(255, 107, 107, 0.08);
  border: 1px solid rgba(255, 107, 107, 0.35);
  border-radius: var(--rayon-s);
}

.formulaire .bouton {
  align-self: flex-start;
}

.onglets-compte {
  display: flex;
  gap: var(--esp-1);
  border-bottom: 1px solid var(--bordure);
  margin-bottom: var(--esp-5);
}

.panneau + .panneau {
  margin-top: var(--esp-4);
}

.note-confidentialite {
  margin-top: var(--esp-4);
  color: var(--texte-discret);
  font-size: 0.84rem;
}

@media (max-width: 480px) {
  .formulaire .bouton {
    align-self: stretch;
  }
}

/* --------------------------------------------------------------------------
   Secret
   -------------------------------------------------------------------------- */

.secret {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(5, 8, 7, 0.88);
  backdrop-filter: blur(6px);
  animation: secret-entree 0.35s ease;
}

.secret-sortie {
  opacity: 0;
  transition: opacity 0.4s ease;
}

.secret-scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--esp-5);
  padding: var(--esp-6);
  text-align: center;
  /* Donne de la profondeur à la rotation : sans perspective, le cœur
     s'aplatirait au lieu de tourner. */
  perspective: 800px;
}

.secret-coeur {
  width: clamp(120px, 28vw, 200px);
  animation: secret-rotation 3.2s linear infinite;
  transform-style: preserve-3d;
}

.secret-coeur svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.secret-coeur path {
  fill: #ff4d6d;
  stroke: #ff9bb0;
  stroke-width: 1;
  filter: drop-shadow(0 0 18px rgba(255, 77, 109, 0.55));
}

.secret-texte {
  margin: 0;
  font-size: clamp(2rem, 1.2rem + 4vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffe3ea;
  text-shadow: 0 0 24px rgba(255, 77, 109, 0.5);
  animation: secret-pulsation 3.2s ease-in-out infinite;
}

.secret-fermer {
  padding: var(--esp-2) var(--esp-5);
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--rayon-m);
  color: var(--texte-doux);
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}

.secret-fermer:hover {
  color: var(--texte);
  border-color: rgba(255, 255, 255, 0.5);
}

@keyframes secret-entree {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes secret-rotation {
  from {
    transform: rotateY(0deg);
  }
  to {
    transform: rotateY(360deg);
  }
}

@keyframes secret-pulsation {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

/* Le mouvement peut gêner ou rendre malade. On garde la surprise, on retire
   le tournoiement. */
@media (prefers-reduced-motion: reduce) {
  .secret-coeur,
  .secret-texte {
    animation: none;
  }
}
