/* ==========================================================================
   Mr. Splash on the Sign-in Page (Login Concept B)
   Three layers, so moves never fight:
   .ms-login__stage enters once, .ms-login__fig carries the motion, 
   the images cross-fade smoothly.
   ========================================================================== */

.ms-login {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-right: 48px;
    user-select: none;
    z-index: 15;
}

.ms-login__stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ms-login__bubble {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 10px 25px -5px rgba(11, 26, 56, 0.12), 0 0 0 1px rgba(2, 132, 199, 0.08);
    border-radius: 16px;
    padding: 12px 18px;
    max-width: 280px;
    text-align: center;
    margin-bottom: 12px;
    position: relative;
    transition: opacity .12s ease, transform .16s ease-out;
}

.ms-login__bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px 8px 0;
    border-style: solid;
    border-color: #ffffff transparent;
    display: block;
    width: 0;
}

.ms-login__title {
    font-family: 'Montserrat', sans-serif;
    font-size: 14.5px;
    font-weight: 700;
    color: #0b1a38;
    margin: 0 0 3px 0;
}

.ms-login__text {
    font-size: 12px;
    color: #64748b;
    margin: 0;
    line-height: 1.35;
}

.ms-login__fig {
    position: relative;
    width: 380px;
    max-width: 440px;
    aspect-ratio: 1 / 1;
    transform-origin: 50% 97%;
}

.ms-login__fig img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transform: scale(.94);
    transform-origin: 50% 97%;
    transition: opacity .18s ease-out, transform .24s cubic-bezier(.34, 1.56, .64, 1);
}

.ms-login__fig img.is-on {
    opacity: 1;
    transform: none;
}

.ms-login__bubble.is-swapping {
    opacity: 0;
    transform: translateY(4px);
}

.ms-login__live {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Entrance: once per page load */
.ms-login--intro .ms-login__stage {
    animation: ms-rise .45s ease-out both;
}

.ms-login--intro .ms-login__bubble {
    animation: ms-fade .3s ease-out .15s both;
}

/* Per-state motion */
.ms-m-bob {
    animation: ms-bob 3s ease-in-out infinite;
}

.ms-m-nudge {
    animation: ms-nudge 1.4s ease-in-out infinite;
}

.ms-m-pop {
    animation: ms-pop .6s ease-out 1;
}

.ms-m-sway {
    animation: ms-sway 1.6s ease-in-out 2;
}

@keyframes ms-rise {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes ms-fade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes ms-bob {

    0%,
    100% {
        transform: translateY(0) rotate(-0.5deg);
    }

    50% {
        transform: translateY(-8px) rotate(0.5deg);
    }
}

@keyframes ms-nudge {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(8px);
    }
}

@keyframes ms-pop {
    0% {
        transform: scale(.9);
    }

    55% {
        transform: scale(1.06);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes ms-sway {

    0%,
    100% {
        transform: rotate(0);
    }

    25% {
        transform: rotate(-3deg);
    }

    75% {
        transform: rotate(3deg);
    }
}

/* Mobile & Tablet Responsive */
@media (max-width: 1024px) {
    .splash-login-stage {
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
    }

    .ms-login {
        margin-right: 0 !important;
        margin-bottom: 20px !important;
    }

    .ms-login__fig {
        width: 240px !important;
        max-width: 240px !important;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {

    .ms-login *,
    .ms-login *::before,
    .ms-login *::after {
        animation: none !important;
        transition: none !important;
    }
}