/* =========================================================
   AFTERGLOW · compléments auth 03 (login.php / register.php)
   À charger APRÈS afterglow-login.css.
   Habille en DA Afterglow les éléments propres à 03 absents de login.html /
   register.html de 05 : modes forgot / reset / otp, register `complete`
   (logo + couverture + CGU), erreurs de champ, œil mot de passe, textarea.
   Tout est scopé sur body.ag-login. Aucune logique : CSS uniquement.
   ========================================================= */

/* ---------- Textes d'intro des modes (forgot / reset / otp) ---------- */
body.ag-login .agl-intro { margin: 0 0 24px; font: 400 15px/1.5 var(--f-body); color: var(--ag-voile); }
body.ag-login .agl-intro strong { color: var(--ag-lait); font-weight: 600; }

/* ---------- Messages ---------- */
body.ag-login .login-glass > .login-error,
body.ag-login .login-form > .login-error { margin: 0; }
body.ag-login .login-glass > .login-error { margin-bottom: 18px; }
body.ag-login .login-error--ok::before { background: var(--ag-valide); }
body.ag-login .login-error--field { margin-top: 0; font-size: 12.5px; }
body.ag-login .form-field-error { display: block; }
body.ag-login .form-field-error:empty { display: none !important; }
body.ag-login .login-required { margin-left: .2em; color: var(--ag-lueur); font-weight: 700; }
body.ag-login .login-input.is-invalid,
body.ag-login .login-textarea.is-invalid {
  border-color: var(--ag-signature);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ag-signature) 22%, transparent);
}
body.ag-login .login-input:disabled { opacity: .6; cursor: not-allowed; }
body.ag-login .login-otp__input.is-invalid + .login-otp__boxes .login-otp__box { border-color: var(--ag-signature); }

/* ---------- Textarea ---------- */
body.ag-login .login-textarea {
  width: 100%; min-height: 96px; padding: 14px 18px; resize: vertical;
  border: 1px solid var(--ag-filet-fort); border-radius: var(--ag-r-m);
  background: var(--ag-creux); color: var(--ag-lait);
  font: 400 16px/1.45 var(--f-body); outline: none;
  transition: border-color var(--ag-t-court), box-shadow var(--ag-t-temps) var(--ag-e);
}
body.ag-login .login-textarea::placeholder { color: var(--ag-cendre); }
body.ag-login .login-textarea:hover { border-color: color-mix(in srgb, var(--ag-lait) 40%, transparent); }
body.ag-login .login-textarea:focus { border-color: var(--ag-lueur); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ag-lueur) 16%, transparent), 0 0 30px -10px var(--ag-lueur); }

/* ---------- Œil mot de passe (ns-password-toggle.js) ---------- */
body.ag-login .ns-pass-wrap { position: relative; display: block; width: 100%; }
body.ag-login .ns-pass-wrap .login-input,
body.ag-login .ns-pass-wrap .ns-pass-input { padding-right: 52px; }
body.ag-login .ns-pass-toggle {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%); z-index: 2;
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; margin: 0; padding: 0;
  border: 0; border-radius: var(--ag-r-pill); background: transparent; box-shadow: none;
  color: var(--ag-voile); cursor: pointer;
  transition: color var(--ag-t-court);
}
body.ag-login .ns-pass-toggle:hover,
body.ag-login .ns-pass-toggle:focus-visible,
body.ag-login .ns-pass-toggle[aria-pressed="true"] { color: var(--ag-lait); }
body.ag-login .ns-pass-toggle svg { display: block; pointer-events: none; }

/* ---------- Boutons / liens ---------- */
body.ag-login .login-submit--link { display: flex; align-items: center; justify-content: center; text-decoration: none; }
body.ag-login .login-signup--plain { justify-content: center; padding: 0; box-shadow: none; }
body.ag-login .agl-otp-links { margin: 18px 0 0; text-align: center; }
body.ag-login .agl-otp-links form { margin: 0; }

/* ---------- Mise en page : formulaire large (register `complete`) ---------- */
.agl-shell--wide { grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr); gap: clamp(32px, 4vw, 64px); }
.agl-shell--wide .agl-panel .login-brand__desc { max-width: 100%; }
@media (max-width: 980px) {
  .agl-shell--wide { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
}
.agl-shell--wide .agl-mock { display: none; }
@media (min-width: 1181px) {
  .agl-shell--wide .agl-mock { display: grid; }
}

/* ---------- Register : bandeau d'aperçu admin, légales ---------- */
.reg-preview-banner {
  margin: 0 0 20px; padding: 12px 16px; border-radius: var(--ag-r-s);
  background: var(--ag-creux); box-shadow: inset 0 0 0 1px var(--ag-filet-fort);
  font: 400 13px/1.45 var(--f-body); color: var(--ag-voile);
}
.reg-legal { margin: 0; text-align: center; font: 400 13px/1.55 var(--f-body); color: var(--ag-voile); }
.reg-legal a.reg-legal__link,
.reg-legal a.reg-legal__link:link,
.reg-legal a.reg-legal__link:visited {
  color: var(--ag-lait); text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--ag-lueur) 70%, transparent); text-underline-offset: 3px;
}
.reg-legal a.reg-legal__link:hover { color: var(--ag-poudre); }

/* ---------- Register `complete` : grille de champs ---------- */
.reg-complete {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "org org" "email phone" "pass pass2" "media media";
  column-gap: 16px; row-gap: 18px; align-items: start;
}
.reg-complete__org { grid-area: org; }
.reg-complete__email { grid-area: email; }
.reg-complete__phone { grid-area: phone; }
.reg-complete__pass { grid-area: pass; }
.reg-complete__pass2 { grid-area: pass2; }
.reg-complete__media { grid-area: media; min-width: 0; }
@media (max-width: 640px) {
  .reg-complete { grid-template-columns: minmax(0, 1fr); grid-template-areas: "org" "email" "phone" "pass" "pass2" "media"; }
}

/* ---------- Register `complete` : logo + couverture ---------- */
.reg-media-title {
  margin: 0 0 6px; font-family: var(--f-display); font-weight: 760; font-variation-settings: "wdth" 118, "wght" 760;
  font-size: 14px; letter-spacing: .03em; text-transform: uppercase; color: var(--ag-lait);
}
.profil-media-lead { margin: 0 0 16px; font: 400 13.5px/1.45 var(--f-body); color: var(--ag-voile); }
.profil-media-stage { position: relative; margin: 0 0 6px; padding-bottom: 44px; }

.reg-upload {
  position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer;
  background: var(--ag-creux); color: var(--ag-voile);
  border: 1px solid var(--ag-filet-fort);
  transition: border-color var(--ag-t-court), background var(--ag-t-court), box-shadow var(--ag-t-court);
}
.reg-upload:hover,
.reg-upload.is-dragover,
.reg-upload:focus-within { border-color: var(--ag-lueur); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ag-lueur) 14%, transparent); }
.reg-upload__preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.reg-upload__preview[hidden],
.reg-upload__icon[hidden],
.reg-upload__hint[hidden],
.profil-media-empty[hidden] { display: none !important; }
.reg-upload__icon { display: flex; align-items: center; justify-content: center; pointer-events: none; }
.reg-upload__hint { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12px; text-align: center; pointer-events: none; }

.profil-media-cover.reg-upload--cover {
  display: block; width: 100%; min-height: 132px; aspect-ratio: 2.55 / 1; margin: 0;
  border-radius: var(--ag-r-m);
}
.profil-media-cover .profil-media-empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 16px; text-align: center; pointer-events: none;
}
.profil-media-empty__icon {
  display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin-bottom: 2px;
  border-radius: 50%; background: var(--ag-fumee, var(--ag-salon)); box-shadow: inset 0 0 0 1px var(--ag-filet-fort);
  color: var(--ag-lait);
}
.profil-media-empty__title { font: 400 10.5px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ag-lait); }
.profil-media-empty__text { font: 400 12.5px/1.35 var(--f-body); color: var(--ag-voile); }

.profil-media-overlay {
  position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--ag-nuit) 62%, transparent);
  opacity: 0; transition: opacity var(--ag-t-court); pointer-events: none;
}
.reg-upload.has-preview:hover .profil-media-overlay,
.reg-upload.has-preview:focus-within .profil-media-overlay { opacity: 1; }
.profil-media-overlay__btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: var(--ag-r-pill);
  background: var(--ag-salon-haut); box-shadow: inset 0 0 0 1px var(--ag-filet-fort);
  color: var(--ag-lait); font: 500 12.5px/1 var(--f-body);
}
.profil-media-overlay__btn--icon { width: 38px; height: 38px; padding: 0; justify-content: center; border-radius: 50%; }

.profil-media-logo-wrap {
  position: absolute; left: 18px; bottom: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 6px; width: 116px;
}
.profil-media-logo.reg-upload--logo {
  width: 104px; height: 104px; margin: 0; border-radius: 50%;
  border: 3px solid var(--ag-nuit);
  box-shadow: 0 0 0 1px var(--ag-filet-fort), 0 12px 28px -8px #000;
}
.profil-media-logo .reg-upload__icon,
.profil-media-logo .profil-media-empty { color: var(--ag-voile); }
.reg-upload--logo .reg-upload__preview { border-radius: 50%; }
.profil-media-logo-caption { text-align: center; font: 400 10px/1.25 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ag-voile); }

@media (max-width: 640px) {
  .profil-media-stage { padding-bottom: 38px; }
  .profil-media-cover.reg-upload--cover { min-height: 112px; aspect-ratio: 2.2 / 1; }
  .profil-media-logo-wrap { left: 12px; width: 92px; }
  .profil-media-logo.reg-upload--logo { width: 84px; height: 84px; }
}
