/**
 * Library Login Background & Light Glassmorphic Interface
 */

/* Setup clean light container styling */
body {
    background: #f1f5f9 !important; /* Soft light slate background */
}

.auth-page-wrapper {
    position: relative;
    background: transparent !important; /* Make wrapper transparent to reveal fixed canvas */
    overflow: hidden !important;
}

/* Background Canvas for Blobs */
#login-bg-canvas {
    position: fixed; /* Fixed to viewport to span the entire screen background */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1; /* Placed behind all content */
    pointer-events: none; /* Let clicks pass through to inputs */
}

/* Remove default theme dark overlays */
.auth-page-wrapper .bg-overlay {
    background: transparent !important;
    display: none !important;
}

/* Content Container above background */
.auth-page-content {
    position: relative;
    z-index: 3;
    width: 100%;
}

/* Light Glassmorphic Login Card */
.auth-page-content .card {
    background: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    border-radius: 20px !important;
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.06) !important;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.5s ease, border-color 0.3s ease !important;
}

/* Form labels and texts */
.auth-page-content .card .form-label {
    color: #334155 !important; /* Slate 700 */
    font-weight: 600;
    letter-spacing: 0.2px;
    font-size: 0.85rem;
}

.auth-page-content .card .text-muted, 
.auth-page-content .card a.text-muted {
    color: #64748b !important; /* Slate 500 */
    transition: color 0.2s ease;
    font-weight: 500;
}

.auth-page-content .card a.text-muted:hover {
    color: #2563eb !important; /* Primary Royal Blue */
    text-decoration: underline !important;
}

/* Inputs styling */
.auth-page-content .card input.form-control {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important; /* Slate 300 */
    color: #0f172a !important; /* Slate 900 */
    border-radius: 10px !important;
    padding: 10px 14px !important;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease !important;
}

.auth-page-content .card input.form-control::placeholder {
    color: #94a3b8 !important; /* Slate 400 */
}

.auth-page-content .card input.form-control:focus {
    background: #ffffff !important;
    border-color: #2563eb !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15) !important;
}

/* Button enhancements */
.auth-page-content .card .btn-success {
    background-color: #2563eb !important; /* Royal Blue */
    border-color: #2563eb !important;
    font-weight: 600;
    border-radius: 10px !important;
    padding: 10px 20px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2) !important;
}

.auth-page-content .card .btn-success:hover {
    background-color: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(37, 99, 235, 0.3) !important;
}

.auth-page-content .card .btn-success:active {
    transform: translateY(0);
}

.auth-page-content .card .password-addon {
    color: #64748b !important;
}

.auth-page-content .card .password-addon:hover {
    color: #0f172a !important;
}

/* Custom error message */
.login-error-alert {
    background: #fef2f2 !important; /* Red 50 */
    border: 1px solid #fca5a5 !important; /* Red 300 */
    color: #991b1b !important; /* Red 800 */
    font-size: 0.85rem;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    display: none;
    align-items: center;
    gap: 8px;
    animation: slideDownAlert 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Animation states for Card */
.card-shake {
    animation: cardShakeAnimation 0.5s cubic-bezier(.36,.07,.19,.97) both;
    border-color: #f87171 !important;
}

.card-success-fade {
    opacity: 0 !important;
    transform: scale(0.95) translateY(5px) !important;
    pointer-events: none;
}

/* Loading spinner in button */
.btn-loading-text {
    visibility: hidden;
    opacity: 0;
}

.btn-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spinButton 0.6s linear infinite;
}

/* Screen transition effect on login success */
#login-screen-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: #ffffff;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease-in-out;
}

#login-screen-flash.active {
    opacity: 1;
}

/* Keyframes */
@keyframes cardShakeAnimation {
    10%, 90% { transform: translate3d(-2px, 0, 0); }
    20%, 80% { transform: translate3d(4px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
    40%, 60% { transform: translate3d(6px, 0, 0); }
}

@keyframes slideDownAlert {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spinButton {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}
