/* ══════════════════════════════════════════════════════════════════
   assoxia — écrans d'authentification
   Reprend les jetons définis dans styles.css (palette, typographie,
   boutons). Ce fichier n'ajoute que la mise en page propre aux
   formulaires de connexion, d'inscription et d'invitation.
   ══════════════════════════════════════════════════════════════════ */

/* ── Coquille en deux panneaux ──────────────────────────────────── */

.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper);
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  min-height: 100vh;
  min-height: 100dvh;
}

/* Panneau de gauche : le discours, sur le vert de marque. */
.auth-intro {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2.5rem;
  padding: clamp(2rem, 4vw, 3.4rem);
  background: var(--green-deep);
  color: var(--green-line);
}

/* Deux halos discrets, écho des formes organiques de l'accueil. */
.auth-intro::before,
.auth-intro::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.auth-intro::before {
  width: 460px; height: 460px;
  right: -200px; top: -150px;
  background: radial-gradient(circle at 40% 40%, rgba(61, 83, 227, .5), transparent 68%);
}
.auth-intro::after {
  width: 320px; height: 320px;
  left: -140px; bottom: -120px;
  background: radial-gradient(circle at 55% 45%, rgba(224, 90, 56, .28), transparent 70%);
}

.auth-intro > * { position: relative; z-index: 1; }

/* La marque elle-même est définie dans styles.css (.brand). Ici on
   n'ajuste que ce qui dépend du contexte : l'espacement sur les cartes
   claires, et l'inversion des couleurs sur le panneau vert. */
.auth-card .brand { margin-bottom: 1.6rem; }

.auth-intro .brand-mark { color: var(--green-line); }
.auth-intro .brand-word { color: #fff; }

.auth-intro h1 {
  font-size: clamp(1.9rem, 3.2vw, 2.7rem);
  color: #fff;
  margin-bottom: 1rem;
}
.auth-intro p {
  color: var(--green-line);
  max-width: 40ch;
  margin: 0;
}
.auth-eyebrow {
  display: block;
  font-family: var(--font-display);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--clay-soft);
  margin-bottom: .9rem;
}

.auth-points {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .7rem;
  font-size: .92rem;
  color: var(--green-line);
}
.auth-points li {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}
.auth-points li::before {
  content: "";
  flex: none;
  margin-top: .45em;
  width: 11px; height: 6px;
  border-left: 2px solid var(--clay-soft);
  border-bottom: 2px solid var(--clay-soft);
  rotate: -45deg;
}

/* ── Panneau de droite : le formulaire ──────────────────────────── */

.auth-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3.4rem) clamp(1rem, 4vw, 3.4rem);
}

/* Variante autonome, pour les écrans courts (connexion). */
.auth-centered {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 5vw, 3rem) 20px;
  position: relative;
  overflow: hidden;
}
.auth-centered::before {
  content: "";
  position: absolute;
  width: 520px; height: 520px;
  right: -220px; top: -190px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, var(--green-soft), transparent 68%);
  pointer-events: none;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.6rem, 3.5vw, 2.4rem);
  box-shadow: var(--shadow-lg);
}
.auth-card-wide { max-width: 520px; }

.auth-step {
  display: inline-block;
  font-family: var(--font-display);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--green);
  background: var(--green-soft);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.auth-card h1,
.auth-card h2 {
  font-size: clamp(1.45rem, 2.6vw, 1.85rem);
  margin-bottom: .5rem;
}

.auth-subtitle {
  color: var(--ink-2);
  font-size: .95rem;
  margin-bottom: 1.8rem;
}

/* Rappel de l'association servie par le sous-domaine. */
.tenant-badge {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  margin-bottom: 1.5rem;
  background: var(--green-soft);
  border-radius: 14px;
}
.tenant-badge strong {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--green-deep);
}
.tenant-badge span {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--green-2);
  overflow-wrap: anywhere;
}

/* ── Champs ─────────────────────────────────────────────────────── */

.auth-field { margin-bottom: 1.1rem; }

.auth-field label {
  display: block;
  font-family: var(--font-display);
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 7px;
}

.auth-field input {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line-2);
  border-radius: 12px;
  padding: 13px 15px;
  transition: border-color .18s, background-color .18s, box-shadow .18s;
}
.auth-field input::placeholder { color: var(--ink-3); }
.auth-field input:hover { border-color: var(--green-line); }
.auth-field input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px var(--green-soft);
}
.auth-field input:disabled,
.auth-field input[readonly] {
  background: var(--surface-2, var(--sand));
  color: var(--ink-3);
  cursor: not-allowed;
}

.auth-field small {
  display: block;
  font-size: .8rem;
  color: var(--ink-3);
  margin-top: 6px;
}

.auth-two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

/* Champ sous-domaine : saisie + suffixe accolés. */
.auth-domain-field { display: flex; align-items: stretch; }
.auth-domain-field input {
  border-radius: 12px 0 0 12px;
  border-right: 0;
  min-width: 0;
}
.auth-domain-field span {
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-family: var(--font-mono);
  font-size: .82rem;
  color: var(--green-2);
  background: var(--green-soft);
  border: 1.5px solid var(--line-2);
  border-left: 0;
  border-radius: 0 12px 12px 0;
  white-space: nowrap;
}
.auth-domain-field input:focus + span { border-color: var(--green-2); }

.auth-submit { margin-top: .6rem; }

/* ── Messages ───────────────────────────────────────────────────── */

.auth-alert {
  font-size: .92rem;
  padding: 13px 16px;
  border-radius: 12px;
  margin-bottom: 1.4rem;
  border: 1px solid transparent;
}
.auth-alert.auth-error {
  background: var(--clay-soft);
  border-color: var(--clay);
  color: #9A3519;
}
.auth-alert.auth-success {
  background: var(--green-soft);
  border-color: var(--green-line);
  color: var(--green-deep);
}

/* ── Pied de carte ──────────────────────────────────────────────── */

.auth-footer {
  margin: 1.4rem 0 0;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font-size: .9rem;
  color: var(--ink-3);
  text-align: center;
}
.auth-footer a { color: var(--green); font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

/* ── Adaptations ────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; min-height: 0; }

  /* Le panneau de discours se réduit à un bandeau : sur mobile, le
     formulaire doit rester la première chose atteignable. */
  .auth-intro {
    gap: 1.4rem;
    padding: 1.6rem 20px 2rem;
  }
  .auth-intro h1 { font-size: 1.55rem; }
  .auth-intro p { font-size: .95rem; }
  .auth-points { display: none; }
  .auth-form-panel { padding: 1.8rem 20px 3rem; }
  .auth-card { max-width: none; }
}

@media (max-width: 480px) {
  .auth-two-cols { grid-template-columns: 1fr; gap: 0; }
  .auth-card {
    border: 0;
    box-shadow: none;
    background: transparent;
    padding-inline: 0;
  }
  .auth-centered { padding-inline: 20px; }
  .auth-centered .auth-card {
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 1.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-field input { transition: none; }
}

/* ── Choix de l'offre ───────────────────────────────────────────── */

/* Trois cartes cliquables plutôt qu'une liste déroulante : le prix et le
   plafond de membres doivent être lisibles au moment du choix, pas après
   l'avoir ouvert. La case radio reste le champ réel — le formulaire
   fonctionne sans JavaScript. */
.auth-offres {
  margin: 0 0 1.6rem;
  padding: 0;
  border: 0;
}
.auth-offres legend {
  padding: 0;
  margin-bottom: .55rem;
  font-family: var(--font-display);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--green-2);
}
.auth-offres-choix {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.auth-offre {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 11px 12px 12px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-2);
  cursor: pointer;
  transition: box-shadow .15s ease, background .15s ease;
}
.auth-offre:hover { box-shadow: inset 0 0 0 1px var(--green-line); }

/* La carte entière porte l'état coché : viser un cercle de 16 px au
   doigt est un mauvais service à rendre. */
.auth-offre:has(input:checked) {
  background: var(--green-soft);
  box-shadow: inset 0 0 0 2px var(--green-2);
}

/* Le point radio n'est pas masqué : il reste focalisable au clavier et
   annoncé par les lecteurs d'écran. Il est simplement sorti du flux
   visuel, la carte disant déjà l'état. */
.auth-offre input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  margin: 0;
}
.auth-offre:has(input:focus-visible) {
  outline: 2px solid var(--green-2);
  outline-offset: 2px;
}
.auth-offre-nom {
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 600;
  color: var(--green-deep);
}
.auth-offre-prix {
  font-size: .86rem;
  font-weight: 500;
  color: var(--ink-2);
}
.auth-offre-detail {
  font-size: .76rem;
  line-height: 1.35;
  color: var(--ink-2);
  opacity: .85;
}
.auth-offres-note {
  margin: .7rem 0 0;
  font-size: .82rem;
  line-height: 1.5;
  color: var(--ink-2);
}

/* Sous 420 px, trois colonnes rendent les libellés illisibles : on
   empile, en gardant le prix sur la même ligne que le nom pour ne pas
   pousser le formulaire trop bas. */
@media (max-width: 420px) {
  .auth-offres-choix { grid-template-columns: 1fr; }
  .auth-offre {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: baseline;
    column-gap: 10px;
  }
  .auth-offre-detail { grid-column: 1 / -1; }
}

/* ── Mot de passe oublié ────────────────────────────────────────── */

.auth-label-ligne {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.auth-oubli {
  font-size: .82rem;
  font-weight: 500;
  color: var(--green-2);
  text-decoration: none;
  margin-bottom: 7px;
}
.auth-oubli:hover { text-decoration: underline; }

.auth-dialogue {
  width: min(440px, calc(100vw - 32px));
  padding: 2rem 2rem 1.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(10, 29, 61, .18);
}
.auth-dialogue::backdrop { background: rgba(10, 29, 61, .4); }
.auth-dialogue h2 { font-size: 1.35rem; margin: 0 0 .4rem; }
.auth-dialogue-fermer-form { position: absolute; top: 12px; right: 14px; }
.auth-dialogue-fermer {
  border: 0;
  background: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--ink-3);
  cursor: pointer;
  padding: 0 4px;
}
.auth-dialogue-fermer:hover { color: var(--ink); }
