*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --or:        #c9a84c;
  --or-clair:  #e8c96c;
  --or-sombre: #7a5f1a;
  --rouge:     #8f1a1a;
  --rouge-vif: #cc2222;
  --fond:      #05050a;
  --fond-2:    #0d0d18;
  --fond-3:    #12121f;
  --parchemin: #d4c5a9;
  --gris:      #6a6a7a;
  --bordure:   #2a1f0f;
}

html, body {
  height: 100%;
  background: var(--fond);
  color: var(--parchemin);
  font-family: 'Cinzel', serif;
  overflow: hidden;
}

/* ─── Arrière-plan animé ──────────────────────────────────────── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(139,10,10,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 100%, rgba(26,58,143,0.10) 0%, transparent 55%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9a84c' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* ─── Conteneur principal ────────────────────────────────────── */
.page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  gap: 2rem;
}

/* ─── En-tête ─────────────────────────────────────────────────── */
.entete {
  text-align: center;
  user-select: none;
}

.logo-symbole {
  font-size: 3rem;
  color: var(--or);
  text-shadow: 0 0 20px rgba(201,168,76,0.6), 0 0 40px rgba(201,168,76,0.3);
  animation: pulse-or 3s ease-in-out infinite;
  display: block;
  margin-bottom: 0.5rem;
  letter-spacing: 0.5rem;
}

@keyframes pulse-or {
  0%, 100% { text-shadow: 0 0 20px rgba(201,168,76,0.6), 0 0 40px rgba(201,168,76,0.3); }
  50% { text-shadow: 0 0 30px rgba(201,168,76,0.9), 0 0 60px rgba(201,168,76,0.5); }
}

.titre {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 700;
  color: var(--or);
  letter-spacing: 0.3em;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8), 0 0 30px rgba(201,168,76,0.4);
  line-height: 1;
}

.sous-titre {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.7rem;
  color: var(--gris);
  letter-spacing: 0.4em;
  text-transform: uppercase;
  margin-top: 0.6rem;
}

.separateur {
  width: 200px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--or), transparent);
  margin: 1rem auto;
}

/* ─── Boîte d'authentification ────────────────────────────────── */
.boite-auth {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(160deg, var(--fond-2), var(--fond-3));
  border: 1px solid var(--or-sombre);
  border-top: 2px solid var(--or);
  box-shadow:
    0 0 0 1px rgba(201,168,76,0.08),
    0 20px 60px rgba(0,0,0,0.8),
    inset 0 1px 0 rgba(201,168,76,0.1);
  padding: 2rem;
  position: relative;
}

.boite-auth::before, .boite-auth::after {
  content: '✦';
  position: absolute;
  top: -0.6rem;
  color: var(--or);
  background: var(--fond-2);
  padding: 0 0.4rem;
  font-size: 0.7rem;
}
.boite-auth::before { left: 1rem; }
.boite-auth::after  { right: 1rem; }

/* Onglets */
.onglets {
  display: flex;
  gap: 0;
  margin-bottom: 1.8rem;
  border-bottom: 1px solid var(--or-sombre);
}

.onglet {
  flex: 1;
  background: none;
  border: none;
  padding: 0.7rem;
  color: var(--gris);
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: color 0.2s, border-bottom 0.2s;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  text-transform: uppercase;
}

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

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

/* Champs */
.champ {
  margin-bottom: 1.2rem;
}

.champ label {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gris);
  margin-bottom: 0.4rem;
}

.champ input {
  width: 100%;
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--bordure);
  border-bottom-color: var(--or-sombre);
  color: var(--parchemin);
  font-family: 'Share Tech Mono', monospace;
  font-size: 1rem;
  padding: 0.65rem 0.8rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.champ input:focus {
  border-color: var(--or);
  box-shadow: 0 0 0 1px rgba(201,168,76,0.2), 0 0 12px rgba(201,168,76,0.1);
}

.champ input::placeholder { color: var(--gris); opacity: 0.7; }

/* Bouton */
.btn-principal {
  width: 100%;
  padding: 0.85rem;
  background: linear-gradient(160deg, #2a1a05, #1a1005);
  border: 1px solid var(--or-sombre);
  border-top-color: var(--or);
  color: var(--or);
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 0.5rem;
  position: relative;
  overflow: hidden;
}

.btn-principal::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(201,168,76,0.08), transparent);
  transform: translateX(-100%);
  transition: transform 0.4s;
}

.btn-principal:hover {
  background: linear-gradient(160deg, #3a2a08, #2a1a08);
  color: var(--or-clair);
  box-shadow: 0 0 20px rgba(201,168,76,0.2);
}

.btn-principal:hover::before { transform: translateX(100%); }
.btn-principal:active { transform: translateY(1px); }

/* Messages */
.message {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  padding: 0.6rem 0.8rem;
  margin-top: 1rem;
  border-left: 2px solid;
  display: none;
}

.message.erreur {
  color: #ff6666;
  border-color: var(--rouge-vif);
  background: rgba(143,26,26,0.15);
}

.message.succes {
  color: #88cc88;
  border-color: #2a6a2a;
  background: rgba(26,100,26,0.15);
}

/* ─── Pied de page ─────────────────────────────────────────────── */
.pied {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.6rem;
  color: #3a3a4a;
  letter-spacing: 0.15em;
  text-align: center;
}

/* ─── Chargement ───────────────────────────────────────────────── */
.chargement {
  position: fixed; inset: 0;
  background: var(--fond);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: opacity 0.5s;
}

.chargement.cache { opacity: 0; pointer-events: none; }

.spinner-or {
  width: 40px; height: 40px;
  border: 2px solid var(--bordure);
  border-top-color: var(--or);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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