/* ===== LOGIN PAGE STYLES ===== */

/* Background and Layout */
.login-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: -2;
}

.login-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    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.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="10" cy="50" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="90" cy="30" r="0.5" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.login-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

/* Floating Shapes Animation */
.floating-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.shape {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 20s infinite linear;
}

.shape-1 {
    width: 80px;
    height: 80px;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 60px;
    height: 60px;
    left: 20%;
    animation-delay: 2s;
}

.shape-3 {
    width: 100px;
    height: 100px;
    left: 70%;
    animation-delay: 4s;
}

.shape-4 {
    width: 40px;
    height: 40px;
    left: 80%;
    animation-delay: 6s;
}

.shape-5 {
    width: 120px;
    height: 120px;
    left: 50%;
    animation-delay: 8s;
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* Logo and Title */
.login-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    background: linear-gradient(135deg, #fff, #f8f9fa);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: logoFloat 3s ease-in-out infinite;
}

.login-logo i {
    font-size: 2rem;
    color: #667eea;
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.login-title {
    color: #fff;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

/* Login Card */
.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
}

.login-card::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;
}

.login-card:hover::before {
    left: 100%;
}

.login-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* Form Inputs */
.form-floating {
    position: relative;
    margin-bottom: 1rem;
}

.form-floating.focused label {
    color: #667eea;
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
}

.login-input {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1rem 1rem 1rem 3rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.login-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
}

.login-input.is-valid {
    border-color: #28a745;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='m2.3 6.73.94-.94 1.44 1.44L7.4 4.5l.94.94L4.66 9.17z'/%3e%3c/svg%3e");
}

.login-input.is-invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 4.6 2.4 2.4M8.2 4.6l-2.4 2.4'/%3e%3c/svg%3e");
}

.form-floating > label {
    padding-left: 3rem;
    color: #6c757d;
    transition: all 0.3s ease;
}

.form-floating > label i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    transition: color 0.3s ease;
}

.form-floating.focused > label i {
    color: #667eea;
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 10;
}

.password-toggle:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

/* Remember Me Checkbox */
.form-check-input {
    border-radius: 6px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-check-label {
    color: #495057;
    font-weight: 500;
    cursor: pointer;
}

/* Login Button */
.login-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.login-btn::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;
}

.login-btn:hover::before {
    left: 100%;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn.loading {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    cursor: not-allowed;
}

.login-btn.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    animation: successPulse 0.6s ease;
}

@keyframes successPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Demo Accounts */
.demo-accounts {
    border-top: 1px solid #e9ecef;
    padding-top: 1rem;
    margin-top: 1rem;
}

.demo-accounts-list {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1rem;
    margin-top: 0.5rem;
}

.demo-account {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.demo-account:last-child {
    margin-bottom: 0;
}

.demo-account:hover {
    background: #667eea;
    color: white;
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.demo-account:hover .badge {
    background-color: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
}

.demo-account small {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
}

/* Animations */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* Alert Improvements */
.alert {
    border-radius: 12px;
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-info {
    background: linear-gradient(135deg, #17a2b8, #20c997);
    color: white;
}

.alert-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.alert-danger {
    background: linear-gradient(135deg, #dc3545, #e83e8c);
    color: white;
}

.alert-warning {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    color: #212529;
}



/* Responsive Design */
@media (max-width: 576px) {
    .login-logo {
        width: 60px;
        height: 60px;
    }
    
    .login-logo i {
        font-size: 1.5rem;
    }
    
    .login-title {
        font-size: 1.5rem;
    }
    
    .login-subtitle {
        font-size: 0.9rem;
    }
    
    .login-card {
        margin: 1rem;
        border-radius: 15px;
    }
    
    .login-input {
        padding: 0.875rem 0.875rem 0.875rem 2.5rem;
    }
    
    .form-floating > label {
        padding-left: 2.5rem;
    }
    
    .form-floating > label i {
        left: 0.875rem;
    }
    
    .shape {
        display: none;
    }
}

@media (max-width: 768px) {
    .login-container {
        padding: 1rem 0;
    }
    
    .floating-shapes .shape {
        opacity: 0.5;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .login-card {
        border: 3px solid #000;
        background: #fff;
    }
    
    .login-input {
        border: 2px solid #000;
    }
    
    .login-btn {
        background: #000;
        border: 2px solid #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .shape,
    .login-logo,
    .login-card,
    .login-input,
    .login-btn,
    .demo-account {
        animation: none !important;
        transition: none !important;
    }
    
    .login-card:hover,
    .login-btn:hover,
    .demo-account:hover {
        transform: none !important;
    }
}

/* Print Styles */
@media print {
    .login-background,
    .floating-shapes,
    .demo-accounts {
        display: none !important;
    }
    
    .login-card {
        background: white !important;
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }
}