/* Login Help Text */
.login-help-text {
    margin-top: 1.5rem;
    text-align: center;
    animation: fadeIn 1s ease-out 1.3s both;
}

.login-help-text small {
    color: #94a3b8;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.login-help-text a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.login-help-text a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #2563eb;
    transition: width 0.3s ease;
}

.login-help-text a:hover {
    color: #1d4ed8;
    text-shadow: 0 0 5px rgba(37, 99, 235, 0.3);
}

.login-help-text a:hover::after {
    width: 100%;
}

/* Login Page Styles */
/* Override base.html main container styles for login page */
body.login-page main {
    padding-top: 0 !important;
    margin-top: 0 !important;
    height: 100vh;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Login page body class */
body.login-page {
    background-color: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Login Page Main Container */
.login-page-container {
    width: 100%;
    height: 100vh;
    display: flex;
    overflow: hidden;
    position: relative;
}

/* Animated background circles for left section */
.login-brand-section {
    width: 60%;
    height: 100%;
    background: rgba(255, 255, 255, 0.4);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4rem 3rem;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

/* Animated circles */
.login-brand-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(79, 70, 229, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 40% 60%, rgba(37, 99, 235, 0.05) 0%, transparent 50%);
    animation: backgroundFloat 20s ease-in-out infinite;
    z-index: -1;
}

/* Floating animation for background circles */
@keyframes backgroundFloat {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(10%, -10%) rotate(1deg);
    }
    50% {
        transform: translate(-5%, 5%) rotate(0deg);
    }
    75% {
        transform: translate(-10%, 10%) rotate(-1deg);
    }
}

/* Center content vertically and horizontally */
.login-brand-center {
    text-align: center;
    max-width: 600px;
    animation: fadeInUp 1s ease-out 0.3s both;
}

/* Fade in up animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* System Title with typing animation */
.login-system-title {
    font-size: 4.5rem;
    font-weight: 800;
    color: #2563eb;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    letter-spacing: 0.05em;
    text-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
    animation: fadeIn 1s ease-out 0.5s both, titlePulse 3s ease-in-out infinite;
    position: relative;
    display: inline-block;
}

/* Title pulse animation */
@keyframes titlePulse {
    0%, 100% {
        text-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
    }
    50% {
        text-shadow: 0 4px 20px rgba(37, 99, 235, 0.5), 0 0 30px rgba(37, 99, 235, 0.3);
    }
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* System Description */
.login-system-description {
    font-size: 1.25rem;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 2rem;
    font-weight: 500;
    max-width: 500px;
    margin: 0 auto;
    animation: fadeIn 1s ease-out 0.7s both;
}

/* Form Section - Right Side */
.login-form-section {
    width: 40%;
    height: 100%;
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

/* Animated particles for right section */
.login-form-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px, 30px 30px;
    background-position: 0 0, 25px 25px;
    animation: particleFloat 15s linear infinite;
    z-index: -1;
}

/* Particle float animation */
@keyframes particleFloat {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(-50px, -50px);
    }
}

/* Form Container */
.login-form-container {
    width: 100%;
    max-width: 400px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    padding: 2.5rem;
    text-align: center;
    animation: fadeInRight 1s ease-out 0.5s both, formHover 20s ease-in-out infinite;
    position: relative;
}

/* Form hover animation */
@keyframes formHover {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-2px) rotate(0.5deg);
    }
    50% {
        transform: translateY(0) rotate(0deg);
    }
    75% {
        transform: translateY(2px) rotate(-0.5deg);
    }
}

/* Fade in right animation */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Form Title */
.login-form-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 2rem;
    text-align: center;
    animation: fadeIn 1s ease-out 0.7s both;
}

/* Form Group */
.login-form .form-group {
    margin-bottom: 1.5rem;
    text-align: left;
    animation: fadeIn 1s ease-out 0.9s both;
}

/* Input Group */
.login-form .input-group {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideInUp 0.5s ease-out 1s both;
}

/* Slide in up animation */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-form .input-group:hover,
.login-form .input-group:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.2);
}

/* Input icon animation */
.login-form .input-group-prepend {
    background-color: transparent;
    border: none;
    padding: 0.75rem 1rem;
    color: #64748b;
    transition: all 0.3s ease;
    animation: fadeIn 1s ease-out 1.1s both;
}

.login-form .input-group:focus-within .input-group-prepend {
    color: #2563eb;
    transform: scale(1.1);
}

.login-form .input-group-text {
    background-color: transparent;
    border: none;
    color: inherit;
    padding: 0;
    margin: 0;
}

/* Form Control */
.login-form .form-control {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 0;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: transparent;
    color: #334155;
}

.login-form .form-control:focus {
    outline: none;
    box-shadow: none;
    border-color: transparent;
    background-color: transparent;
}

.login-form .form-control::placeholder {
    color: #94a3b8;
    transition: all 0.3s ease;
}

.login-form .input-group:focus-within .form-control::placeholder {
    color: #cbd5e1;
    transform: translateX(5px);
}

/* Submit Button */
.login-submit-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    border: none;
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 1rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 1s ease-out 1.2s both, btnPulse 2s ease-in-out infinite;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

/* Button pulse animation */
@keyframes btnPulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
    }
    50% {
        box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5), 0 0 30px rgba(37, 99, 235, 0.3);
    }
}

/* Button hover effect */
.login-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4), 0 0 40px rgba(37, 99, 235, 0.2);
    background: linear-gradient(135deg, #1d4ed8 0%, #4338ca 100%);
}

/* Button click effect */
.login-submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

/* Button ripple effect */
.login-submit-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.login-submit-btn:active::before {
    width: 300px;
    height: 300px;
}

.login-submit-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

/* Responsive Design */
@media (max-width: 992px) {
    /* Stack sections on tablet */
    .login-page-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    
    .login-brand-section,
    .login-form-section {
        width: 100%;
        height: auto;
    }
    
    .login-brand-section {
        padding: 3rem 2rem;
        min-height: 50vh;
    }
    
    .login-form-section {
        padding: 3rem 2rem;
    }
    
    .login-brand-center {
        padding: 0;
    }
    
    .login-system-title {
        font-size: 3rem;
    }
    
    .login-system-description {
        font-size: 1.125rem;
    }
    
    .login-form-container {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    /* Mobile responsive */
    .login-brand-section {
        padding: 2rem 1.5rem;
        min-height: 40vh;
    }
    
    .login-system-title {
        font-size: 2.5rem;
    }
    
    .login-system-description {
        font-size: 1rem;
    }
    
    .login-form-container {
        padding: 2rem 1.5rem;
    }
}
