/* ==========================================================================
   Stellion — connexion, inscription, mot de passe oublié, écran de chargement
   Mobile d'abord, version ordinateur à partir de 1024 px.
   Référence : captures « Connexion » et « Mot de passe oublié » fournies par Maxime.
   ========================================================================== */

.st-auth {
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  background: var(--bg);
  color: var(--text);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* ---------- En-tête et pied (ordinateur seulement) ---------- */

.st-auth__top {
  display: none;
}

.st-auth__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap-min);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-title);
  color: var(--text);
  text-decoration: none;
}

.st-auth__main {
  flex: 1 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.st-auth__pitch {
  display: none;
}

/* ---------- Carte du formulaire ---------- */

.st-auth__card {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-5) var(--space-5);
  padding-top: calc(var(--space-8) + env(safe-area-inset-top));
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.st-auth__mobile-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
}

.st-auth__name {
  margin: var(--space-3) 0 0;
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-title);
  line-height: var(--leading-tight);
}

.st-auth__tagline {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.st-auth__view {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  text-align: left;
}

.st-auth__view[hidden],
.st-auth__totp[hidden],
.st-auth__install-row[hidden],
.st-auth__install[hidden] {
  display: none;
}

.st-auth__title {
  margin: 0;
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-title);
  line-height: var(--leading-tight);
  color: var(--text);
  text-align: left;
}

.st-auth__sub {
  margin: 0 0 var(--space-1);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--text-muted);
}

.st-auth__form,
.st-auth__totp {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.st-auth__form > .st-btn {
  margin-top: var(--space-1);
}

/* « Oublié ? » : aligné sur le libellé, zone tactile de 44 px sans agrandir la ligne */
.st-auth__forgot {
  margin: -13px 0;
  font-size: var(--text-sm);
}

.st-auth__back {
  align-self: flex-start;
  gap: var(--space-1);
  margin: -10px 0 -6px;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.st-auth__alt {
  margin: var(--space-1) 0 0;
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  text-align: center;
  color: var(--text-muted);
}

.st-auth__note {
  margin: 0;
  font-size: var(--text-xs);
  line-height: var(--leading-relaxed);
  text-align: center;
  color: var(--text-muted);
}

.st-auth__note.st-mono {
  font-size: var(--text-2xs);
}

/* Bandeau « Ajoute Stellion à ton écran d'accueil » */
.st-auth__install-row {
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  line-height: var(--leading-tight);
  color: var(--text-muted);
}

.st-auth__install-row > svg {
  flex-shrink: 0;
  color: var(--icon);
}

.st-auth__install-row > span {
  flex: 1;
  min-width: 0;
}

.st-auth__foot {
  flex-shrink: 0;
  padding: 0 var(--space-5) var(--space-6);
  padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}

.st-auth__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 var(--space-4);
}

.st-auth__legal > a {
  min-height: var(--tap-min);
  display: inline-flex;
  align-items: center;
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-decoration: none;
}

.st-auth__legal > a:hover {
  color: var(--text);
  text-decoration: underline;
}

.st-auth__copy {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--text-muted);
}

/* ---------- Ordinateur ---------- */

@media (min-width: 1024px) {
  .st-auth__top {
    flex-shrink: 0;
    height: var(--header-h-desktop);
    padding: 0 var(--space-8);
    border-bottom: 1px solid var(--hairline);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .st-auth__main {
    max-width: 1080px;
    margin: 0 auto;
    padding: var(--space-10) var(--space-8);
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 72px;
  }

  .st-auth__pitch {
    flex: 1;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    text-align: left;
  }

  .st-auth__kicker {
    margin: 0;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--accent-text);
  }

  .st-auth__headline {
    margin: 0;
    font-size: 40px; /* titre d'accroche : seule taille hors échelle, propre à cette page */
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-title);
    line-height: 1.12;
    color: var(--text);
  }

  .st-auth__headline > span {
    color: var(--text-muted);
  }

  .st-auth__lead {
    margin: 0;
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    color: var(--text-muted);
  }

  .st-auth__points {
    margin: var(--space-2) 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text);
  }

  .st-auth__points > li {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  /* Coche dans une petite tuile verte douce */
  .st-auth__tick {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border-radius: var(--radius-xs);
    background: var(--accent-soft);
    color: var(--accent-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .st-auth__card {
    flex-shrink: 0;
    width: 400px;
    margin: 0;
    padding: var(--space-8);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    background: var(--surface);
  }

  .st-auth__mobile-brand,
  .st-auth__install-row {
    display: none;
  }

  .st-auth__foot {
    padding: var(--space-4) var(--space-8);
    border-top: 1px solid var(--hairline);
    flex-direction: row;
    justify-content: space-between;
  }

  .st-auth__legal {
    justify-content: flex-start;
    gap: 0 var(--space-6);
  }
}

/* ---------- Écran de chargement ---------- */

.st-loading {
  flex-direction: column;
  gap: var(--space-2);
  background: var(--bg);
  color: var(--text-muted);
}

.st-loading__title {
  margin: var(--space-3) 0 0;
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--text);
}

.st-loading__text {
  margin: 0;
  font-size: var(--text-sm);
}

.st-loading__bar {
  width: 180px;
  height: 4px;
  margin-top: var(--space-3);
  border-radius: var(--radius-full);
  background: var(--surface-2);
  overflow: hidden;
  position: relative;
}

.st-loading__bar::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 40%;
  border-radius: inherit;
  background: var(--accent);
  animation: st-loading-slide 1.4s ease-in-out infinite;
}

@keyframes st-loading-slide {
  from { transform: translateX(-100%); }
  to { transform: translateX(250%); }
}
