/* e-Tijara PRO — espace partenaire : connexion, mot de passe oublié, réinitialisation.
   Formulaire au centre, vitrines de boutiques qui défilent en continu derrière. (Champs et chargement : onboarding.css) */
body.auth { min-height: 100vh; margin: 0; display: flex; flex-direction: column; background: #1e2326; color: #2b3a40; overflow-x: hidden; }

/* Fond : mosaïque de boutiques, défilement horizontal sans fin (1 image = 3 × sa hauteur) */
.auth-bg { position: fixed; inset: 0; overflow: hidden; z-index: 0; }
.auth-bg-track { position: absolute; top: 0; bottom: 0; inset-inline-start: 0; width: calc(100vw + 600vh);
  background: url('img/vitrines-loop.webp') repeat-x 0 0 / auto 100%; animation: authScroll 240s linear infinite; will-change: transform; }
[dir="rtl"] .auth-bg-track { animation-name: authScrollRtl; }
/* image en boucle = 6 × sa hauteur (vitrines + miroir) : la fin rejoint exactement le début */
@keyframes authScroll { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-600vh, 0, 0); } }
@keyframes authScrollRtl { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(600vh, 0, 0); } }
.auth-veil { position: fixed; inset: 0; z-index: 1; background: rgba(22, 26, 28, .74); }

.auth-head, .auth-center, .auth-foot { position: relative; z-index: 2; }
.auth-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px clamp(16px, 4vw, 40px); }
.auth-head-brand { display: inline-flex; align-items: center; gap: 8px; color: #fff !important; text-decoration: none; font-weight: 700; font-size: 16px; }
.auth-langs { display: flex; gap: 2px; padding: 3px; border-radius: 8px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); }
.auth-langs a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 6px; color: #d7dcde !important; text-decoration: none; font-weight: 700; font-size: 13px; }
.auth-langs img { width: 20px; height: 14px; border-radius: 2px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); }
.auth-langs a[aria-current] { background: #fff; color: #212529 !important; }

.auth-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 16px 20px; }
.auth-card { width: 100%; max-width: 410px; background: #fff; border-radius: 12px; padding: 28px 28px 24px; border-top: 4px solid #ffc107; }
.auth-logo { display: block; height: 40px; width: auto; margin: 0 0 18px; }
.auth-card h1 { font-size: 21px; font-weight: 700; color: #212529; margin: 0 0 4px; letter-spacing: 0; }
.auth-lead { color: #6c757d; font-size: 14px; line-height: 1.55; margin: 0 0 4px; }
.auth-card p { margin-top: 0; }
.auth-form .field { margin-top: 14px; }
.auth-form .field > label { font-size: 13.5px; font-weight: 600; color: #343a40; margin-bottom: 5px; }
body.auth input[type="email"], body.auth input[type="password"], body.auth input[type="text"] { height: 44px; padding: 0 12px; font-size: 15px; border: 1px solid #ced4da; border-radius: 8px; background: #fff; }
body.auth input:focus { border-color: #343a40; box-shadow: 0 0 0 3px rgba(52, 58, 64, .12); }
body.auth input.is-invalid { border-color: #dc3545; box-shadow: none; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; color: #343a40; }
.check input { width: 17px; height: 17px; padding: 0; margin: 0; accent-color: #343a40; cursor: pointer; }
.auth-link { font-size: 13.5px; font-weight: 600; color: #343a40 !important; }
.auth-captcha { margin-top: 14px; min-height: 78px; display: flex; justify-content: center; }
.auth-captcha.is-invalid .g-recaptcha { outline: 2px solid #dc3545; outline-offset: 2px; border-radius: 4px; }
.auth-captcha-q input { max-width: 120px; }
body.auth .btn-block { display: flex; width: 100%; margin-top: 16px; }
body.auth .btn { height: 46px; border-radius: 8px; font-size: 15px; font-weight: 700; box-shadow: none !important; }
body.auth .btn::after { display: none !important; }
body.auth .btn-primary { background: #ffc107; color: #1a1a1a; border: 1px solid #e5ad06; }
body.auth .btn-primary:hover { background: #f2b600; transform: none; }
body.auth .btn-ghost { background: #fff; border: 1px solid #ced4da; color: #343a40; }
.auth-alt { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid #e9ecef; text-align: center; font-size: 13.5px; color: #6c757d; }
.auth-alt a { color: #212529; font-weight: 700; }
.auth-alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; margin: 14px 0 0; font-size: 13.5px; font-weight: 600; line-height: 1.45; }
.auth-alert i { margin-top: 3px; }
.auth-alert.is-error { background: #fdf0f1; color: #a61e2d; border: 1px solid #f3c6cb; }
.auth-alert.is-info { background: #eef5f8; color: #1d5b6b; border: 1px solid #cfe3ea; }
.auth-alert.is-success { background: #eef8f2; color: #146c3b; border: 1px solid #c7e7d3; }
.auth-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 1.3rem; background: #fff3cd; color: #8a6500; margin-bottom: 12px; }
.auth-icon.is-mail { background: #e8f5ee; color: #198754; }
.auth-icon.is-warn { background: #fdf0f1; color: #c62f3e; }
.hint { color: #6c757d; font-size: 13px; }
.pw-meter span.lvl1 { background: #dc3545; } .pw-meter span.lvl2 { background: #e5ad06; } .pw-meter span.lvl3 { background: #198754; }

.auth-secure { margin: 14px 0 0; color: #c9d0d3; font-size: 12.5px; }
.auth-feats { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; max-width: 760px; }
.auth-feats li { display: inline-flex; align-items: center; gap: 7px; color: #e4e8ea; font-size: 13px; font-weight: 600; }
.auth-feats i { color: #ffc107; font-size: 12px; }
.auth-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; padding: 14px 16px 18px; font-size: 12.5px; color: #aab3b7; }
.auth-foot a { color: #d7dcde !important; text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; }
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }
.btn.is-loading { pointer-events: none; opacity: .85; }

@media (max-width: 900px) { .auth-bg-track { background-image: url('img/vitrines-loop-sm.webp'); animation-duration: 200s; } }
@media (max-width: 480px) {
  .auth-head { padding: 12px 14px; }
  .auth-card { padding: 22px 18px 20px; }
  .auth-feats { display: none; }
}
@media (prefers-reduced-motion: reduce) { .auth-bg-track { animation: none; } }

/* Écran d'état de connexion : compte suspendu / connexion bloquée quelques minutes (remplace le formulaire) */
.auth-state { text-align: center; padding: 6px 0 2px; }
.auth-state-ico { width: 68px; height: 68px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 20px; font-size: 28px; }
.auth-state.is-disabled .auth-state-ico { background: #fde8ea; color: #c9302c; }
.auth-state.is-locked .auth-state-ico { background: #fff4d6; color: #b7791f; }
.auth-state h1 { margin: 0 0 8px; }
.auth-state > p { margin: 0 0 20px; color: #5d7077; line-height: 1.6; }
.auth-state .btn i { margin-inline-end: 6px; }
.auth-state .auth-state-wait { margin: 14px 0 0; font-size: 14px; color: #5d7077; }

/* v2.12 — Logo officiel (pastille blanche, le texte « Tijara » est bleu nuit) */
.auth-head-brand.is-logo { padding: 6px 12px; border-radius: 12px; background: #fff; line-height: 0; }
.auth-head-brand.is-logo img { display: block; height: 36px; width: auto; }

/* v2.12 — Twitty regarde par-dessus le formulaire de connexion, les ailes posées sur le bord */
.auth-card.has-tw { position: relative; margin-top: 128px; padding-top: 40px; }
.auth-tw { position: absolute; z-index: 3; left: 50%; bottom: calc(100% - 30px); width: 190px; height: 168px; margin-left: -95px; pointer-events: none; overflow: hidden; }
.auth-tw img { position: absolute; left: 0; bottom: 0; width: 190px; height: auto; transform-origin: 50% 100%; animation: twRise .7s cubic-bezier(.2, 1.3, .4, 1) .15s backwards, twTilt 5s ease-in-out 1.2s infinite; }
.auth-tw-hi { position: absolute; z-index: 4; top: 8px; left: calc(100% - 4px); white-space: nowrap; padding: 7px 12px; border-radius: 14px 14px 14px 4px; background: #1b3c45; color: #fff; font-size: 13px; font-weight: 700; line-height: 1.2;
  animation: twHi .45s cubic-bezier(.2, 1.4, .4, 1) .85s backwards; }
.auth-tw { overflow: visible; }
.auth-tw::before { content: ""; position: absolute; inset: 0 0 0 0; }
.auth-card.has-tw .auth-tw { clip-path: inset(-60px -400px 0 -400px); }   /* Twitty sort de derrière le bord du formulaire ; la bulle reste visible */
[dir="rtl"] .auth-tw-hi { left: auto; right: calc(100% - 4px); border-radius: 14px 14px 4px 14px; }
@keyframes twRise { from { transform: translateY(105%); } }
@keyframes twTilt { 0%, 70%, 100% { transform: rotate(0); } 78% { transform: rotate(-4deg); } 86% { transform: rotate(3deg); } 92% { transform: rotate(-1deg); } }
@keyframes twHi { from { opacity: 0; transform: scale(.6) translateY(8px); } }
@media (max-width: 640px) { .auth-tw-hi { left: auto; right: auto; top: -30px; left: 50%; transform: translateX(-50%); border-radius: 14px; animation-name: twHiM; } @keyframes twHiM { from { opacity: 0; transform: translate(-50%, 8px) scale(.7); } } }
@media (max-width: 480px) {
  .auth-card.has-tw { margin-top: 110px; padding-top: 34px; }
  .auth-tw { width: 160px; height: 141px; margin-left: -80px; bottom: calc(100% - 26px); }
  .auth-tw img { width: 160px; }
  .auth-head-brand.is-logo img { height: 30px; }
}
@media (prefers-reduced-motion: reduce) { .auth-tw img, .auth-tw-hi { animation: none; } }
@media (min-width: 481px) {
  .auth-card.has-tw { margin-top: 150px; }
  .auth-tw { width: 220px; height: 194px; margin-left: -110px; bottom: calc(100% - 34px); }
  .auth-tw img { width: 220px; }
  .auth-tw-hi { top: 22px; }
}
@media (max-width: 480px) { .auth-card.has-tw { margin-top: 140px; } }
@media (max-width: 640px) { [dir="rtl"] .auth-tw-hi, .auth-tw-hi { right: auto; left: 50%; top: -30px; } }
body.auth { overflow-x: hidden; }

/* v2.12.1 — Logo sur fond transparent (version claire : « Tijara » en blanc sur le fond sombre) */
.auth-head-brand.is-logo { padding: 0; border-radius: 0; background: none; }
.auth-head-brand.is-logo img { height: 40px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35)); }
/* Titre centré, sans phrase d'introduction */
.auth-card.has-tw h1 { text-align: center; margin-bottom: 2px; }
/* Twitty plus haut : les ailes posées sur le bord, pas dans le formulaire */
@media (min-width: 481px) {
  .auth-card.has-tw { margin-top: 158px; padding-top: 26px; }
  .auth-tw { bottom: calc(100% - 12px); }
}
@media (max-width: 480px) { .auth-card.has-tw { margin-top: 138px; padding-top: 24px; } .auth-tw { bottom: calc(100% - 10px); } }
/* Pas de défilement : tout tient dans l'écran (petites hauteurs : Twitty plus petit, bandeaux allégés) */
.auth-login .auth-center { justify-content: flex-start; padding-top: 0; }
.auth-login .auth-form .field { margin-top: 10px; }
@media (max-height: 860px) {
  .auth-login .auth-feats { display: none; }
  .auth-login .auth-head { padding-top: 10px; padding-bottom: 6px; }
  .auth-login .auth-foot { padding: 8px 16px 10px; }
}
@media (max-height: 760px) and (min-width: 481px) {
  .auth-card.has-tw { margin-top: 116px; padding: 20px 26px 16px; }
  .auth-tw { width: 160px; height: 141px; margin-left: -80px; bottom: calc(100% - 9px); }
  .auth-tw img { width: 160px; }
  .auth-tw-hi { top: 10px; }
  .auth-login .auth-form .field { margin-top: 8px; }
  .auth-login .auth-form .form-control { height: 42px; }
}
/* Le bandeau du haut (logo, langues) flotte : Twitty peut monter jusqu'en haut de l'écran, entre les deux */
.auth-login .auth-head { position: absolute; z-index: 5; top: 0; inset-inline: 0; }
.auth-login .auth-center { padding-top: 10px; }
@media (max-height: 760px) and (min-width: 481px) { .auth-card.has-tw { margin-top: 108px; } }
@media (max-width: 480px) {
  .auth-login .auth-center { padding-top: 58px; }
  .auth-card.has-tw { margin-top: 112px; }
}
@media (max-width: 480px) and (max-height: 700px) {
  .auth-login .auth-center { padding-top: 50px; }
  .auth-card.has-tw { margin-top: 92px; padding: 18px 16px 14px; }
  .auth-tw { width: 120px; height: 106px; margin-left: -60px; bottom: calc(100% - 8px); }
  .auth-tw img { width: 120px; }
  .auth-tw-hi { display: none; }
  .auth-login .auth-form .field { margin-top: 8px; }
  .auth-login .auth-foot { padding: 6px 12px 8px; gap: 4px 12px; }
}
@media (max-height: 640px) and (min-width: 481px) {
  .auth-card.has-tw { margin-top: 96px; padding: 16px 26px 12px; }
  .auth-tw { width: 130px; height: 115px; margin-left: -65px; bottom: calc(100% - 8px); }
  .auth-tw img { width: 130px; }
  .auth-tw-hi { top: 4px; }
  .auth-login .auth-foot { padding: 6px 16px 6px; }
}
@media (max-width: 480px) and (max-height: 700px) { .auth-card.has-tw { margin-top: 88px; } .auth-login .auth-center { padding-top: 46px; } .auth-login .auth-alt { margin-top: 8px; } }
@media (max-width: 480px) and (max-height: 700px) { .auth-login .auth-foot { font-size: 11.5px; padding: 4px 10px 6px; } .auth-card.has-tw h1 { font-size: 19px; } }
.auth-login .auth-center { justify-content: safe center; }
/* v2.12.2 — Twitty 2 px plus bas (toutes tailles d'écran) */
.auth-card.has-tw .auth-tw img { bottom: -2px; }
.auth-card.has-tw .auth-tw { clip-path: inset(-60px -400px -2px -400px); }
