/* =====================================================================
   connexion.css — la porte de nOS Creare. Structure et matiere.
   Zero couleur en dur : tout vient de jetons-connexion.css (DA Mana).
   Espacements sur l'echelle phi (8·13·21·34·55·89), durees 89·144·233·377 ms,
   mobile-first (min-width seulement), sondes refus-ui passees.
   Le mouvement vit UNIQUEMENT sous prefers-reduced-motion: no-preference —
   pas de guerre de specificite, aucune declaration prioritaire forcee.
   ===================================================================== */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 21px 13px;
  background: var(--void);
  color: var(--texte);
  font-family: var(--police-base);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--selection); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── le voile : la seule matiere du fond, sous tout le reste ── */
.voile {
  position: fixed;
  inset: 0;
  background: var(--voile);
  pointer-events: none;
}

/* ── la porte ── */
.porte {
  position: relative;
  width: 100%;
  max-width: 24rem;
}

/* ── le sceau ── */
.sceau { text-align: center; margin-bottom: 34px; }

.sigle {
  width: 55px;
  height: 55px;
  color: var(--accent);
  display: block;
  margin: 0 auto 13px;
}

.titre {
  margin: 0;
  font-family: var(--police-sceau);
  font-weight: 400;
  font-size: 1.9rem;
  letter-spacing: .13em;
  color: var(--texte-vif);
}
.titre em { font-style: normal; color: var(--accent); }

.devise {
  margin: 8px 0 0;
  font-size: .72rem;
  letter-spacing: .55em;
  text-indent: .55em; /* recentre l'interlettrage du dernier caractere */
  text-transform: uppercase;
  color: var(--texte-eteint);
}

.filet {
  width: 89px;
  height: 1px;
  margin: 21px auto 0;
  background: var(--filet);
}

/* ── la carte ── */
.carte {
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon-grand);
  box-shadow: var(--ombre);
  padding: 21px;
}

.champ { margin-bottom: 21px; }

label {
  display: block;
  margin-bottom: 8px;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--texte-eteint);
}

input {
  width: 100%;
  padding: 13px;
  background: var(--encre-champ);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  color: var(--texte-vif);
  font-family: var(--police-base);
  font-size: 1rem;
  caret-color: var(--accent);
}
input:focus {
  outline: none; /* remplace par l'anneau ci-dessous ; :focus-visible garde le reste */
  border-color: var(--accent);
  box-shadow: var(--anneau-focus);
}
/* l'autofill ne blanchit pas la nuit */
input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 34px var(--surface) inset;
  -webkit-text-fill-color: var(--texte-vif);
  caret-color: var(--accent);
}

button {
  width: 100%;
  margin-top: 8px;
  padding: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: var(--sur-accent);
  border: 0;
  border-radius: var(--rayon);
  font-family: var(--police-base);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
}
button:hover:enabled { box-shadow: var(--halo); }
button:active:enabled { transform: translateY(1px); }
button:disabled { opacity: .72; cursor: progress; }

/* ── le rouet : visible seulement pendant l'ouverture ── */
.rouet {
  display: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid var(--sur-accent);
  border-top-color: transparent;
}
.encours .rouet { display: inline-block; }

/* ── le message : refus lisible, jamais de reproche ── */
.message {
  margin: 13px 0 0;
  padding: 13px;
  border-radius: var(--rayon);
  font-size: .88rem;
  line-height: 1.5;
  text-align: center;
  border: 1px solid transparent;
}
.message:empty { display: none; }
.message.refus   { color: var(--critique);  background: var(--teinte-critique);  border-color: var(--bord-critique); }
.message.blocage { color: var(--attention); background: var(--teinte-attention); border-color: var(--bord-attention); }
.message.succes  { color: var(--succes); }
.message.silence { color: var(--texte-eteint); border-color: var(--bordure); }

/* ── le socle : un signe de vie mesure, jamais un ornement ── */
.socle {
  margin-top: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--police-mono);
  font-size: .74rem;
  color: var(--texte-eteint);
}
.point {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--texte-eteint);
}
.point.enligne    { background: var(--succes); box-shadow: var(--halo-succes); }
.point.silencieux { background: var(--critique); }

/* ── sans JavaScript ── */
.sans-js {
  position: fixed;
  inset: auto 13px 13px;
  margin: 0;
  padding: 13px;
  text-align: center;
  font-size: .85rem;
  color: var(--attention);
  background: var(--teinte-attention);
  border: 1px solid var(--bord-attention);
  border-radius: var(--rayon);
}
.sans-js code { font-family: var(--police-mono); }

/* ── plus d'air des 768px ── */
@media (min-width: 768px) {
  .carte { padding: 34px; }
  .sceau { margin-bottom: 55px; }
}

/* ── le mouvement, seulement si le visiteur n'a rien contre —
      prefers-reduced-motion respecte par construction ── */
@media (prefers-reduced-motion: no-preference) {
  .porte { animation: apparition 233ms ease-out; }
  .rouet { animation: rotation 377ms linear infinite; }
  input  { transition: border-color 144ms, box-shadow 144ms; }
  button { transition: box-shadow 144ms, opacity 144ms, transform 89ms; }
  .point { transition: background 233ms, box-shadow 233ms; }
  @keyframes apparition {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
  }
  @keyframes rotation { to { transform: rotate(360deg); } }
}
