/* ============================================================================
   Labocine — LOGIN, revamped 2026-07. Loads ON TOP of signup-page.css and
   reuses its `.sx` system (grid shell, form styling, inputs, buttons,
   divider, social buttons). Scoped under `.sx--login`.

   The left column is "the living archive": the random film stills the page
   has always shown, upgraded to a rotating Ken Burns stage with the film
   credit and a clickable film-strip — and the homepage's Three.js particle
   field breathing over the stills. The right column is the glass login form.
   ============================================================================ */

/* the page is a single viewport-high scene on desktop */
.sx--login { min-height: 100vh; }
.sx--login .sx__left { position: relative; min-height: 100vh; overflow: hidden; }

/* ══════════════════════════════════════════════ THE STAGE (still rotator) */
.lg-stage { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.lg-still {
    position: absolute; inset: -4%;
    background-size: cover; background-position: 50% 30%;
    opacity: 0; transition: opacity 1.4s ease;
    animation: lg-kb 22s ease-in-out infinite alternate;
}
.lg-still--b { animation-delay: -11s; }
.lg-still.is-on { opacity: 1; }
@keyframes lg-kb {
    from { transform: scale(1) translate3d(0, 0, 0); }
    to { transform: scale(1.08) translate3d(-1.2%, 1%, 0); }
}
/* the particle field breathes OVER the stills — additive glow */
.sx--login .lg-stage #hx-canvas {
    position: absolute; inset: 0; width: 100%; height: 100%; display: block;
    mix-blend-mode: screen;
    opacity: 0; transition: opacity 1.6s ease 0.2s;
}
html.hx-webgl .sx--login .lg-stage #hx-canvas { opacity: 0.5; }
.lg-scrim {
    position: absolute; inset: 0;
    background:
        linear-gradient(180deg, rgba(7, 7, 10, 0.55), transparent 30%, transparent 55%, rgba(7, 7, 10, 0.88)),
        linear-gradient(90deg, rgba(7, 7, 10, 0.35), transparent 40%);
}

/* ══════════════════════════════════════════════════════ BRAND + CREDIT */
.lg-brand { position: relative; z-index: 2; padding: 44px 56px 0; }
.lg-brand img { display: block; height: auto; }

.lg-credit {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
    padding: 0 56px 40px;
}
.lg-credit__eyebrow {
    margin: 0 0 10px; font-size: 0.7rem; font-weight: 800;
    letter-spacing: 0.3em; text-transform: uppercase; color: var(--sx-red-hover);
}
.lg-credit__body.is-swap { animation: lg-swap 0.9s cubic-bezier(0.2, 0.75, 0.2, 1); }
@keyframes lg-swap {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}
.lg-credit__title {
    margin: 0 0 4px; font-size: clamp(1.3rem, 2.2vw, 2rem); font-weight: 900;
    line-height: 1.15; color: #fff; text-shadow: 0 2px 26px rgba(0, 0, 0, 0.9);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lg-credit__dir {
    margin: 0; font-size: 0.92rem; color: var(--sx-muted);
    text-shadow: 0 1px 14px rgba(0, 0, 0, 0.9);
}

/* the film-strip: one frame per still, click to jump */
.lg-strip { display: flex; gap: 8px; margin-top: 18px; }
.lg-strip:empty { display: none; }
.lg-strip__thumb {
    width: 54px; height: 34px; padding: 0; cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 6px;
    background-size: cover; background-position: center;
    opacity: 0.45; filter: saturate(0.6);
    transition: opacity 0.3s ease, filter 0.3s ease, border-color 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.lg-strip__thumb:hover { opacity: 0.85; transform: translateY(-2px); }
.lg-strip__thumb.is-active {
    opacity: 1; filter: none;
    border-color: var(--sx-red); box-shadow: 0 0 16px -2px rgba(244, 0, 0, 0.6);
    transform: translateY(-2px);
}

/* ══════════════════════════════════════════════════════ FORM COLUMN */
/* single-viewport scene: center the form vertically */
.sx--login .sx__form { align-items: center; padding-top: 44px; }
/* a soft aurora gradient lives behind the glass form panel */
.sx--login .lg-form-bg {
    position: absolute; inset: 0; z-index: 0;
    overflow: hidden; pointer-events: none;
}
/* soft clearing where the form sits, so inputs stay readable */
.sx--login .lg-form-scrim {
    position: absolute; inset: 0;
    background: radial-gradient(72% 58% at 50% 44%, rgba(13, 13, 16, 0.7), rgba(13, 13, 16, 0.28) 68%, transparent);
}
.sx--login .sx__form-inner { position: relative; z-index: 1; }
.sx--login .lg-title { text-align: left; margin-bottom: 20px; }
.sx--login .lg-title .lg-w {
    display: inline-block; font-size: 2rem; letter-spacing: 0.01em;
    opacity: 0; transform: translateY(0.5em);
    animation: sx-word 0.8s cubic-bezier(0.2, 0.75, 0.2, 1) 0.15s forwards;
}
.sx--login .lg-label-row { display: flex; align-items: baseline; justify-content: space-between; }
.sx--login .lg-label-row label { margin-bottom: 7px; }
.sx--login .lg-forgot {
    font-size: 0.78rem; color: var(--sx-muted-2);
    border-bottom: 1px solid transparent; transition: color 0.2s ease, border-color 0.2s ease;
}
.sx--login .lg-forgot:hover { color: var(--sx-red-hover); border-color: rgba(244, 0, 0, 0.55); }
.sx--login .auth-footer { text-align: left; }
/* brand glyphs inside the reused social buttons */
.sx--login .social-btn .fab { font-size: 1.05rem; }
.sx--login .social-btn { text-transform: capitalize; }

.lg-logo-mobile { display: none; }
.lg-credit--mobile { display: none; }

/* ══════════════════════════════════════════════════════ RESPONSIVE */
@media (max-width: 1080px) {
    /* the archive becomes a fixed full-screen backdrop; the form floats
       over it as a single centered glass panel */
    .sx.sx--login { grid-template-columns: 1fr; grid-template-areas: "form"; }
    /* undo signup's mobile unwrap (display:contents would orphan the stage) */
    .sx--login .sx__left {
        display: block; position: fixed; inset: 0; z-index: 0;
        min-height: 0; overflow: hidden;
    }
    .sx--login .lg-brand { display: none; }
    /* hide the stage copy only — the credit repeats under the form */
    .sx--login .sx__left .lg-credit { display: none; }
    .sx--login .lg-scrim {
        background:
            linear-gradient(180deg, rgba(7, 7, 10, 0.7), rgba(7, 7, 10, 0.45) 35%, rgba(7, 7, 10, 0.55) 70%, rgba(7, 7, 10, 0.85));
    }
    .sx--login .lg-form-bg { display: none; }
    .sx--login .lg-stage #hx-canvas { display: none; }   /* stills are the hero on phones */

    .sx--login .sx__form {
        position: relative; z-index: 1;
        min-height: 100vh; max-height: none; overflow: visible;
        border-left: 0; border-top: 0;
        display: flex; align-items: center;
        padding: 44px 22px;
        background: transparent;           /* the fixed stage shows through */
        -webkit-backdrop-filter: none; backdrop-filter: none;
    }
    .sx--login .sx__form-inner {
        max-width: 430px;
        background: rgba(13, 13, 16, 0.78);
        border: 1px solid var(--sx-border); border-radius: var(--sx-radius);
        -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
        padding: 26px 22px 24px;
    }
    .lg-logo-mobile { display: flex; justify-content: center; margin-bottom: 18px; }
    .sx--login .lg-credit--mobile { display: block; position: static; padding: 18px 4px 0; }
    .sx--login .lg-credit--mobile .lg-credit__title { font-size: 1.05rem; }
}
@media (max-width: 400px) {
    .sx--login .sx__form { padding: 32px 14px; }
    .sx--login .sx__form-inner { padding: 22px 16px 20px; }
}

/* ══════════════════════════════════════════════════════ REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
    .lg-still { animation: none; transition: none; }
    .lg-credit__body.is-swap { animation: none; }
    .sx--login .lg-title .lg-w { animation: sx-word 0.01s forwards; }
    .lg-strip__thumb { transition: none; }
}
