/* ==========================================================================
   Advanced Login Page — Three template variants
   NO scroll anywhere — everything is locked to the viewport.
   Template A: .als-tpl-classic   (Split panel — image left, form right)
   Template B: .als-tpl-centered  (Full-screen background, glass card)
   Template C: .als-tpl-minimal   (Clean centered card, no left panel)
   ========================================================================== */

/* ==========================================================================
   0. HARD SCROLL LOCK — html, body, all Odoo wrappers
   ========================================================================== */
html,
html:has(body.als-login-body),
body.als-login-body {
    overflow: hidden !important;
    height: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: var(--als-page-bg, #0f172a) !important;
    font-family: "Inter", system-ui, -apple-system, sans-serif;
}

body.als-login-body header,
body.als-login-body footer,
body.als-login-body .o_main_navbar,
body.als-login-body .o_frontend_to_backend_nav,
body.als-login-body .o_skip_to_content,
body.als-login-body a[href="#wrap"],
body.als-login-body a[href="#top"] {
    display: none !important;
}

/* Every Odoo container wrapper must be transparent + fill + no scroll */
body.als-login-body #wrapwrap,
body.als-login-body main,
body.als-login-body #wrap,
body.als-login-body .o_home_menu_background,
body.als-login-body .container,
body.als-login-body .container-fluid {
    all: unset !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* ==========================================================================
   1. PAGE SHELL
   ========================================================================== */
.als-page {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: var(--als-page-bg, #0f172a);
    overflow: hidden !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.als-page::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.als-page *,
.als-page *::before,
.als-page *::after {
    box-sizing: border-box;
}

/* ==========================================================================
   2. TEMPLATE A — CLASSIC  (split: full-bleed image left | form right)
   ========================================================================== */
.als-login-wrapper.als-tpl-classic {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    overflow: hidden;
}

/* ---- Left brand panel ---- */
.als-tpl-classic .als-brand-panel {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 52px 56px 44px;
    background: radial-gradient(
        ellipse at 30% 20%,
        var(--als-brand-from, #1e3a5f) 0%,
        var(--als-brand-to, #0a0f1e) 75%
    );
    color: var(--als-brand-text, #f1f5f9);
}

/* Decorative accent glows */
.als-tpl-classic .als-brand-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 80% -10%,
            color-mix(in srgb, var(--als-accent, #6366f1) 20%, transparent) 0%,
            transparent 52%),
        radial-gradient(circle at -10% 95%,
            color-mix(in srgb, var(--als-accent, #6366f1) 12%, transparent) 0%,
            transparent 48%);
    pointer-events: none;
    z-index: 1;
}

/* ---- Right form panel ---- */
.als-tpl-classic .als-login-panel {
    background: var(--als-login-bg, #ffffff);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 56px;
    overflow: hidden;   /* never scrolls */
    position: relative;
}

/* Form card scales down if vertical space is tight */
.als-tpl-classic .als-login-panel .als-login-card {
    width: 100%;
    max-width: 380px;
    /* Scale the card so it always fits the panel height */
    transform-origin: top center;
}

/* ==========================================================================
   3. TEMPLATE B — CENTERED  (full-screen bg | floating glass card)
   ========================================================================== */
.als-login-wrapper.als-tpl-centered {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--als-brand-to, #0a0f1e);
}

/* Brand panel = full-bleed background layer */
.als-tpl-centered .als-brand-panel {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: radial-gradient(
        ellipse at 35% 40%,
        var(--als-brand-from, #1e3a5f) 0%,
        var(--als-brand-to, #050810) 70%
    );
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 44px 60px;
    color: var(--als-brand-text, #f1f5f9);
}

.als-tpl-centered .als-brand-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 75% 20%,
            color-mix(in srgb, var(--als-accent, #6366f1) 25%, transparent) 0%,
            transparent 50%),
        radial-gradient(circle at 20% 80%,
            color-mix(in srgb, var(--als-accent, #6366f1) 14%, transparent) 0%,
            transparent 45%);
    pointer-events: none;
    z-index: 1;
}

.als-tpl-centered .als-bg-media,
.als-tpl-centered .als-bg-video { z-index: 0; }
.als-tpl-centered .als-bg-overlay { z-index: 2; }
.als-tpl-centered .als-bg-orb    { z-index: 1; }
.als-tpl-centered .als-brand-top { display: none; }

.als-tpl-centered .als-hero-content {
    position: relative;
    z-index: 3;
    max-width: 520px;
}

.als-tpl-centered .als-brand-footer {
    position: relative;
    z-index: 3;
}

/* Centered content grid (sits above the bg) */
.als-tpl-centered .als-centered-grid {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1100px;
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 60px;
    align-items: center;
    padding: 0 60px;
}

.als-tpl-centered .als-centered-brand {
    color: var(--als-brand-text, #f1f5f9);
}

/* Login form card (right) — glass surface from Python (--als-card-surface) */
.als-tpl-centered .als-login-panel {
    background: var(--als-card-surface, rgba(255, 255, 255, 0.28)) !important;
    backdrop-filter: blur(var(--als-card-blur, 18px)) saturate(1.2);
    -webkit-backdrop-filter: blur(var(--als-card-blur, 18px)) saturate(1.2);
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 28px;
    padding: 40px 36px;
    box-shadow:
        0 32px 72px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    width: 100%;
    overflow: hidden;
}

/* Form typography follows designer colors (works with light or dark cards) */
.als-tpl-centered .als-card-header h2          { color: var(--als-form-text, #0f172a); }
.als-tpl-centered .als-card-header p           { color: var(--als-form-muted, #64748b); }
.als-tpl-centered .als-input-group label       { color: var(--als-form-text, #0f172a); }
.als-tpl-centered .als-input-group input,
.als-tpl-centered .als-db-row input {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.35);
    color: var(--als-form-text, #0f172a);
}
.als-tpl-centered .als-input-group input::placeholder {
    color: color-mix(in srgb, var(--als-form-muted, #64748b) 80%, transparent);
}
.als-tpl-centered .als-input-group input:focus {
    background: rgba(255, 255, 255, 0.32);
    border-color: var(--als-accent, #6366f1);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--als-accent, #6366f1) 20%, transparent);
}
.als-tpl-centered .als-show-password           { color: var(--als-form-muted, #64748b); }
.als-tpl-centered .als-card-footer            { border-color: rgba(255, 255, 255, 0.2); }
.als-tpl-centered .als-card-footer a          { color: var(--als-form-muted, #64748b); }
.als-tpl-centered .als-divider                { color: var(--als-form-muted, #64748b); }
.als-tpl-centered .als-divider::before,
.als-tpl-centered .als-divider::after {
    background: rgba(255, 255, 255, 0.28);
}
.als-tpl-centered .als-signup-helper          { color: var(--als-form-muted, #64748b); }
.als-tpl-centered .als-signup-helper a        { color: var(--als-accent, #6366f1); }

/* ==========================================================================
   4. TEMPLATE C — MINIMAL  (clean card, no left panel)
   ========================================================================== */
.als-login-wrapper.als-tpl-minimal {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden !important;
    background: var(--als-page-bg, #f1f5f9);
    position: relative;
    padding: 24px;
    box-sizing: border-box;
}

/* Dot-grid pattern */
.als-login-wrapper.als-tpl-minimal::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(
        circle,
        color-mix(in srgb, var(--als-accent, #6366f1) 9%, transparent) 1px,
        transparent 1px
    );
    background-size: 30px 30px;
    pointer-events: none;
    z-index: 0;
}

/* Accent blob top-right */
.als-login-wrapper.als-tpl-minimal::after {
    content: "";
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle,
        color-mix(in srgb, var(--als-accent, #6366f1) 12%, transparent) 0%,
        transparent 65%);
    top: -180px;
    right: -180px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.als-tpl-minimal.als-has-photo::before,
.als-tpl-minimal.als-has-photo::after {
    display: none;
}

.als-tpl-minimal .als-minimal-bg {
    z-index: 0;
}

.als-tpl-minimal .als-minimal-overlay {
    z-index: 0;
}

.als-tpl-minimal.als-has-photo .als-login-panel {
    z-index: 1;
}

.als-tpl-minimal .als-login-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    max-height: calc(100dvh - 48px);
    background: var(--als-card-surface, rgba(255, 255, 255, 0.28)) !important;
    backdrop-filter: blur(var(--als-card-blur, 18px)) saturate(1.2);
    -webkit-backdrop-filter: blur(var(--als-card-blur, 18px)) saturate(1.2);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.32);
    box-shadow:
        0 2px 4px rgba(0,0,0,0.04),
        0 16px 40px rgba(0,0,0,0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    padding: 40px 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.als-tpl-minimal .als-input-group input,
.als-tpl-minimal .als-db-row input {
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.4);
}

.als-tpl-minimal .als-login-panel::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Top accent stripe */
.als-tpl-minimal .als-login-panel::before {
    content: "";
    position: absolute;
    top: 0; left: 10%; right: 10%;
    height: 3px;
    background: linear-gradient(90deg,
        transparent,
        var(--als-accent, #6366f1) 40%,
        var(--als-accent, #6366f1) 60%,
        transparent);
    border-radius: 0 0 4px 4px;
}

.als-tpl-minimal .als-login-card {
    width: 100%;
    max-height: 100%;
    overflow: hidden !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.als-tpl-minimal .als-login-card::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}
.als-tpl-minimal .als-login-form,
.als-tpl-minimal .als-login-form * {
    scrollbar-width: none;
}
.als-tpl-minimal .als-minimal-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}
.als-tpl-minimal .als-minimal-brand-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--als-accent, #6366f1);
    flex-shrink: 0;
}
.als-tpl-minimal .als-minimal-company {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--als-form-muted, #64748b);
    text-transform: uppercase;
}

/* Passkey / OAuth blocks must not force a card scrollbar */
.als-tpl-minimal .als-login-form .o_login_auth,
.als-tpl-minimal .als-login-form .o_auth_oauth_providers,
.als-tpl-minimal .als-login-form .list-group,
.als-tpl-minimal .oe_login_form {
    overflow: visible !important;
    max-height: none !important;
}

/* ==========================================================================
   5. SHARED — background layers (image / video / overlay / orbs)
   ========================================================================== */
.als-bg-media,
.als-bg-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 18%; /* face-up: keep heads/upper body in frame */
    z-index: 0;
    display: block;
    image-rendering: auto;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
}

.als-bg-video {
    object-fit: cover;
    object-position: center 18%;
}

/* Overlay — light on faces at the top, stronger only at the bottom for text */
.als-bg-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(
        180deg,
        rgba(8, 12, 24, 0.06) 0%,
        rgba(8, 12, 24, 0.10) 42%,
        rgba(8, 12, 24, var(--als-overlay, 0.22)) 100%
    );
}

.als-mode-gradient .als-bg-overlay {
    background: rgba(8, 12, 24, 0.08);
}

/* Floating ambient orbs */
.als-bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(72px);
    opacity: 0.2;
    pointer-events: none;
    z-index: 1;
    animation: als-float 16s ease-in-out infinite;
    will-change: transform;
}
.als-orb1 {
    width: 380px; height: 380px;
    background: var(--als-accent, #6366f1);
    top: -80px; right: -80px;
}
.als-orb2 {
    width: 220px; height: 220px;
    background: color-mix(in srgb, var(--als-accent, #6366f1) 70%, #a5b4fc);
    bottom: 40px; left: -50px;
    opacity: 0.13;
    animation-delay: -6s;
}
.als-orb3 {
    width: 90px; height: 90px;
    background: color-mix(in srgb, var(--als-accent, #6366f1) 50%, #c7d2fe);
    top: 48%; left: 58%;
    opacity: 0.1;
    animation-delay: -11s;
}

@keyframes als-float {
    0%,  100% { transform: translateY(0)    scale(1);    }
    50%        { transform: translateY(24px) scale(1.05); }
}

/* ==========================================================================
   6. SHARED — hero copy (left panel content)
   ========================================================================== */
.als-brand-top,
.als-hero-content,
.als-brand-footer {
    position: relative;
    z-index: 3;
}

/* Badge/company row hidden — hero goes straight to tag */
.als-brand-top { display: none; }

.als-hero-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.als-hero-tag {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2.8px;
    color: var(--als-accent, #818cf8);
    margin-bottom: 18px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
}
.als-hero-tag::before {
    content: "";
    display: inline-block;
    width: 32px; height: 2px;
    background: currentColor;
    border-radius: 2px;
    flex-shrink: 0;
}

.als-hero-title {
    font-weight: 800;
    font-size: clamp(28px, 3.2vw, 46px);
    line-height: 1.08;
    letter-spacing: -0.035em;
    margin: 0 0 18px;
    max-width: 90%;
    color: var(--als-hero-title, #f8fafc);
    text-shadow: 0 2px 12px rgba(0,0,0,0.35);
}

.als-hero-desc {
    font-size: clamp(13px, 1.15vw, 15px);
    line-height: 1.8;
    color: var(--als-hero-desc, #94a3b8);
    max-width: 440px;
    margin: 0 0 40px;
    font-weight: 400;
    /* Keep readable over any image */
    text-shadow: 0 1px 6px rgba(0,0,0,0.4);
}

/* Status ticker */
.als-status-ticker {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 60px;
    padding: 10px 18px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    max-width: 420px;
    min-height: 42px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}

.als-ticker-pulse {
    width: 8px; height: 8px;
    background: #4ade80;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
    animation: als-pulse-ring 2s ease-out infinite;
}

@keyframes als-pulse-ring {
    0%   { transform: scale(1);   box-shadow: 0 0 0 0 rgba(74,222,128,0.55); }
    60%  { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(74,222,128,0); }
    100% { transform: scale(1);   box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}

.als-ticker-text {
    font-size: var(--als-ticker-size, 13px);
    color: var(--als-ticker-text, #cbd5e1);
    font-weight: 500;
    overflow: hidden;
    min-height: 1.35em;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.als-ticker-switch { display: inline-block; }
.als-ticker-source { display: none; }

/* ==========================================================================
   7. BRAND FOOTER — always visible over any background
   ========================================================================== */
.als-brand-footer {
    position: relative;
    z-index: 4;   /* above overlay */
    display: flex;
    align-items: center;
    gap: 10px;
    /* Glass pill so it reads over photos AND gradients */
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 40px;
    padding: 9px 18px;
    width: fit-content;
    margin-top: 32px;
    /* Text styling */
    font-size: 11.5px;
    font-weight: 500;
    color: rgba(255,255,255,0.88);
    letter-spacing: 0.25px;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

/* Dot indicator before footer text */
.als-brand-footer::before {
    content: "";
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 6px rgba(74,222,128,0.8);
    flex-shrink: 0;
}

/* ==========================================================================
   8. SHARED — login card & form elements
   ========================================================================== */
.als-login-card {
    width: 100%;
    max-width: 380px;
    max-height: 100%;
    overflow: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.als-login-card::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.als-brand-logo-wrap {
    margin-bottom: 22px;
}
.als-brand-logo {
    display: block;
    max-height: 72px;
    max-width: 220px;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: left center;
    filter: drop-shadow(0 2px 10px rgba(0,0,0,0.35));
}

/* Logo wrapper — always at very top of form card */
.als-form-logo-wrap {
    text-align: var(--als-form-align, center);
    margin-bottom: 22px;
}

.als-form-logo-wrap:empty { display: none; margin: 0; }

.als-login-logo {
    display: block;
    max-height: 96px;
    width: auto;
    max-width: 280px;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
    object-position: center;
    image-rendering: auto;
    -webkit-backface-visibility: hidden;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.10));
}

.als-login-logo--lg    { max-height: 110px; max-width: 300px; }
.als-form-logo-wrap--minimal { margin-bottom: 26px; }

/* Card header */
.als-card-header {
    margin-bottom: 24px;
    text-align: var(--als-form-align, left);
}

.als-card-header h2 {
    font-weight: 800;
    font-size: var(--als-title-size, 24px);
    letter-spacing: -0.025em;
    color: var(--als-form-text, #0f172a);
    margin: 0 0 5px;
}

.als-card-header p {
    color: var(--als-form-muted, #64748b);
    font-size: var(--als-subtitle-size, 14px);
    margin: 0;
    line-height: 1.55;
}

/* Inputs */
.als-input-group {
    margin-bottom: 14px;
    text-align: var(--als-form-align, left);
}

.als-input-group label {
    display: block;
    font-size: var(--als-label-size, 12px);
    font-weight: 700;
    color: var(--als-form-text, #0f172a);
    margin-bottom: 5px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.als-input-group input,
.als-db-row input {
    width: 100%;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    font-family: inherit;
    font-size: var(--als-input-size, 14px);
    color: var(--als-form-text, #0f172a);
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
    outline: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    text-align: var(--als-form-align, left);
}

.als-input-group input:focus {
    background: #ffffff;
    border-color: var(--als-accent, #6366f1);
    box-shadow:
        0 0 0 4px color-mix(in srgb, var(--als-accent, #6366f1) 14%, transparent),
        0 1px 3px rgba(0,0,0,0.04);
}

.als-input-group input::placeholder { color: #94a3b8; }

.als-password-wrap { position: relative; }
.als-password-wrap input { padding-right: 44px; }

.als-show-password {
    position: absolute;
    right: 6px; top: 50%;
    transform: translateY(-50%);
    border: 0; background: transparent;
    color: #94a3b8; cursor: pointer;
    padding: 8px; line-height: 1;
    transition: color 0.15s;
}
.als-show-password:hover { color: var(--als-accent, #6366f1); }

.als-db-row { display: flex; gap: 8px; }

.als-db-select {
    border-radius: 12px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    background: var(--als-form-text, #0f172a);
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

/* Hide superuser, support links, and manage-databases footer */
.als-row-actions,
.als-superuser,
.als-support-link,
.als-card-footer { display: none !important; }

/* Hide Odoo's injected show-password button inside our wrapper —
   we render our own .als-show-password, so the Odoo one is always duplicate */
.als-password-wrap .o_show_password,
.als-password-wrap .o_field_password_eye { display: none !important; }

.als-forgot-link {
    display: block;
    text-align: center;
    margin-top: 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--als-accent, #6366f1);
    text-decoration: none;
}
.als-forgot-link:hover { text-decoration: underline; }

/* ==========================================================================
   9. BUTTON — animated, elevated, with shimmer
   ========================================================================== */
.als-btn-primary {
    position: relative;
    overflow: hidden;
    display: block;
    width: 100%;
    border: none;
    border-radius: 14px;
    padding: 14px 20px;
    margin-top: 8px;
    font-family: inherit;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.2px;
    color: var(--als-button-text, #fff);
    cursor: pointer;
    /* Layered background: gradient over flat colour */
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--als-button-bg, #0f172a) 80%, #fff) 0%,
        var(--als-button-bg, #0f172a) 60%,
        color-mix(in srgb, var(--als-button-bg, #0f172a) 90%, #000) 100%
    );
    /* Elevation */
    box-shadow:
        0 4px 14px color-mix(in srgb, var(--als-button-bg, #0f172a) 40%, transparent),
        0 1px 3px  color-mix(in srgb, var(--als-button-bg, #0f172a) 25%, transparent),
        inset 0 1px 0 rgba(255,255,255,0.12);
    /* Smooth all transitions */
    transition:
        transform    0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow   0.22s ease,
        filter       0.22s ease;
    will-change: transform;
}

/* Shimmer sweep pseudo-element */
.als-btn-primary::before {
    content: "";
    position: absolute;
    top: 0; left: -100%;
    width: 60%; height: 100%;
    background: linear-gradient(
        105deg,
        transparent 20%,
        rgba(255,255,255,0.22) 50%,
        transparent 80%
    );
    transform: skewX(-20deg);
    transition: left 0.55s ease;
    pointer-events: none;
}

/* Subtle top-edge highlight */
.als-btn-primary::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.15);
    pointer-events: none;
}

/* Hover: rise + strengthen shadow + run shimmer */
.als-btn-primary:hover {
    transform: translateY(-3px);
    filter: brightness(1.1);
    box-shadow:
        0 10px 28px color-mix(in srgb, var(--als-button-bg, #0f172a) 45%, transparent),
        0 3px 8px   color-mix(in srgb, var(--als-button-bg, #0f172a) 30%, transparent),
        inset 0 1px 0 rgba(255,255,255,0.16);
}
.als-btn-primary:hover::before { left: 120%; }

/* Press: sink down */
.als-btn-primary:active {
    transform: translateY(1px);
    filter: brightness(0.97);
    box-shadow:
        0 2px 8px  color-mix(in srgb, var(--als-button-bg, #0f172a) 35%, transparent),
        0 1px 2px  color-mix(in srgb, var(--als-button-bg, #0f172a) 20%, transparent),
        inset 0 2px 4px rgba(0,0,0,0.12);
    transition-duration: 0.08s;
}

/* Focus ring (accessibility) */
.als-btn-primary:focus-visible {
    outline: 3px solid var(--als-accent, #6366f1);
    outline-offset: 3px;
}

/* ==========================================================================
   10. MISC SHARED — divider, helper, alerts, footer
   ========================================================================== */
.als-divider {
    display: flex; align-items: center;
    gap: 12px; color: #94a3b8;
    font-size: 11.5px;
    margin: 18px 0 16px;
}
.als-divider::before,
.als-divider::after {
    content: ""; flex: 1;
    height: 1px; background: #e2e8f0;
}

.als-signup-helper {
    text-align: center;
    font-size: 13px;
    color: var(--als-form-muted, #64748b);
}
.als-signup-helper a {
    color: var(--als-accent, #6366f1);
    font-weight: 600;
    text-decoration: none;
    margin-left: 4px;
}
.als-signup-helper a:hover { text-decoration: underline; }

.als-back-login { margin-top: 18px; }

.als-alert {
    border-radius: 10px;
    padding: 9px 14px;
    font-size: 13px;
    margin: 0 0 12px;
    line-height: 1.45;
}
.als-alert-danger  { background:#fef2f2; color:#991b1b; border:1px solid #fecaca; }
.als-alert-success { background:#f0fdf4; color:#166534; border:1px solid #bbf7d0; }

.als-card-footer {
    text-align: center;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: center;
    gap: 14px;
}
.als-card-footer a { color: #94a3b8; text-decoration: none; transition: color 0.15s; }
.als-card-footer a:hover { color: var(--als-accent, #6366f1); }

.als-login-form .btn,
.als-login-form .o_auth_oauth_providers a { border-radius: 12px; }

/* ==========================================================================
   11. ENTRY ANIMATIONS
   ========================================================================== */
/* Form card children fade+slide up on load */
.als-login-wrapper:not(.als-no-anim) .als-form-logo-wrap { animation: als-fade-up 0.42s ease 0.02s both; }
.als-login-wrapper:not(.als-no-anim) .als-card-header     { animation: als-fade-up 0.42s ease 0.08s both; }
.als-login-wrapper:not(.als-no-anim) .als-login-form       { animation: als-fade-up 0.42s ease 0.15s both; }
.als-login-wrapper:not(.als-no-anim) .als-divider          { animation: als-fade-up 0.42s ease 0.36s both; }
.als-login-wrapper:not(.als-no-anim) .als-signup-helper    { animation: als-fade-up 0.42s ease 0.43s both; }
.als-login-wrapper:not(.als-no-anim) .als-card-footer      { animation: als-fade-up 0.42s ease 0.50s both; }
.als-login-wrapper:not(.als-no-anim) .als-minimal-brand    { animation: als-fade-up 0.42s ease 0.02s both; }

@keyframes als-fade-up {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Left panel hero text staggered entrance */
.als-tpl-classic .als-hero-tag,
.als-tpl-centered .als-hero-tag   { animation: als-fade-up 0.5s ease 0.06s both; }
.als-tpl-classic .als-hero-title,
.als-tpl-centered .als-hero-title { animation: als-fade-up 0.5s ease 0.14s both; }
.als-tpl-classic .als-hero-desc,
.als-tpl-centered .als-hero-desc  { animation: als-fade-up 0.5s ease 0.23s both; }
.als-tpl-classic .als-status-ticker,
.als-tpl-centered .als-status-ticker { animation: als-fade-up 0.5s ease 0.34s both; }
.als-tpl-classic .als-brand-footer,
.als-tpl-centered .als-brand-footer  { animation: als-fade-up 0.5s ease 0.42s both; }

/* No-anim overrides */
.als-no-anim .als-form-logo-wrap,
.als-no-anim .als-card-header,
.als-no-anim .als-login-form,
.als-no-anim .als-divider,
.als-no-anim .als-signup-helper,
.als-no-anim .als-card-footer,
.als-no-anim .als-minimal-brand,
.als-no-anim .als-hero-tag,
.als-no-anim .als-hero-title,
.als-no-anim .als-hero-desc,
.als-no-anim .als-status-ticker,
.als-no-anim .als-brand-footer {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   12. RESPONSIVE — scale, never scroll
   ========================================================================== */

/* Classic: at narrow widths stack vertically */
@media (max-width: 860px) {
    .als-login-wrapper.als-tpl-classic {
        grid-template-columns: 1fr;
        grid-template-rows: 36% 1fr;
    }
    .als-tpl-classic .als-brand-panel {
        padding: 24px 28px 18px;
        justify-content: flex-start;
    }
    .als-hero-title  { font-size: 24px !important; max-width: 100%; margin-bottom: 10px; }
    .als-hero-desc   { margin-bottom: 10px; font-size: 13px !important;
                       display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .als-status-ticker { max-width: 100%; }
    .als-tpl-classic .als-login-panel { padding: 24px 28px; }
}

/* Centered: below 900px hide brand text, centre card */
@media (max-width: 900px) {
    .als-tpl-centered .als-centered-grid {
        grid-template-columns: 1fr;
        padding: 32px 24px;
        gap: 0;
        place-items: center;
    }
    .als-tpl-centered .als-centered-brand { display: none; }
    .als-tpl-centered .als-login-panel {
        max-width: 400px;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .als-login-wrapper.als-tpl-minimal {
        padding: 0;
    }
    .als-tpl-minimal .als-login-panel {
        border-radius: 0;
        max-width: 100%;
        max-height: 100dvh;
        height: 100%;
        padding: 28px 20px;
        box-shadow: none;
    }
    .als-tpl-centered .als-login-panel {
        border-radius: 16px;
        padding: 28px 20px;
    }
    .als-hero-title { font-size: 20px !important; }
    .als-card-header h2 { font-size: 21px; }
}

/* Fit tall form cards on short viewports (laptops, landscape phones) */
@media (max-height: 760px) {
    .als-tpl-minimal .als-login-panel {
        padding: 28px 28px;
        max-height: calc(100dvh - 32px);
    }
    .als-tpl-minimal .als-card-header { margin-bottom: 14px; }
    .als-tpl-minimal .als-input-group { margin-bottom: 10px; }
    .als-tpl-minimal .als-form-logo-wrap { margin-bottom: 12px; }
    .als-tpl-minimal .als-login-logo { max-height: 42px; }
    .als-tpl-minimal .als-divider { margin: 12px 0 10px; }
}

@media (max-height: 700px) {
    .als-tpl-classic .als-login-panel,
    .als-tpl-centered .als-login-panel,
    .als-tpl-minimal .als-login-panel {
        padding-top: 24px;
        padding-bottom: 24px;
    }
    .als-card-header { margin-bottom: 16px; }
    .als-input-group { margin-bottom: 10px; }
    .als-form-logo-wrap { margin-bottom: 14px; }
    .als-card-footer { margin-top: 12px; padding-top: 10px; }
    .als-login-logo { max-height: 40px; }
    .als-hero-title { font-size: 22px !important; margin-bottom: 10px; }
    .als-hero-desc  { margin-bottom: 16px; }
}

@media (max-height: 580px) {
    .als-card-header h2 { font-size: 19px; }
    .als-input-group input { padding: 9px 14px; }
    .als-btn-primary { padding: 11px 16px; }
    .als-login-logo { max-height: 56px; }
    .als-login-logo--lg { max-height: 64px; }
    .als-hero-desc { display: none; }
    .als-status-ticker { display: none; }
    .als-tpl-minimal .als-minimal-brand { display: none; }
}
