/* Login success / spinner overlay. Moved verbatim from Login.razor inline <style>.
   Scoped to .login-success-* / .success-* / .login-spinner* so it is inert on other pages. */

/* ============ POST-LOGIN SUCCESS OVERLAY ============ */
/* Full-screen blurred backdrop with a centered card containing an animated
   checkmark, welcome text and a progress bar. Designed to play for ~1.4s
   before the hard redirect kicks in. */
.login-success-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-out;
}

.login-success-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px 56px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    text-align: center;
    min-width: 320px;
    animation: cardPopIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.success-title {
    margin: 18px 0 4px;
    font-size: 22px;
    font-weight: 600;
    color: #0f172a;
    opacity: 0;
    animation: textFadeIn 0.4s ease-out 0.5s forwards;
}

.success-subtitle {
    margin: 0 0 18px;
    font-size: 14px;
    color: #64748b;
    opacity: 0;
    animation: textFadeIn 0.4s ease-out 0.7s forwards;
}

.success-progress {
    width: 100%;
    height: 3px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
}

.success-progress__bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 2px;
    animation: progressFill 1.4s ease-out forwards;
}

/* Animated checkmark — circle draws first, then check path strokes in. */
.success-checkmark {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: block;
    margin: 0 auto;
    stroke-width: 3;
    stroke: #fff;
    stroke-miterlimit: 10;
    box-shadow: inset 0 0 0 #10b981;
    animation: checkmarkFill 0.4s ease-in-out 0.4s forwards,
               checkmarkScale 0.3s ease-in-out 0.9s both;
}

.success-checkmark__circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 3;
    stroke-miterlimit: 10;
    stroke: #10b981;
    fill: none;
    animation: strokeCircle 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.success-checkmark__check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: strokeCheck 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

@keyframes strokeCircle {
    100% { stroke-dashoffset: 0; }
}

@keyframes strokeCheck {
    100% { stroke-dashoffset: 0; }
}

@keyframes checkmarkFill {
    100% { box-shadow: inset 0 0 0 36px #10b981; }
}

@keyframes checkmarkScale {
    0%, 100% { transform: none; }
    50% { transform: scale3d(1.1, 1.1, 1); }
}

@keyframes cardPopIn {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes textFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes progressFill {
    from { width: 0; }
    to { width: 100%; }
}

/* Dual-ring spinner shown while a login API call is in flight. */
.login-spinner {
    position: relative;
    width: 72px;
    height: 72px;
    margin: 0 auto;
}

.login-spinner__ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: #10b981;
    border-right-color: #10b981;
    animation: spinnerRotate 1s linear infinite;
}

.login-spinner__ring--alt {
    inset: 10px;
    border-top-color: transparent;
    border-right-color: transparent;
    border-bottom-color: #6366f1;
    border-left-color: #6366f1;
    animation-direction: reverse;
    animation-duration: 1.4s;
}

@keyframes spinnerRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
