/**
 * Professional Login Page Enhancement CSS
 * Version: 2.0.0
 * Description: Modern, professional login page styling with enhanced UX
 */

/* ============================================
   LOGIN PAGE SPECIFIC STYLES
   ============================================ */

/* Login Page Body */
.login-page {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Enhanced Animated Background Pattern */
.login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(74, 144, 226, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(56, 103, 214, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 50% 10%, rgba(74, 144, 226, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 10% 90%, rgba(56, 103, 214, 0.06) 0%, transparent 50%);
    animation: backgroundMove 25s ease-in-out infinite;
}

.login-page::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.02)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.02)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.03)"/><circle cx="10" cy="60" r="0.5" fill="rgba(255,255,255,0.03)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

@keyframes backgroundMove {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(30px, -20px) rotate(1deg);
    }
    66% {
        transform: translate(-20px, 30px) rotate(-1deg);
    }
}

/* Login Box Container */
.login-box {
    width: 100%;
    max-width: 450px;
    margin: 2rem auto;
    position: relative;
    z-index: 10;
    padding: 0 1rem;
}

/* Login Logo */
.login-logo {
    margin-bottom: 2.5rem;
    text-align: center;
    animation: fadeInDown 0.8s ease-out;
}

.login-logo a {
    color: #2c3e50;
    font-size: 2.2rem;
    font-weight: 800;
    text-decoration: none;
    text-shadow: 0 2px 10px rgba(44, 62, 80, 0.2);
    letter-spacing: 2px;
    transition: all 0.4s ease;
    display: inline-block;
}

.login-logo a:hover {
    transform: scale(1.05) translateY(-2px);
    text-shadow: 0 4px 15px rgba(44, 62, 80, 0.3);
    color: #34495e;
    text-decoration: none;
}

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

/* Login Card */
.login-page .card {
    border: none;
    border-radius: 20px;
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.98);
    animation: slideUp 0.8s ease-out;
    position: relative;
}

.login-page .card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4a90e2 0%, #3867d6 100%);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Login Card Body */
.login-card-body {
    padding: 3rem 2.5rem;
    position: relative;
}

/* Enhanced Input Groups */
.login-card-body .input-group {
    margin-bottom: 1.75rem;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    background: #ffffff;
}

.login-card-body .input-group:hover {
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.15);
}

.login-card-body .input-group.focused {
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.25);
    transform: translateY(-3px);
}

.login-card-body .input-group-text {
    background: linear-gradient(135deg, #4a90e2 0%, #3867d6 100%);
    border: none;
    color: #ffffff;
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card-body .input-group.focused .input-group-text {
    background: linear-gradient(135deg, #357abd 0%, #2f5bb7 100%);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.login-card-body .form-control {
    border: none;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    background: #ffffff;
    transition: all 0.3s ease;
    color: #2c3e50;
    font-weight: 500;
}

.login-card-body .form-control:focus {
    box-shadow: none;
    background: #ffffff;
    color: #2c3e50;
}

.login-card-body .form-control::placeholder {
    color: #a0a0a0;
    font-weight: 400;
}

/* Enhanced Form Elements */
.form-check {
    padding-left: 22px;
    display: flex;
    align-items: center;
}

.form-check-input {
    width: 1.2rem;
    height: 1.2rem;
    margin-right: 0.75rem;
    margin-top: 0;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.form-check-input:checked {
    background-color: #4a90e2;
    border-color: #4a90e2;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(74, 144, 226, 0.25);
}

.form-check-label {
    font-size: 0.95rem;
    color: #6c757d;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    margin-bottom: 0;
    line-height: 1.2;
}

/* Enhanced Button Styles */
.btn-login {
    background: linear-gradient(135deg, #4a90e2 0%, #3867d6 100%);
    border: none;
    padding: 1rem 2rem;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:hover {
    background: linear-gradient(135deg, #357abd 0%, #2f5bb7 100%);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.5);
    transform: translateY(-3px);
}

.btn-login:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.4);
}

.btn-login:disabled {
    opacity: 0.8;
    cursor: not-allowed;
    transform: none;
}

/* Password Toggle Button */
.password-toggle {
    background: transparent;
    border: none;
    color: #6c757d;
    padding: 1rem;
    transition: all 0.3s ease;
    border-radius: 0;
}

.password-toggle:hover {
    background: rgba(74, 144, 226, 0.1);
    color: #4a90e2;
}

.password-toggle:focus {
    box-shadow: none;
    outline: none;
}

/* Error Messages */
.invalid-feedback {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: #e74c3c;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 6px;
    border-left: 3px solid #e74c3c;
}

.form-control.is-invalid {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.05);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 0.2rem rgba(231, 76, 60, 0.15);
}

/* Links */
.forgot-password-link {
    color: #4a90e2;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.forgot-password-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background: linear-gradient(90deg, #4a90e2, #3867d6);
    transition: width 0.3s ease;
}

.forgot-password-link:hover::after {
    width: 100%;
}

.forgot-password-link:hover {
    color: #3867d6;
    text-decoration: none;
}

/* Security Notice */
.security-notice {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1) 0%, rgba(56, 103, 214, 0.1) 100%);
    border: 1px solid rgba(74, 144, 226, 0.2);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.security-notice small {
    color: #4a90e2;
    font-weight: 600;
}

/* Loading States */
.btn-loading {
    opacity: 0.8;
}

.fa-spinner {
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .login-box {
        max-width: 95%;
        margin: 1rem auto;
    }
    
    .login-card-body {
        padding: 2.5rem 2rem;
    }
    
    .login-logo a {
        font-size: 2rem;
        letter-spacing: 1px;
    }
}

@media (max-width: 576px) {
    .login-card-body {
        padding: 2rem 1.5rem;
    }
    
    .login-logo a {
        font-size: 1.8rem;
    }
    
    .login-card-body .input-group {
        margin-bottom: 1.5rem;
    }
    
    .login-card-body .form-control,
    .login-card-body .input-group-text {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }
    
    .btn-login {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 400px) {
    .login-card-body {
        padding: 1.5rem 1rem;
    }
    
    .login-box {
        padding: 0 0.5rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .login-page {
        background: #000000;
    }
    
    .login-page .card {
        background: #ffffff;
        border: 2px solid #000000;
    }
    
    .login-card-body .input-group-text {
        background: #000000;
        color: #ffffff;
    }
    
    .btn-login {
        background: #000000;
        color: #ffffff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .login-page::before,
    .login-logo,
    .card,
    .btn-login::before {
        animation: none;
    }
    
    .login-card-body .input-group,
    .btn-login,
    .forgot-password-link::after {
        transition: none;
    }
}

/* Print styles */
@media print {
    .login-page {
        background: #ffffff;
    }
    
    .login-page::before,
    .login-page::after {
        display: none;
    }
    
    .login-box .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
    
    .security-notice {
        display: none;
    }
}

/* Focus visible for better accessibility */
*:focus-visible {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(74, 144, 226, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(74, 144, 226, 0.5);
}
