/**
 * Login Background - Modern Animated Gradient
 * HD Services - Hemodynamics Invoice System
 *
 * Professional animated gradient background for login and authentication pages
 * Uses system color palette from tailwind.config.js
 */

/* Main login container with animated gradient - GitHub inspired */
#front {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    overflow: hidden;
    background: linear-gradient(165deg,
        #0d1117 0%,      /* GitHub dark navy - top */
        #161b22 20%,     /* GitHub dark blue */
        #1f2937 35%,     /* Deep slate */
        #7c3aed 70%,     /* Purple glow */
        #ec4899 85%,     /* Pink accent */
        #c084fc 100%     /* Light purple */
    );
    background-size: 300% 300%;
    animation: gradientShift 25s ease infinite;
}

/* Animated gradient keyframes */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    25% {
        background-position: 50% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    75% {
        background-position: 50% 100%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Geometric shapes overlay for depth - Purple/Pink glow like GitHub */
#front::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.3) 0%, rgba(236, 72, 153, 0.15) 40%, transparent 70%);
    border-radius: 50%;
    animation: float 25s ease-in-out infinite;
    filter: blur(60px);
}

#front::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 70%;
    height: 70%;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.25) 0%, rgba(192, 132, 252, 0.12) 40%, transparent 70%);
    border-radius: 50%;
    animation: float 30s ease-in-out infinite reverse;
    filter: blur(60px);
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

/* Enhanced form container with glassmorphism effect */
#form-login {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 28rem;
}

#form-login > div {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 1rem;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.15),
        0 10px 20px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Additional decorative elements - GitHub purple/pink theme */
.login-shape-1 {
    position: absolute;
    top: 10%;
    left: 5%;
    width: 150px;
    height: 150px;
    background: linear-gradient(45deg, rgba(124, 58, 237, 0.25), rgba(236, 72, 153, 0.2));
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation: morphing 15s ease-in-out infinite;
    z-index: 1;
    filter: blur(40px);
}

.login-shape-2 {
    position: absolute;
    bottom: 15%;
    right: 8%;
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.2), rgba(192, 132, 252, 0.18));
    border-radius: 63% 37% 54% 46% / 55% 48% 52% 45%;
    animation: morphing 18s ease-in-out infinite reverse;
    z-index: 1;
    filter: blur(40px);
}

@keyframes morphing {
    0%, 100% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
        transform: rotate(0deg);
    }
    25% {
        border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%;
        transform: rotate(90deg);
    }
    50% {
        border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%;
        transform: rotate(180deg);
    }
    75% {
        border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%;
        transform: rotate(270deg);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #front {
        padding: 1rem 0.75rem;
    }

    #form-login > div {
        padding: 1.5rem;
    }

    /* Reduce animation complexity on mobile for performance */
    #front {
        animation-duration: 30s;
    }

    .login-shape-1,
    .login-shape-2 {
        display: none; /* Hide decorative shapes on mobile */
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    #front,
    #front::before,
    #front::after,
    .login-shape-1,
    .login-shape-2 {
        animation: none;
    }

    #front {
        background: linear-gradient(165deg, #0d1117 0%, #1f2937 40%, #7c3aed 80%, #ec4899 100%);
        background-size: 100% 100%;
    }
}

/* Print styles - simple background for printing */
@media print {
    #front {
        background: white;
        animation: none;
    }

    #front::before,
    #front::after,
    .login-shape-1,
    .login-shape-2 {
        display: none;
    }
}
