/* ═══════════════════════════════════════════════════════════════
   Tableau Auth — Premium motion & scene choreography
   ═══════════════════════════════════════════════════════════════ */

@keyframes authShellReveal {
    from { opacity: 0; filter: blur(14px); }
    to { opacity: 1; filter: blur(0); }
}

@keyframes authBrandSlide {
    from { opacity: 0; transform: translateX(-36px) scale(0.97); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes authFormSlide {
    from { opacity: 0; transform: translateX(42px) scale(0.97); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes authCardLift {
    from {
        opacity: 0;
        transform: perspective(1200px) translateY(32px) rotateX(8deg) scale(0.96);
        box-shadow: 0 4px 28px rgba(15, 23, 42, 0.04);
    }
    to {
        opacity: 1;
        transform: perspective(1200px) translateY(0) rotateX(0) scale(1);
        box-shadow: 0 28px 64px rgba(18, 11, 8, 0.18);
    }
}

@keyframes authFieldRise {
    from { opacity: 0; transform: translateY(16px); }
    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.9; transform: scale(1.1) translate(3%, -2%); }
}

@keyframes sceneFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(0.4deg); }
}

@keyframes orbMotionA {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
    50% { transform: translate(-6%, 8%) scale(1.1) rotate(3deg); }
}

@keyframes orbMotionB {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
    50% { transform: translate(7%, -5%) scale(1.07) rotate(-2deg); }
}

/* Scene choreography */
@keyframes sceneWaiterSway {
    0%, 100% { transform: rotate(0deg) translateY(0); }
    50% { transform: rotate(-1.2deg) translateY(-2px); }
}

@keyframes sceneArmServe {
    0%, 100% { d: path("M228 134 Q252 146 264 160"); }
    50% { d: path("M228 134 Q258 152 272 168"); }
}

@keyframes scenePlateBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

@keyframes sceneTrayPulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.15); }
}

@keyframes sceneWheelSpin {
    to { transform: rotate(360deg); }
}

@keyframes sceneTicketFly {
    0%, 100% { transform: translate(0, 0) rotate(0deg); opacity: .85; }
    25% { transform: translate(-6px, -4px) rotate(-2deg); opacity: 1; }
    75% { transform: translate(4px, 2px) rotate(1deg); opacity: .9; }
}

@keyframes sceneSteamRise {
    0% { opacity: 0; transform: translateY(8px); }
    30% { opacity: .7; }
    100% { opacity: 0; transform: translateY(-18px); }
}

@keyframes sceneShadowBreath {
    0%, 100% { transform: scaleX(1); opacity: .7; }
    50% { transform: scaleX(1.06); opacity: 1; }
}

/* Entry animations */
.auth-experience .auth-shell {
    animation: authShellReveal 1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-experience .auth-brand {
    animation: authBrandSlide 1s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}

.auth-experience .auth-brand::before {
    animation: orbMotionA 16s ease-in-out infinite;
}

.auth-experience .auth-brand::after {
    animation: orbMotionB 20s ease-in-out infinite;
}

.auth-experience .auth-form-wrap {
    animation: authFormSlide 1s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
    position: relative;
}

.auth-experience .auth-form-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 50% at 75% 15%, rgba(214, 163, 79, 0.1), transparent 55%),
        radial-gradient(ellipse 55% 40% at 15% 85%, rgba(153, 90, 44, 0.07), transparent 50%);
    animation: authMeshShift 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

.auth-experience .auth-card {
    animation: authCardLift 1.05s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

.auth-experience .auth-card::after {
    content: '';
    position: absolute;
    inset: -40% -40%;
    width: 45%;
    background: linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0.2) 45%, rgba(255, 255, 255, 0.5) 50%, rgba(255, 255, 255, 0.2) 55%, transparent 100%);
    animation: authShimmer 1.5s cubic-bezier(0.4, 0, 0.2, 1) 0.7s forwards;
    pointer-events: none;
    z-index: 4;
}

.auth-experience .uk-service-badge,
.auth-experience .brand-top,
.auth-experience .tagline,
.auth-experience .service-ticker,
.auth-experience .scene,
.auth-experience .auth-card__header,
.auth-experience .auth-card form > .field,
.auth-experience .auth-card form > .row-between,
.auth-experience .auth-card form > .btn-signin,
.auth-experience .auth-card .foot-note,
.auth-experience .auth-card .auth-credit,
.auth-experience .auth-card > h2,
.auth-experience .auth-card > .sub,
.auth-experience .auth-card > .notice {
    animation: authFieldRise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-experience .uk-service-badge { animation-delay: 0.16s; }
.auth-experience .brand-top { animation-delay: 0.22s; }
.auth-experience .tagline { animation-delay: 0.3s; }
.auth-experience .service-ticker { animation-delay: 0.36s; }
.auth-experience .scene { animation-delay: 0.44s; }
.auth-experience .auth-card__header { animation-delay: 0.24s; }
.auth-experience .auth-card > h2 { animation-delay: 0.22s; }
.auth-experience .auth-card > .sub { animation-delay: 0.28s; }
.auth-experience .auth-card form > .field:nth-of-type(1) { animation-delay: 0.36s; }
.auth-experience .auth-card form > .field:nth-of-type(2) { animation-delay: 0.42s; }
.auth-experience .auth-card form > .row-between { animation-delay: 0.48s; }
.auth-experience .auth-card form > .btn-signin { animation-delay: 0.54s; }
.auth-experience .auth-card .foot-note { animation-delay: 0.6s; }
.auth-experience .auth-card .auth-credit { animation-delay: 0.66s; }

/* Living scene — subtle ambient only; story driven by auth-scene.css */
.auth-experience .scene-svg {
    animation: none;
}

.auth-experience .scene-glow {
    animation: sceneGlowPulse 5s ease-in-out infinite;
}

/* Button loading */
.auth-experience .btn-signin.is-loading {
    pointer-events: none;
    opacity: 0.95;
}

.auth-experience .btn-signin.is-loading .btn-signin__content {
    font-size: 0;
    gap: 0;
}

.auth-experience .btn-signin.is-loading .btn-signin__content i {
    display: none;
}

.auth-experience .btn-signin.is-loading .btn-signin__content::after {
    content: '';
    width: 1.4rem;
    height: 1.4rem;
    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;
}

.auth-experience .btn-signin.is-loading:not(:has(.btn-signin__content)) {
    font-size: 0;
}

.auth-experience .btn-signin.is-loading:not(:has(.btn-signin__content))::after {
    content: '';
    width: 1.4rem;
    height: 1.4rem;
    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;
}

@keyframes authSpin {
    to { transform: rotate(360deg); }
}

/* Exit transition */
.auth-experience.auth-leaving .auth-shell {
    opacity: 0;
    transform: scale(0.98) translateY(-8px);
    filter: blur(6px);
    transition: opacity 0.45s ease, transform 0.45s ease, filter 0.45s ease;
}

/* ═══════════════════════════════════════════════════════════════
   Logout bridge (unchanged behaviour, refined motion)
   ═══════════════════════════════════════════════════════════════ */

.logout-bridge-body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Outfit', system-ui, sans-serif;
    color: #fff;
    overflow: hidden;
    background: #050d1f;
}

.logout-bridge-bg {
    position: fixed;
    inset: 0;
    background: linear-gradient(155deg, #030a18 0%, #0c1f4d 42%, #0a4a5c 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(56, 189, 248, 0.35) 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(129, 140, 248, 0.28) 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.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    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.4; }
    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: 420px;
    animation: lbContentIn 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.logout-bridge-mark {
    width: 88px;
    height: 88px;
    margin: 0 auto 1.5rem;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.35rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    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(125, 211, 252, 0.65);
    border-right-color: rgba(165, 180, 252, 0.35);
    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.5);
}

.logout-bridge-rings span:nth-child(3) {
    inset: 16px;
    animation-duration: 3.1s;
    border-top-color: rgba(56, 189, 248, 0.4);
}

@keyframes lbRing {
    to { transform: rotate(360deg); }
}

.logout-bridge-title {
    font-size: clamp(1.35rem, 4vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0 0 0.5rem;
    background: linear-gradient(120deg, #fff 0%, #bae6fd 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.78);
    line-height: 1.5;
}

.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, #7dd3fc, #a5b4fc);
    animation: lbDot 1.1s ease-in-out infinite both;
    box-shadow: 0 0 12px rgba(125, 211, 252, 0.6);
}

.logout-bridge-dots i:nth-child(2) { animation-delay: 0.15s; }
.logout-bridge-dots i:nth-child(3) { animation-delay: 0.3s; }

@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, #38bdf8, #818cf8, #c084fc);
    animation: lbBar 1.15s ease-in-out infinite;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.55);
}

@keyframes lbBar {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(380%); }
}

@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-card__sheen::after,
    .auth-experience .uk-service-badge,
    .auth-experience .brand-top,
    .auth-experience .brand-logo,
    .auth-experience .tagline,
    .auth-experience .service-ticker,
    .auth-experience .scene,
    .auth-experience .scene-glow,
    .auth-experience .auth-aurora,
    .auth-experience .auth-form-ambient,
    .auth-experience .auth-card__header,
    .auth-experience .auth-title__char,
    .auth-experience .auth-card > h2,
    .auth-experience .auth-card > .sub,
    .auth-experience .auth-card form > .field,
    .auth-experience .auth-card form > .row-between,
    .auth-experience .auth-card form > .btn-signin,
    .auth-experience .auth-card .foot-note,
    .auth-experience .auth-card .auth-credit,
    .auth-experience .auth-form-wrap::before,
    .auth-experience .uk-service-badge__dot,
    .auth-experience .btn-signin__shine,
    .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-card::after {
        display: none;
    }

    .auth-experience .auth-card {
        transform: none !important;
    }
}
