/* ============================================================================
   Reperan - pages d'accueil (/login, /mot-de-passe-oublie, /inscription,
   /informations-legales) - lot 108, refonte lot 114.

   Charge par views/layouts/auth.ejs APRES charte.css et site.css. Ce fichier
   n'invente rien : il pose la page, la marque de l'abonne, la carte et le
   pied, et reutilise la grammaire de la charte deja en service (.pf-site,
   .pf-field, .pf-btn de site.css ; jetons --pf-* ; rouge d'alerte #d70015 /
   rgba(255,59,48,...) deja employe par charte.css et site.css). Aucune regle
   globale : tout est sous .au-body ou prefixe .au-, donc sans effet sur les
   autres ecrans.

   Lot 115 - defilement retabli sur ecran bas, fond anime (couleurs de la
   charte qui derivent), carte plus large et plus ombree, identifiants de demo
   repliables.

   Lot 114 - la composition des grands outils : fond clair a deux halos
   (accent et violet de la charte), marque centree AU-DESSUS de la carte,
   carte seule au centre, titre et accroche centres, « Mot de passe oublie ? »
   sur la ligne du libelle, bouton pleine largeur, pied discret avec les
   informations legales.
   ============================================================================ */

.au-body { min-height: 100vh; min-height: 100dvh; margin: 0; }

/* Lot 115 - LE DEFILEMENT. site.css gele html et body des qu'une page porte
   .pf-site, au-dessus de 900 px de large (fait pour la vue projet, qui tient
   dans la fenetre). Les pages d'accueil portent aussi .pf-site (pour les
   jetons) : sur un ecran bas, le pied et la fin de /informations-legales
   etaient coupes, sans defilement possible. Ces deux regles ont le meme poids
   que celle de site.css (0,2,1) et sont chargees apres : elles l'emportent, et
   seulement la ou il y a .au-page, c'est-a-dire sur les 4 pages d'accueil.
   Le defilement horizontal reste interdit. */
html:has(.au-page.pf-site) { overflow-x: hidden; overflow-y: auto; }
body:has(.au-page.pf-site) { overflow: visible; height: auto; min-height: 100%; }

/* ---------- la page : fond et colonne centrale ---------- */
.au-page {
  position: relative; isolation: isolate;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center;
  padding: 40px 16px 20px;
  box-sizing: border-box;
  background: var(--pf-surface-2);
}

/* Lot 115 - LE FOND ANIME (facon Stripe), en CSS seul : deux calques fixes,
   sous le contenu (isolation ci-dessus), faits de grandes taches de couleur de
   la charte (--pf-accent, --pf-accent-2, --pf-purple) qui s'estompent vers le
   transparent et derivent lentement. Seule la transformation est animee : le
   navigateur la confie a la carte graphique, sans repeindre la page. Un calque
   fixe ne cree pas de defilement. Mouvements reduits : fond immobile. */
.au-page::before,
.au-page::after {
  content: ""; position: fixed; z-index: -1; pointer-events: none;
  width: 120vmax; height: 120vmax;
  will-change: transform;
}
.au-page::before {
  top: -62vmax; left: -46vmax;
  background:
    radial-gradient(closest-side at 42% 58%, var(--pf-accent), transparent 72%),
    radial-gradient(closest-side at 70% 30%, var(--pf-purple), transparent 68%);
  opacity: .30;
  animation: au-derive-a 26s var(--pf-ease) infinite alternate;
}
.au-page::after {
  bottom: -70vmax; right: -52vmax;
  background:
    radial-gradient(closest-side at 38% 40%, var(--pf-accent-2), transparent 70%),
    radial-gradient(closest-side at 64% 66%, var(--pf-purple), transparent 66%);
  opacity: .26;
  animation: au-derive-b 32s var(--pf-ease) infinite alternate;
}
@keyframes au-derive-a {
  0% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  50% { transform: translate3d(14vmax, 10vmax, 0) rotate(35deg) scale(1.08); }
  100% { transform: translate3d(4vmax, 20vmax, 0) rotate(70deg) scale(.96); }
}
@keyframes au-derive-b {
  0% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  50% { transform: translate3d(-12vmax, -8vmax, 0) rotate(-30deg) scale(1.1); }
  100% { transform: translate3d(-22vmax, -2vmax, 0) rotate(-60deg) scale(.94); }
}
.au-centre {
  flex: 1 0 auto;
  width: 100%; max-width: 440px;
  display: flex; flex-direction: column; justify-content: center;
  gap: 24px;
}
.au-centre--large { max-width: 560px; }

/* ---------- la marque de l'abonne (partials/auth-marque.ejs) ---------- */
.au-marque {
  display: flex; align-items: center; justify-content: center;
  min-height: 56px;
  animation: pf-fadeUp .45s var(--pf-ease) backwards;
}
.au-marque__logo { display: block; width: auto; height: auto; max-width: 220px; max-height: 56px; object-fit: contain; }
.au-marque__texte { display: flex; align-items: center; gap: 10px; min-width: 0; }
.au-marque__mono {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--pf-r-sm);
  color: #fff;
  background: linear-gradient(180deg, var(--pf-accent-2), var(--pf-accent));
  box-shadow: var(--pf-sh-acc);
  font-size: 15px; font-weight: 700; letter-spacing: -0.01em; line-height: 1;
}
.au-marque__nom {
  font-size: 16px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2;
  color: var(--pf-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- la carte ---------- */
.au-card {
  width: 100%;
  background: var(--pf-surface);
  border: 0.5px solid var(--pf-border);
  border-radius: var(--pf-r-lg);
  box-shadow: var(--pf-sh-md), var(--pf-sh-lg);
  padding: 36px 40px 28px;
  animation: pf-popIn .45s var(--pf-ease) backwards;
}

.au-titre { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; color: var(--pf-text); margin: 0 0 6px; text-align: center; }
.au-intro { font-size: 13.5px; color: var(--pf-text-2); margin: 0 0 22px; line-height: 1.45; text-align: center; }

/* ---------- le formulaire ---------- */
.au-form { display: flex; flex-direction: column; gap: 16px; }
.au-form .pf-field__label { margin: 0; }
.au-form .pf-field__control { background: var(--pf-surface-2); border-color: var(--pf-border); transition: border-color .2s, box-shadow .2s, background .2s; }
.au-form .pf-field__control:hover { border-color: var(--pf-border-2); }
.au-form .pf-field__control:focus { background: var(--pf-surface); border-color: var(--pf-accent); }
.au-form .pf-field__control[readonly] { color: var(--pf-text-2); cursor: default; }
.au-form .pf-field__control[readonly]:focus { border-color: var(--pf-border); box-shadow: none; background: var(--pf-surface-2); }
.au-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .au-duo { grid-template-columns: 1fr; } }

/* le libelle et son lien sur la meme ligne (« Mot de passe oublie ? ») */
.au-label-ligne { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

/* un champ refuse : bordure et halo rouges, message sous le champ */
.au-field--ko .pf-field__control,
.au-field--ko .pf-field__control:focus { border-color: rgba(255,59,48,.55); box-shadow: 0 0 0 3.5px rgba(255,59,48,.14); }
.au-msg { font-size: 12px; font-weight: 500; color: #d70015; line-height: 1.35; }
.au-aide { font-size: 12px; font-weight: 500; color: var(--pf-text-3); line-height: 1.35; }
.au-maj { display: flex; align-items: center; gap: 6px; color: var(--pf-text-2); }
.au-maj svg { width: 14px; height: 14px; flex: none; }

/* mot de passe + bouton afficher/masquer */
.au-pass { position: relative; }
.au-pass .pf-field__control { padding-right: 44px; }
.au-oeil {
  position: absolute; top: 50%; right: 5px; transform: translateY(-50%);
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 0; background: none; color: var(--pf-text-3);
  border-radius: var(--pf-r-sm); cursor: pointer;
  transition: background .2s, color .2s, transform .14s var(--pf-spring);
}
.au-oeil svg { width: 18px; height: 18px; }
.au-oeil:hover { background: var(--pf-surface-hover); color: var(--pf-text); }
.au-oeil:active { transform: translateY(-50%) scale(.92); }
.au-oeil:focus-visible { outline: none; box-shadow: 0 0 0 3.5px var(--pf-accent-ring); }

.au-ligne { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.au-ligne .form-check { margin: 0; font-size: 13px; color: var(--pf-text-2); }
.au-ligne .form-check-input:focus { box-shadow: 0 0 0 3.5px var(--pf-accent-ring); }

/* l'alerte du formulaire */
.au-alerte {
  display: flex; align-items: flex-start; gap: 10px;
  background: rgba(255,59,48,.12);
  border: 0.5px solid rgba(255,59,48,.35);
  border-radius: var(--pf-r-sm);
  padding: 11px 13px;
  font-size: 13px; font-weight: 500; color: #d70015; line-height: 1.45;
  animation: pf-fadeUp .3s var(--pf-ease) backwards;
}
.au-alerte svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }

/* la bonne nouvelle (mot de passe modifie) */
.au-note {
  display: flex; align-items: flex-start; gap: 10px;
  border-radius: var(--pf-r-sm);
  padding: 11px 13px; margin: 0 0 16px;
  font-size: 13px; font-weight: 500; line-height: 1.45;
  animation: pf-fadeUp .3s var(--pf-ease) backwards;
}
.au-note svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.au-note--ok { background: var(--pf-green-soft); color: var(--pf-green-deep); }
.au-note--info { background: var(--pf-accent-soft); color: var(--pf-accent-press); }   /* lot 118 : session fermee */

/* le bouton principal : .pf-btn--primary de site.css, en pleine largeur */
.au-submit { width: 100%; justify-content: center; padding: 12px 16px; font-size: 14px; }
.au-submit:hover { transform: translateY(-3px); }
.au-submit:active { transform: scale(.98); }
.au-submit[disabled] { opacity: .75; cursor: default; transform: none; }
.au-spin {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.45); border-top-color: #fff;
  animation: au-tourne .7s linear infinite;
}
@keyframes au-tourne { to { transform: rotate(360deg); } }

.au-lien { font-size: 13px; font-weight: 600; color: var(--pf-accent); text-decoration: none; border-radius: 6px; transition: color .2s; }
.au-lien:hover { color: var(--pf-accent-press); }
.au-lien:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--pf-accent-ring); }
.au-lien--petit { font-size: 12.5px; white-space: nowrap; }
.au-retour { display: inline-flex; align-items: center; gap: 6px; }
.au-retour svg { width: 15px; height: 15px; transition: transform .2s var(--pf-spring); }
.au-retour:hover svg { transform: translateX(-3px); }

/* sous le formulaire, separe par un filet */
.au-bas {
  margin: 22px 0 0; padding-top: 16px;
  border-top: 0.5px solid var(--pf-border);
  text-align: center; font-size: 12.5px; color: var(--pf-text-3); line-height: 1.45;
}

/* etats (inscription, lien envoye) */
.au-etat { text-align: center; padding: 8px 0 4px; animation: pf-fadeUp .35s var(--pf-ease) backwards; }
.au-etat .au-submit + .au-submit { margin-top: 10px; }
.au-etat__ic { width: 48px; height: 48px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: var(--pf-r-pill); }
.au-etat__ic svg { width: 24px; height: 24px; }
.au-etat__ic--ok { background: var(--pf-green-soft); color: var(--pf-green-deep); }
.au-etat__ic--ko { background: rgba(255,59,48,.12); color: #d70015; }
.au-etat__t { font-size: 15px; font-weight: 700; color: var(--pf-text); margin: 0 0 6px; }
.au-etat__p { font-size: 13px; color: var(--pf-text-2); margin: 0 0 18px; line-height: 1.5; }
.au-etat__email { color: var(--pf-text); font-weight: 600; overflow-wrap: anywhere; }
.au-charge { display: grid; place-items: center; padding: 26px 0; }
.au-charge .au-spin { width: 22px; height: 22px; border-color: var(--pf-accent-soft); border-top-color: var(--pf-accent); }

/* informations legales */
.au-doc__section { padding-top: 18px; margin-top: 18px; border-top: 0.5px solid var(--pf-border); scroll-margin-top: 24px; }
.au-doc__section:first-of-type { margin-top: 0; }
.au-doc__titre { font-size: 15px; font-weight: 700; color: var(--pf-text); margin: 0 0 8px; }
.au-doc__p { font-size: 13.5px; color: var(--pf-text-2); line-height: 1.55; margin: 0 0 8px; }
/* K-1303 : la politique de confidentialite (articles, liste, tableau des sous-traitants, version) */
.au-doc__meta { font-size: 12px; color: var(--pf-text-3); margin: 0 0 14px; }
.au-doc__h4 { font-size: 13.5px; font-weight: 700; color: var(--pf-text); margin: 16px 0 6px; }
.au-doc__ul { font-size: 13.5px; color: var(--pf-text-2); line-height: 1.55; margin: 0 0 8px; padding-left: 20px; }
.au-doc__ul li { margin: 0 0 4px; }
.au-doc__table { width: 100%; border-collapse: collapse; font-size: 12.5px; color: var(--pf-text-2); line-height: 1.4; margin: 4px 0 10px; }
.au-doc__table th, .au-doc__table td { text-align: left; vertical-align: top; padding: 6px 8px; border-bottom: 0.5px solid var(--pf-border); }
.au-doc__table th { font-weight: 700; color: var(--pf-text); }
.au-doc__section strong { color: var(--pf-text); font-weight: 600; }
/* K-1305 : pense-bete rouge en tete d'un document (a retirer quand il ne sert plus) */
.au-doc__alerte { display: inline-block; margin: 0 0 10px; padding: 4px 10px; border-radius: 8px; background: rgba(255, 59, 48, .10); color: #c4160a; font-size: 12.5px; font-weight: 700; letter-spacing: .02em; }

/* identifiants de demo (local uniquement) - lot 115 : repliables (<details>) */
.au-hint { margin: 18px 0 0; padding: 8px 12px; border-radius: var(--pf-r-sm); background: var(--pf-surface-2); font-size: 11.5px; color: var(--pf-text-3); line-height: 1.6; text-align: left; }
.au-hint code { font-size: 11.5px; color: var(--pf-text-2); }
.au-hint__titre { cursor: pointer; font-weight: 600; color: var(--pf-text-3); border-radius: 6px; transition: color .2s; }
.au-hint__titre:hover { color: var(--pf-text-2); }
.au-hint__titre:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--pf-accent-ring); }
.au-hint__corps { margin: 6px 0 2px; }

/* le pied (partials/auth-pied.ejs) */
.au-pied { width: 100%; max-width: 560px; margin-top: 28px; text-align: center; font-size: 11.5px; font-weight: 500; color: var(--pf-text-2); }
.au-pied__liens { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; }
.au-pied__liens a { color: var(--pf-text-2); text-decoration: none; border-radius: 6px; transition: color .2s; }
.au-pied__liens a:hover { color: var(--pf-text); }
.au-pied__liens a:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--pf-accent-ring); }

.au-body [hidden] { display: none !important; }

@media (max-width: 480px) {
  .au-page { padding-top: 28px; }
  .au-centre { gap: 20px; }
  .au-card { padding: 26px 20px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .au-card, .au-alerte, .au-note, .au-etat, .au-marque, .au-form .pf-field { animation: none !important; }
  .au-page::before, .au-page::after { animation: none !important; }
  .au-oeil, .au-submit, .au-retour svg { transition: none !important; }
  .au-submit:hover, .au-retour:hover svg { transform: none; }
  .au-spin { animation-duration: 1.6s; }
}

/* H-936 : le choix « 2 appareils au plus » (login.ejs) — les jetons de la page */
.au-appareils{display:flex;flex-direction:column;gap:8px;margin:4px 0 12px;padding:12px;border-radius:var(--pf-r-sm);background:var(--pf-surface-2)}
.au-appareils[hidden]{display:none}
.au-app-t{margin:0 0 2px;font-size:13.5px;font-weight:600;color:var(--pf-text)}.au-app-s{margin:2px 0 0;font-size:12px;color:var(--pf-text-2)}
.au-app{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 10px;border-radius:var(--pf-r-sm);background:#fff;border:1px solid var(--pf-border)}
.au-app b{display:block;font-size:13.5px;color:var(--pf-text)}.au-app small{display:block;font-size:11.5px;color:var(--pf-text-2)}.au-app-att{color:#d70015;font-weight:600}
.au-app .pf-btn{white-space:nowrap}
