/* FactuPay — connexion et inscription
   Mesures et couleurs relevées sur la page de connexion PayPal (ancien système
   « Elemental UI ») : champ 64 px, libellé flottant, boutons 48 px en pastille. */

:root {
  --a-text: #001435;
  --a-label: #6c7378;
  --a-help: #545d68;
  --a-field: #999999;
  --a-field-hover: #002991;
  --a-focus: #097ff5;
  --a-error: #d9360b;
  --a-link: #0066f5;
  --a-card-border: #eaeced;
  --a-primary: #002991;
  --a-primary-hover: #1a3b8e;
  --a-primary-active: #003087;
}

body.auth { background: #fff; color: var(--a-text); font-size: 16px; line-height: 1.5; letter-spacing: normal; min-height: 100vh; display: flex; flex-direction: column; }
.auth main { flex: 1; }

.auth-card {
  position: relative; width: 100%; max-width: 460px; margin: 120px auto 0;
  padding: 30px 10% 50px; padding: 30px clamp(1.5rem, 8%, 2.9rem) 50px;
  border: 1px solid var(--a-card-border); border-radius: 12px; background: #fff; overflow: hidden;
}
.auth-card.wide { max-width: 560px; }
.auth-logo { display: flex; justify-content: center; margin: 6px 0 30px; }
.auth-logo .logo svg { width: 36px; height: 36px; }
.auth-logo .logo-word { font-size: 1.45rem; }
.auth-title { margin: 0 0 6px; text-align: center; font-family: var(--font-headline); font-weight: 900; font-size: 1.75rem; letter-spacing: -.03em; line-height: 1.15; color: #000; }
.auth-lead { text-align: center; color: var(--a-label); margin: 0 0 24px; font-size: .9375rem; }

/* Étapes : la suivante entre par la droite en .25 s */
.step { display: none; }
.step.on { display: block; animation: step-in .25s ease both; }
.step.back { animation-name: step-back; }
@keyframes step-in { from { opacity: 0; transform: translateX(32px); } to { opacity: 1; transform: none; } }
@keyframes step-back { from { opacity: 0; transform: translateX(-32px); } to { opacity: 1; transform: none; } }

/* Champ à libellé flottant */
.field { position: relative; margin-bottom: 16px; }
.field-box {
  position: relative; border: 1px solid var(--a-field); border-radius: 4px; background: #fff;
  transition: border-color .2s ease-in-out, background-color .2s ease-in-out, box-shadow .2s ease-in-out;
}
.field-box:hover { border-color: var(--a-field-hover); }
.field-box:focus-within { border-color: transparent; outline: 2px solid var(--a-focus); outline-offset: 2px; box-shadow: 0 0 0 2px #fff; }
.field-box input, .field-box select {
  display: block; width: 100%; min-height: 64px; padding: 20px 12px 8px; margin: 0;
  border: 0; border-radius: 6px; background: transparent; outline: none;
  font-family: var(--font-text); font-size: 16px; line-height: 24px; letter-spacing: -.02em; color: #000;
  -webkit-appearance: none; appearance: none;
}
.field-box select { padding-right: 44px; cursor: pointer; }
.field .chev-sel { position: absolute; right: 14px; top: 50%; width: 14px; height: 14px; transform: translateY(-50%); pointer-events: none; color: var(--a-label); }
.field-box label {
  position: absolute; left: 12px; top: 18px; height: 30px; display: flex; align-items: center;
  font-size: 16px; color: var(--a-label); pointer-events: none; white-space: nowrap;
  transition: .2s ease all;
}
.field-box input:focus ~ label,
.field-box input:not(:placeholder-shown) ~ label,
.field-box select:focus ~ label,
.field-box select.filled ~ label { top: 4px; font-size: 14px; }
.field-box input::placeholder { color: transparent; }
.field .eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  height: 36px; padding: 0 10px; border: 0; border-radius: 999px; background: none; cursor: pointer;
  font-weight: 600; font-size: 14px; color: var(--a-link);
}
.field .eye:hover { background: var(--tint-04); }
.field.has-eye .field-box input { padding-right: 96px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }

/* Erreur : bordure orange-rouge + message qui se déplie */
.field.error .field-box { border-color: var(--a-error); }
.field.error .field-box:focus-within { border-color: transparent; }
.err {
  display: flex; gap: 6px; align-items: flex-start; max-height: 0; overflow: hidden; opacity: 0;
  color: var(--a-help); font-size: 14px; line-height: 20px;
  transition: max-height .3s ease-in, opacity .3s ease-in, margin .3s ease-in;
}
.err svg { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--a-error); }
.field.error .err { max-height: 80px; opacity: 1; margin-top: 6px; transition: max-height .3s var(--ease-open), opacity .3s var(--ease-open), margin .3s var(--ease-open); }

/* Liens et boutons */
.a-link { color: var(--a-link); font-weight: 600; text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; font-size: 16px; }
.a-link:hover { text-decoration: underline; }
.a-btn {
  width: 100%; min-width: 6rem; height: 48px; padding: 12px 32px; margin-top: 24px;
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  border: 2px solid var(--a-primary); border-radius: 100px; background: var(--a-primary); color: #fff;
  font-family: var(--font-text); font-weight: 600; font-size: 16px; line-height: 21px; cursor: pointer; text-decoration: none;
  transition: color .2s, background-color .2s, border-color .2s, box-shadow .2s;
  position: relative;
}
.a-btn:hover { background: var(--a-primary-hover); border-color: var(--a-primary-hover); }
.a-btn:active { background: var(--a-primary-active); border-color: var(--a-primary-active); }
.a-btn:focus-visible { outline: 2px solid var(--a-focus); outline-offset: 2px; box-shadow: 0 0 0 2px #fff; }
.a-btn.ghost { background: transparent; color: #000; border-color: #000; }
.a-btn.ghost:hover { color: var(--a-primary-hover); border-color: var(--a-primary-hover); background: transparent; }
.a-btn.ghost:active { color: var(--a-primary-active); border-color: var(--a-primary-active); }
.a-btn.loading { color: transparent; pointer-events: none; }
.a-btn.loading::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%;
  transform: translate(-50%, -50%); animation: btn-spin 1s linear infinite;
}
@keyframes btn-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

.sep { position: relative; margin: 24px 0; text-align: center; font-size: 15px; color: var(--a-label); }
.sep::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid #cbd2d6; }
.sep span { position: relative; padding: 0 7.5px; background: #fff; }

.who-chip { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px 0 0; margin: -6px 0 20px; }
.who-chip span { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 4px; font-size: 14px; color: var(--a-help); line-height: 20px; cursor: pointer; }
.check input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--a-primary); cursor: pointer; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 4px; }

/* Langues et pied de page */
.locale { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 4px 0; margin-top: 30px; font-size: 12px; line-height: 16px; }
.locale svg { width: 18px; height: 18px; margin-right: 6px; color: var(--a-label); }
.locale button { background: none; border: 0; padding: 0 8px; cursor: pointer; font-size: 12px; color: var(--a-text); }
.locale button + button { border-left: 1px solid #cbd2d6; }
.locale button[aria-current="true"] { font-weight: 700; }
.auth-footer { margin-top: 40px; padding: 14px 16px 24px; background: #f5f7fa; font-size: 11px; line-height: 18px; text-align: center; }
.auth-footer a { color: var(--a-text); text-decoration: none; margin: 0 6px; }
.auth-footer a:hover { text-decoration: underline; }

/* Écran de chargement plein écran (anneau 1 s linéaire) */
.mask { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(255, 255, 255, .9); opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s; }
.mask.on { opacity: 1; visibility: visible; }
.ring { width: 6rem; height: 6rem; border-radius: 50%; border: 2px solid rgba(0, 41, 145, .15); border-top-color: var(--a-primary-active); animation: rotation 1s linear infinite; }
.mask p { margin-top: 1rem; text-align: center; color: var(--a-label); }
@keyframes rotation { from { transform: rotate(0deg); } to { transform: rotate(359deg); } }

/* Toast : descend du haut */
.toast {
  position: fixed; left: 50%; top: 24px; z-index: 95; max-width: min(92vw, 30rem);
  display: flex; gap: 10px; align-items: flex-start; padding: 14px 18px; border-radius: 12px;
  background: #000; color: #fff; font-size: 14px; line-height: 20px; box-shadow: 0 12px 32px rgba(0, 0, 0, .2);
  transform: translate(-50%, -2rem); opacity: 0; visibility: hidden;
}
.toast.show { animation: toast-in .3s var(--ease-toast) forwards; }
.toast.hide { animation: toast-out .3s var(--ease-toast) forwards; }
@keyframes toast-in { from { transform: translate(-50%, -2rem); opacity: 0; visibility: visible; } to { transform: translate(-50%, 0); opacity: 1; visibility: visible; } }
@keyframes toast-out { from { transform: translate(-50%, 0); opacity: 1; visibility: visible; } to { transform: translate(-50%, -2rem); opacity: 0; visibility: hidden; } }

/* Succès d'inscription */
.done { text-align: center; }
.done .tick { width: 72px; height: 72px; margin: 8px auto 18px; border-radius: 50%; background: #e3e9f7; color: #0b276b; display: grid; place-items: center; animation: pop .5s var(--ease-bounce) both; }
.done .tick svg { width: 34px; height: 34px; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }

/* Téléphone : la carte occupe tout l'écran, sans bordure */
@media (max-width: 767px) {
  .auth-card, .auth-card.wide { margin: 0 auto; border: 0; border-radius: 0; padding: 24px 8% 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .step.on, .done .tick, .toast.show, .toast.hide { animation-duration: .01ms; }
  .ring, .a-btn.loading::after { animation-duration: 2s; }
}

/* =====================================================================
   Deux volets (2026-11-11) : visuel humain plein cadre + formulaire.
   Palette bleue : bleu nuit #002991, bleu #0066f5 / #60cdff, brume #f2f8ff.
   ===================================================================== */
:root {
  --a-primary: #0066f5; --a-primary-hover: #0052c4; --a-primary-active: #0047ac;
  --a-focus: #0066f5; --a-ink: #001435; --a-line: #cfd2d8;
}
body.auth { background: #fff; min-height: 100vh; min-height: 100dvh; }
.auth-shell { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }

/* Volet visuel */
.auth-visual { position: sticky; top: 0; height: 100vh; height: 100dvh; padding: 14px 0 14px 14px; }
.av-frame { position: relative; height: 100%; border-radius: 28px; overflow: hidden; background: #002991; isolation: isolate; }
.av-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 32%; transform-origin: 50% 38%; animation: av-zoom 26s ease-in-out infinite alternate; }
@keyframes av-zoom { from { transform: scale(1.02); } to { transform: scale(1.13) translate3d(-1.2%, -1%, 0); } }
.av-frame::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(3, 10, 23, .5) 0%, rgba(3, 10, 23, 0) 20%, rgba(3, 10, 23, 0) 46%, rgba(3, 10, 23, .86) 100%); }
.av-top { position: absolute; z-index: 3; left: 28px; right: 28px; top: 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.av-top .logo { color: #fff; }
.av-top .logo svg { width: 38px; height: 38px; }
.av-top .logo-word { font-size: 1.4rem; }
.av-back { color: #fff; font-weight: 700; font-size: 14px; text-decoration: none; padding: 9px 16px; border-radius: 999px;
  background: rgba(255, 255, 255, .16); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); transition: background-color .3s; }
.av-back:hover { background: rgba(255, 255, 255, .28); }

.av-notifs { position: absolute; z-index: 3; right: 28px; top: 92px; width: min(340px, 72%); display: grid; gap: 10px; }
.av-notif { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 12px; border-radius: 20px; color: var(--a-ink);
  opacity: 0; transform: translateY(-12px) scale(.96); animation: av-notif 12s cubic-bezier(.22, 1, .36, 1) infinite; }
.av-notif:nth-child(2) { animation-delay: 3.2s; }
.av-notif .ic { flex: none; width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; background: #0066f5; color: #fff; position: relative; z-index: 1; }
.av-notif .ic svg { width: 20px; height: 20px; }
.av-notif > span:last-child { position: relative; z-index: 1; min-width: 0; }
.av-notif b { display: block; font-size: 15px; line-height: 1.25; letter-spacing: -.01em; }
.av-notif small { display: block; font-size: 13px; line-height: 1.35; color: rgba(3, 10, 23, .68); }
@keyframes av-notif {
  0% { opacity: 0; transform: translateY(-12px) scale(.96); }
  6%, 68% { opacity: 1; transform: none; }
  76%, 100% { opacity: 0; transform: translateY(-6px) scale(.98); }
}

.av-bottom { position: absolute; z-index: 3; left: 32px; right: 32px; bottom: 30px; color: #fff; }
.av-title { margin: 0 0 20px; max-width: 12ch; font-family: var(--font-headline); font-weight: 900; font-size: clamp(2.2rem, 3.6vw, 3.6rem); letter-spacing: -.045em; line-height: .98; }
.av-people { display: flex; align-items: center; gap: 14px; }
.av-faces { display: flex; flex: none; }
.av-faces img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 2.5px solid #002991; margin-left: -13px; background: #002991; }
.av-faces img:first-child { margin-left: 0; }
.av-people p { margin: 0; max-width: 32ch; font-size: 14px; line-height: 1.45; color: rgba(255, 255, 255, .86); }

/* Volet formulaire */
.auth-panel { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; padding: 26px clamp(20px, 5vw, 72px) 18px; background: #fff; }
.ap-top { display: flex; align-items: center; justify-content: flex-end; gap: 12px; font-size: 15px; color: var(--a-label); }
.ap-top a { color: var(--a-ink); font-weight: 700; text-decoration: none; margin-left: 6px; padding: 9px 16px; border-radius: 999px; background: #f2f8ff; transition: background-color .3s; }
.ap-top a:hover { background: #dce6f7; }
.auth-panel .auth-card { width: 100%; max-width: 420px; margin: auto; padding: 36px 6px; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.auth-panel .auth-card.wide { max-width: 520px; }
.auth-panel .auth-logo { display: none; }
.auth-panel .auth-title { text-align: left; font-size: clamp(2rem, 2.8vw, 2.6rem); letter-spacing: -.045em; line-height: 1.02; color: var(--a-ink); margin-bottom: 10px; }
.auth-panel .auth-lead { text-align: left; font-size: 1rem; margin-bottom: 30px; }
.auth-panel .locale { justify-content: flex-start; }
.auth-panel .auth-footer { margin-top: 0; padding: 0; background: none; text-align: left; color: var(--a-label); }
.auth-panel .auth-footer a { margin: 0 6px 0 0; color: var(--a-label); }

/* Champs et boutons, version bleue */
.auth-shell .field-box { border-color: var(--a-line); border-radius: 14px; }
.auth-shell .field-box:hover { border-color: #002991; }
.auth-shell .field-box:focus-within { border-color: transparent; outline: 2px solid var(--a-focus); outline-offset: 1px; box-shadow: 0 0 0 5px rgba(34, 91, 197, .16); }
.auth-shell .field-box input, .auth-shell .field-box select { border-radius: 14px; }
.auth-shell .a-btn { height: 52px; color: #fff; font-weight: 700; box-shadow: 0 10px 24px -8px rgba(34, 91, 197, .55); }
.auth-shell .a-btn.ghost { color: var(--a-ink); border-color: var(--a-line); background: #fff; box-shadow: none; }
.auth-shell .a-btn.ghost:hover { border-color: #002991; color: var(--a-ink); background: #f2f8ff; }
.auth-shell .a-btn.loading::after { border-color: rgba(255, 255, 255, .3); border-top-color: #fff; }
.auth-shell .sep::before { border-top-color: #e3e6eb; }

/* Téléphone et tablette : le visuel passe au-dessus */
@media (max-width: 899px) {
  .auth-shell { grid-template-columns: minmax(0, 1fr); }
  .auth-visual { position: relative; height: 46vh; height: 46svh; min-height: 340px; padding: 10px 10px 0; }
  .av-frame { border-radius: 24px; }
  .av-top { left: 16px; right: 16px; top: 14px; }
  .av-top .logo svg { width: 34px; height: 34px; }
  .av-notifs { left: 16px; right: 16px; top: 70px; width: auto; }
  .av-notif:nth-child(2) { display: none; }
  .av-bottom { left: 18px; right: 18px; bottom: 18px; }
  .av-title { font-size: 1.85rem; margin-bottom: 12px; }
  .av-people p { display: none; }
  .av-faces img { width: 36px; height: 36px; margin-left: -10px; }
  .auth-panel { min-height: 0; padding: 4px 20px 18px; }
  .ap-top { display: none; }
  .auth-panel .auth-card, .auth-panel .auth-card.wide { margin: 0 auto; padding: 26px 4px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .av-media { animation: none; }
  .av-notif { animation: none; opacity: 1; transform: none; }
}
.av-notif.lg { --lg-bg: linear-gradient(140deg, rgba(255, 255, 255, .86) 0%, rgba(255, 255, 255, .7) 50%, rgba(255, 255, 255, .8) 100%); }
.av-notif small { color: rgba(3, 10, 23, .74); }
.auth-panel .auth-footer a { margin: 0 6px; }
.auth-panel .auth-footer { text-align: center; }
.av-frame video.av-media { animation: none; }

/* Piège à robots de la liste d'attente : hors écran, jamais vu ni tabulé */
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
