/**
 * MallPro — auth cinematic layer (login + logout-bridge).
 * Adapted from Cash & Carry POS auth-experience.css.
 * Palette: Executive Estate — Ink #1C1917 + Bronze #B8956A.
 */

/* ─── LOGIN: shell entrance ───────────────────────────────────────── */
@keyframes authShellReveal {
    from { opacity: 0; filter: blur(10px); }
    to   { opacity: 1; filter: blur(0); }
}
@keyframes authBrandSlide {
    from { opacity: 0; transform: translateX(-28px) scale(0.98); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes authFormSlide {
    from { opacity: 0; transform: translateX(36px) scale(0.98); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes authCardLift {
    from {
        opacity: 0;
        transform: translateY(28px) rotateX(6deg);
        box-shadow: 0 4px 28px rgba(18, 16, 26, 0.04);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0);
        box-shadow:
            0 4px 28px rgba(18, 16, 26, 0.10),
            0 32px 64px rgba(18, 16, 26, 0.08);
    }
}
@keyframes authFieldRise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes authShimmer {
    0%   { transform: translateX(-120%) skewX(-12deg); opacity: 0; }
    15%  { opacity: 1; }
    100% { transform: translateX(220%) skewX(-12deg); opacity: 0; }
}
@keyframes authMeshShift {
    0%, 100% { opacity: 0.55; transform: scale(1) translate(0, 0); }
    50%      { opacity: 0.85; transform: scale(1.08) translate(4%, -3%); }
}

.auth-experience .auth-shell      { animation: authShellReveal 0.85s cubic-bezier(0.22,1,0.36,1) both; }
.auth-experience .auth-brand      { animation: authBrandSlide  0.90s cubic-bezier(0.22,1,0.36,1) 0.06s both; }
.auth-experience .auth-form-wrap  { animation: authFormSlide   0.90s cubic-bezier(0.22,1,0.36,1) 0.10s both; position: relative; }
.auth-experience .auth-card {
    animation: authCardLift 0.95s cubic-bezier(0.22,1,0.36,1) 0.14s both;
    position: relative;
    overflow: hidden;
}
.auth-experience .auth-card::after {
    content: '';
    position: absolute;
    inset: -40% -40%;
    width: 45%;
    background: linear-gradient(
        105deg,
        transparent 0%,
        rgba(212, 184, 150, 0.2) 45%,
        rgba(184, 149, 106, 0.45) 50%,
        rgba(212, 184, 150, 0.2) 55%,
        transparent 100%
    );
    animation: authShimmer 1.35s cubic-bezier(0.4,0,0.2,1) 0.55s forwards;
    pointer-events: none;
    z-index: 2;
}

.auth-experience .auth-brand-inner > .auth-brand-top  { animation: authFieldRise 0.65s cubic-bezier(0.22,1,0.36,1) 0.20s both; }
.auth-experience .auth-brand-inner > .tagline         { animation: authFieldRise 0.65s cubic-bezier(0.22,1,0.36,1) 0.28s both; }
.auth-experience .auth-brand-inner > .mall-scene      { animation: authFieldRise 0.75s cubic-bezier(0.22,1,0.36,1) 0.36s both; }
.auth-experience .auth-brand-inner > .brand-stats     { animation: authFieldRise 0.65s cubic-bezier(0.22,1,0.36,1) 0.44s both; }

.auth-experience .auth-card > h2                                    { animation: authFieldRise 0.55s cubic-bezier(0.22,1,0.36,1) 0.22s both; }
.auth-experience .auth-card > .sub                                  { animation: authFieldRise 0.55s cubic-bezier(0.22,1,0.36,1) 0.28s both; }
.auth-experience .auth-card form > .field:first-of-type             { animation: authFieldRise 0.55s cubic-bezier(0.22,1,0.36,1) 0.34s both; }
.auth-experience .auth-card form > .field:last-of-type              { animation: authFieldRise 0.55s cubic-bezier(0.22,1,0.36,1) 0.40s both; }
.auth-experience .auth-card form > .row-between                     { animation: authFieldRise 0.55s cubic-bezier(0.22,1,0.36,1) 0.46s both; }
.auth-experience .auth-card form > .btn-primary                     { animation: authFieldRise 0.55s cubic-bezier(0.22,1,0.36,1) 0.52s both; }
.auth-experience .auth-card .demo-grid                              { animation: authFieldRise 0.55s cubic-bezier(0.22,1,0.36,1) 0.58s both; }
.auth-experience .auth-card .foot-note,
.auth-experience .auth-card .auth-credit                            { animation: authFieldRise 0.55s cubic-bezier(0.22,1,0.36,1) 0.66s both; }

.auth-experience .auth-form-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 70% 20%, rgba(67, 56, 202, 0.12), transparent 55%),
        radial-gradient(ellipse 60% 40% at 20% 80%, rgba(184, 149, 106, 0.12), transparent 50%);
    animation: authMeshShift 18s ease-in-out infinite;
    pointer-events: none;
}

.auth-experience .btn-primary { position: relative; overflow: hidden; }
.auth-experience .btn-primary.is-loading { pointer-events: none; opacity: 0.95; font-size: 0; }
.auth-experience .btn-primary.is-loading i { display: none; }
.auth-experience .btn-primary.is-loading::after {
    content: '';
    width: 1.35rem; height: 1.35rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: authSpin 0.65s linear infinite;
    display: inline-block;
    vertical-align: middle;
    font-size: 1rem;
}
@keyframes authSpin { to { transform: rotate(360deg); } }

/* ─── LOGOUT BRIDGE (full-screen) ──────────────────────────────────── */
.logout-bridge-body {
    margin: 0;
    min-height: 100vh;
    font-family: 'DM Sans', system-ui, sans-serif;
    color: #fff;
    overflow: hidden;
    background: #15123A;
}

.logout-bridge-bg {
    position: fixed;
    inset: 0;
    background: linear-gradient(160deg, #12100E 0%, #1C1917 50%, #292524 100%);
    z-index: 0;
}

.logout-bridge-bg::before {
    content: '';
    position: absolute;
    width: min(120vw, 900px);
    height: min(120vw, 900px);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(197, 160, 78, 0.32) 0%, transparent 62%);
    top: -35%;
    right: -25%;
    animation: lbOrbA 14s ease-in-out infinite;
}

.logout-bridge-bg::after {
    content: '';
    position: absolute;
    width: min(100vw, 700px);
    height: min(100vw, 700px);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.30) 0%, transparent 65%);
    bottom: -30%;
    left: -20%;
    animation: lbOrbB 18s ease-in-out infinite;
}

@keyframes lbOrbA {
    0%, 100% { transform: translate(0, 0) scale(1);     opacity: 0.9; }
    50%      { transform: translate(-6%, 8%) scale(1.12); opacity: 1; }
}
@keyframes lbOrbB {
    0%, 100% { transform: translate(0, 0) scale(1);     }
    50%      { transform: translate(8%, -6%) scale(1.08); }
}

.logout-bridge-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, black 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, black 20%, transparent 75%);
    z-index: 1;
    pointer-events: none;
    animation: lbGridPulse 4s ease-in-out infinite;
}
@keyframes lbGridPulse {
    0%, 100% { opacity: 0.40; }
    50%      { opacity: 0.75; }
}

.logout-bridge-main {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
    text-align: center;
}

@keyframes lbContentIn {
    from { opacity: 0; transform: translateY(24px) scale(0.94); filter: blur(8px); }
    to   { opacity: 1; transform: translateY(0)     scale(1);   filter: blur(0);   }
}

.logout-bridge-card {
    max-width: 460px;
    animation: lbContentIn 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.logout-bridge-mark {
    width: 92px;
    height: 92px;
    margin: 0 auto 1.5rem;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(197, 160, 78, 0.20), rgba(197, 160, 78, 0.08));
    border: 1px solid rgba(197, 160, 78, 0.42);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    color: #F0C040;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.40),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 40px rgba(197, 160, 78, 0.24);
    position: relative;
    z-index: 1;
    animation: lbMarkFloat 3s ease-in-out infinite;
}
@keyframes lbMarkFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

.logout-bridge-rings {
    position: absolute;
    inset: -12px;
    border-radius: 28px;
    pointer-events: none;
}
.logout-bridge-rings span {
    position: absolute;
    inset: 0;
    border-radius: 22px;
    border: 2px solid transparent;
    border-top-color: rgba(240, 192, 64, 0.75);
    border-right-color: rgba(165, 180, 252, 0.40);
    animation: lbRing 1.8s linear infinite;
}
.logout-bridge-rings span:nth-child(2) {
    inset: 8px;
    animation-duration: 2.4s;
    animation-direction: reverse;
    border-top-color: rgba(165, 180, 252, 0.55);
}
.logout-bridge-rings span:nth-child(3) {
    inset: 16px;
    animation-duration: 3.1s;
    border-top-color: rgba(197, 160, 78, 0.42);
}
@keyframes lbRing { to { transform: rotate(360deg); } }

.logout-bridge-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(1.55rem, 4vw, 2.0rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 0.5rem;
    background: linear-gradient(120deg, #fff 0%, #F0C040 45%, #E0E7FF 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.logout-bridge-sub {
    margin: 0 0 2rem;
    font-size: 0.95rem;
    color: rgba(226, 232, 240, 0.80);
    line-height: 1.55;
}

.logout-bridge-dots {
    display: inline-flex;
    gap: 0.35rem;
    align-items: center;
    justify-content: center;
    margin-top: 0.25rem;
}
.logout-bridge-dots i {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: linear-gradient(135deg, #F0C040, #A5B4FC);
    animation: lbDot 1.1s ease-in-out infinite both;
    box-shadow: 0 0 12px rgba(197, 160, 78, 0.55);
}
.logout-bridge-dots i:nth-child(2) { animation-delay: 0.15s; }
.logout-bridge-dots i:nth-child(3) { animation-delay: 0.30s; }
@keyframes lbDot {
    0%, 100% { transform: translateY(0)    scale(1);    opacity: 0.45; }
    50%      { transform: translateY(-6px) scale(1.15); opacity: 1; }
}

.logout-bridge-bar {
    height: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
    margin-top: 1.75rem;
}
.logout-bridge-bar > span {
    display: block;
    height: 100%;
    width: 35%;
    border-radius: inherit;
    background: linear-gradient(90deg, #F0C040, #818CF8, #C084FC);
    animation: lbBar 1.15s ease-in-out infinite;
    box-shadow: 0 0 16px rgba(197, 160, 78, 0.50);
}
@keyframes lbBar {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(380%); }
}

.logout-bridge-brand {
    margin-top: 1.5rem;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.40);
    font-weight: 700;
}
.logout-bridge-brand strong { color: rgba(240, 192, 64, 0.85); }

/* ─── Reduced motion ──────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .auth-experience .auth-shell,
    .auth-experience .auth-brand,
    .auth-experience .auth-form-wrap,
    .auth-experience .auth-card,
    .auth-experience .auth-card::after,
    .auth-experience .auth-brand-inner > *,
    .auth-experience .auth-card > h2,
    .auth-experience .auth-card > .sub,
    .auth-experience .auth-card form > *,
    .auth-experience .auth-card .demo-grid,
    .auth-experience .auth-card .foot-note,
    .auth-experience .auth-card .auth-credit,
    .auth-experience .auth-form-wrap::before,
    .logout-bridge-bg::before,
    .logout-bridge-bg::after,
    .logout-bridge-grid,
    .logout-bridge-card,
    .logout-bridge-mark,
    .logout-bridge-rings span,
    .logout-bridge-dots i,
    .logout-bridge-bar > span {
        animation: none !important;
    }
    .auth-experience .auth-shell,
    .auth-experience .auth-brand,
    .auth-experience .auth-form-wrap,
    .auth-experience .auth-card,
    .logout-bridge-card {
        opacity: 1; transform: none; filter: none;
    }
    .auth-experience .auth-card::after { display: none; }
}
