/* Page de connexion : pas de cadre, juste le logo de la boutique et le formulaire en verre dépoli, sur un fond clair et neutre
   (gris très clair, formes blanches et grises floues). Les identifiants (#login-screen, #login-logo, #login-shop-name, #login-username,
   #login-password, #login-error, #btn-login) sont ceux qu'utilise app.js. */
#login-screen { position: fixed; inset: 0; z-index: 9999; display: flex; flex-direction: column; align-items: center; overflow-y: auto; padding: 96px 20px; background: #eceef1; color: #1c1c1e; isolation: isolate; font-family: var(--font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif); }
/* centré verticalement dans toute la hauteur (le contenu défile s'il est plus haut que l'écran, par exemple avec le clavier) */
#login-screen > .lg-main { margin-top: auto; margin-bottom: auto; }

/* ---- Fond clair : dégradé gris, formes floues blanches / grises qui dérivent lentement, silhouettes de boutique floues, grain ---- */
#login-screen .lg-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: linear-gradient(160deg, #f7f8fa 0%, #eceef1 48%, #dfe2e7 100%); }
.lg-orb { position: absolute; border-radius: 50%; filter: blur(70px); will-change: transform; animation: lg-drift 28s ease-in-out infinite alternate; }
.lg-orb.o1 { width: 44vmax; height: 44vmax; left: -12vmax; top: -16vmax; background: #ffffff; opacity: .95; }
.lg-orb.o2 { width: 38vmax; height: 38vmax; right: -12vmax; top: 2vmax; background: #cfd3da; opacity: .8; animation-duration: 33s; animation-delay: -6s; }
.lg-orb.o3 { width: 36vmax; height: 36vmax; left: 4vmax; bottom: -18vmax; background: #c3c8d0; opacity: .7; animation-duration: 30s; animation-delay: -11s; }
.lg-orb.o4 { width: 26vmax; height: 26vmax; right: 6vmax; bottom: -10vmax; background: #e9dfd2; opacity: .8; animation-duration: 36s; animation-delay: -3s; }
.lg-orb.o5 { width: 24vmax; height: 24vmax; left: 38vw; top: 28vh; background: #ffffff; opacity: .7; animation-duration: 26s; animation-delay: -14s; }
@keyframes lg-drift { from { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(5vmax, 4vmax, 0) scale(1.08); } to { transform: translate3d(-4vmax, 6vmax, 0) scale(.96); } }
.lg-scene { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 70%; opacity: .45; }

.lg-grain { position: absolute; inset: 0; opacity: .1; mix-blend-mode: multiply; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }

/* ---- Colonne centrale ---- */
.lg-main { width: min(380px, 100%); display: flex; flex-direction: column; align-items: center; text-align: center; animation: lg-in .8s cubic-bezier(.2, .8, .2, 1) both; }
.lg-logo { display: flex; align-items: center; justify-content: center; width: 88px; height: 88px; margin: 0 auto 14px; border-radius: 50%; font-size: 2.5em; font-weight: 800; color: #2b2d31; background: rgba(255, 255, 255, .7); border: 1px solid rgba(255, 255, 255, .9); -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%); box-shadow: 0 10px 30px rgba(40, 46, 60, .14), inset 0 1px 0 #fff; }
/* logo choisi par la boutique (image) : affiché tel quel à la place de l'initiale, sans cercle ni cadre */
#login-logo.lg-logo:has(img) { width: auto !important; height: 92px !important; max-width: 240px !important; margin: 0 auto 14px !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none !important; filter: drop-shadow(0 8px 18px rgba(40, 46, 60, .18)); }
.lg-name { margin: 6px 0 0; font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; color: #1c1c1e; }
.lg-sub { margin: 6px 0 26px; font-size: .95rem; color: #6b6f76; }
.lg-form { width: 100%; display: flex; flex-direction: column; gap: 12px; text-align: left; }

/* ---- Champs en verre clair ---- */
.lg-field { position: relative; display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 14px; border-radius: 18px; color: #7b8089; background: rgba(255, 255, 255, .55); border: 1px solid rgba(255, 255, 255, .85); -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%); box-shadow: 0 4px 16px rgba(40, 46, 60, .08), inset 0 1px 0 #fff; transition: border-color .25s, background .25s, box-shadow .25s, transform .35s cubic-bezier(.2, .9, .25, 1.12); }
.lg-field:focus-within { background: rgba(255, 255, 255, .85); border-color: rgba(60, 66, 80, .35); box-shadow: 0 0 0 4px rgba(60, 66, 80, .1), 0 6px 20px rgba(40, 46, 60, .1); color: #1c1c1e; transform: translateY(-1px); }
.lg-field svg { flex: none; }
.lg-field input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: #1c1c1e; font: inherit; font-size: 16px; /* 16 px : iOS ne zoome pas à la saisie */ }
.lg-field input::placeholder { color: #9aa0a8; }
.lg-field input:-webkit-autofill { -webkit-text-fill-color: #1c1c1e; transition: background-color 9999s ease-in-out 0s; }
.lg-eye { flex: none; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-right: -8px; border: 0; border-radius: 12px; background: transparent; color: #7b8089; cursor: pointer; }
.lg-eye:hover, .lg-eye.on { color: #1c1c1e; background: rgba(0, 0, 0, .06); }
.lg-error { padding: 10px 14px; border-radius: 14px; font-size: .85rem; text-align: center; color: #a4271f; background: rgba(255, 255, 255, .7); border: 1px solid rgba(229, 57, 53, .35); }
#solo-first-hint { color: #3a3d42 !important; background: rgba(255, 255, 255, .7) !important; border: 1px solid rgba(0, 0, 0, .08); border-radius: 14px !important; padding: 10px 14px !important; }

/* ---- Bouton graphite ---- */
.lg-btn { height: 56px; margin-top: 6px; border: 0; border-radius: 18px; font: inherit; font-size: 1.02rem; font-weight: 700; letter-spacing: .01em; color: #fff; cursor: pointer; background: linear-gradient(180deg, #3a3d43 0%, #1c1d21 100%); box-shadow: 0 10px 24px rgba(28, 29, 33, .28), inset 0 1px 0 rgba(255, 255, 255, .18); transition: transform .35s cubic-bezier(.2, .9, .25, 1.12), box-shadow .25s, filter .2s; }
.lg-btn:hover { filter: brightness(1.15); }
.lg-btn:active { transform: scale(.97); transition-duration: .08s; }
.lg-btn:disabled { opacity: .6; cursor: progress; }
.lg-btn:focus-visible, .lg-eye:focus-visible { outline: 3px solid rgba(60, 66, 80, .6); outline-offset: 2px; }

/* ---- Pied : contact et créateur ---- */
.lg-foot { position: fixed; left: 0; right: 0; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 14px; padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px)); font-size: .82rem; color: #6b6f76; animation: lg-in 1s .25s cubic-bezier(.2, .8, .2, 1) both; }
.lg-foot[hidden] { display: none; }
.lg-foot a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; color: #1c1c1e; text-decoration: none; font-weight: 600; }
.lg-foot b { color: #1c1c1e; font-weight: 700; }
.lg-phones { display: inline-flex; align-items: center; gap: 12px; }
.lg-dot { width: 4px; height: 4px; border-radius: 50%; background: #aab0ba; }
/* téléphone : une seule ligne discrète (nom + site cliquable) ; ordinateur (≥ 700 px) : contact complet */
.lg-foot .lg-compact { display: inline-flex; align-items: center; gap: 8px; }
.lg-full { display: none; }
@media (min-width: 700px) { .lg-foot .lg-compact { display: none; } .lg-full { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 14px; } }

@keyframes lg-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .lg-orb, .lg-main, .lg-foot { animation: none !important; } .lg-field, .lg-btn { transition: none; } }
@media (prefers-reduced-transparency: reduce) { .lg-field, .lg-logo { -webkit-backdrop-filter: none; backdrop-filter: none; background: #fff; } }

/* Pas de barre du bas, de feuille ni de barre d'état par-dessus la page de connexion */
body:has(#login-screen:not([style*="none"])) #bottom-nav,
body:has(#login-screen:not([style*="none"])) #bottom-nav-sheet,
body:has(#login-screen:not([style*="none"])) #otchino-statusbar { display: none !important; }

/* ---- Animations (voir public/ot-anim.js) ---- */
html.ot-pre .lg-name, html.ot-pre .lg-sub, html.ot-pre .lg-field, html.ot-pre .lg-btn, html.ot-pre .lg-foot { opacity: 0; }
.lg-field svg { transition: transform .45s cubic-bezier(.2, .9, .25, 1.4), color .25s; }
.lg-field:focus-within svg:first-child { transform: scale(1.22) rotate(-6deg); color: #1c1c1e; }
.lg-field::after { content: ''; position: absolute; left: 18px; right: 18px; bottom: -1px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, #1c1c1e, transparent); transform: scaleX(0); transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.lg-field:focus-within::after { transform: scaleX(1); }
.lg-btn { position: relative; overflow: hidden; }
.lg-btn::before { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .22) 50%, transparent 70%); transform: translateX(-120%); transition: transform .8s ease; }
.lg-btn:hover::before, .lg-btn:focus-visible::before { transform: translateX(120%); }
/* connexion en cours : le texte s'efface, une roue tourne */
.lg-btn:disabled { color: transparent; }
.lg-btn:disabled::after { content: ''; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: lg-spin .7s linear infinite; }
@keyframes lg-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .lg-field svg, .lg-field::after, .lg-btn::before { transition: none; } .lg-btn:disabled::after { animation-duration: 2s; } }

/* ---- Fond animé : chiffres gris qui descendent + points, très flous et discrets (login-bg.js) ; le centre reste dégagé derrière le formulaire ---- */
.lg-digits { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .5; image-rendering: auto; -webkit-mask-image: radial-gradient(ellipse 38% 46% at 50% 50%, transparent 0%, rgba(0,0,0,.55) 70%, #000 100%); mask-image: radial-gradient(ellipse 38% 46% at 50% 50%, transparent 0%, rgba(0,0,0,.55) 70%, #000 100%); pointer-events: none; }
#login-logo { position: relative; filter: drop-shadow(0 8px 10px rgba(30, 34, 42, .2)); }
/* logo du logiciel, puis celui de la boutique qui apparaît en fondu par-dessus (app.js) */
/* logo du logiciel : apparait en zoom + fondu (grand et transparent -> taille normale) ; le logo de la boutique arrive de la meme facon et le remplace */
@keyframes lg-zoom-in { from { opacity: 0; transform: scale(1.75); } to { opacity: 1; transform: scale(1); } }
@keyframes lg-zoom-out { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(.7); } }
#login-logo .lg-img { animation: lg-zoom-in 1.1s cubic-bezier(.16, .84, .3, 1) both; transform-origin: 50% 50%; }
#login-logo .lg-img.out { animation: lg-zoom-out .7s ease-in forwards; }
#login-logo .lg-shop { position: absolute; left: 50%; top: 50%; margin: 0; max-width: 240px; opacity: 0; transform-origin: 50% 50%; translate: -50% -50%; }
#login-logo .lg-shop.in { animation: lg-zoom-in 1.1s cubic-bezier(.16, .84, .3, 1) .15s both; }
@media (prefers-reduced-motion: reduce) { #login-logo .lg-img, #login-logo .lg-shop.in { animation-duration: .01s; } }
@media (prefers-reduced-motion: reduce) { .lg-digits { opacity: .3; } }
