/**
 * Login Page Styles
 * Comprehensive styling for the authentication interface
 */

/* General Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: url('/assets/images/bg.jpg');
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    padding: 0;
}

/* Login Card */
.login-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Left Panel - Login Form */
.login-panel {
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 600px;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header .logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 10px 30px rgba(202, 119, 59, 0.3);
}

.login-header .logo i {
    font-size: 2rem;
    color: white;
}

.login-header h1 {
    color: #2d3748;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-header p {
    color: #718096;
    font-size: 1rem;
    margin: 0;
}

/* Form Styles */
.login-form {
    width: 100%;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
    display: block;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f7fafc;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(202, 119, 59, 0.1);
}

.form-control.is-valid {
    border-color: #48bb78;
    background: #f0fff4;
}

.form-control.is-invalid {
    border-color: #f56565;
    background: #fff5f5;
}

.invalid-feedback {
    color: #f56565;
    font-size: 0.875rem;
    margin-top: 4px;
    display: block;
}

/* Password Field */
.password-field {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #718096;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: #2d3748;
}

/* Remember Me */
.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.form-check-input {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    accent-color: var(--primary-color);
}

.form-check-label {
    color: #4a5568;
    font-size: 0.9rem;
    cursor: pointer;
}

/* Login Button */
.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-login:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(202, 119, 59, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
    border: none !important;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-dark) 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(202, 119, 59, 0.3);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    display: none;
}

.btn-loading .spinner-border {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

/* Forgot Password */
.forgot-password {
    text-align: center;
    margin-top: 20px;
}

.forgot-password a {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.forgot-password a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Right Panel - Demo Credentials */
.demo-panel {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 600px;
}

.demo-header {
    text-align: center;
    margin-bottom: 40px;
}

.demo-header h2 {
    color: #2d3748;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.demo-header p {
    color: #718096;
    font-size: 0.9rem;
    margin: 0;
}

/* Demo Cards */
.demo-credentials {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.demo-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.demo-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.demo-card.selected {
    border-color: #667eea;
    background: #f0f4ff;
}

.demo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.demo-card:hover::before,
.demo-card.selected::before {
    opacity: 1;
}

.demo-role {
    font-weight: 700;
    color: #2d3748;
    font-size: 1rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.demo-role i {
    margin-right: 8px;
    width: 20px;
    color: var(--primary-color);
}

.demo-credentials-text {
    font-size: 0.85rem;
    color: #718096;
    line-height: 1.4;
}

.demo-email {
    font-family: 'Courier New', monospace;
    background: #f7fafc;
    padding: 2px 6px;
    border-radius: 4px;
    margin: 4px 0;
}

/* Alert Styles */
.alert {
    border-radius: 12px;
    border: none;
    padding: 16px 20px;
    margin-bottom: 24px;
    font-size: 0.9rem;
}

.alert-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.alert-danger {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
}

.alert-info {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
}

.alert-warning {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
}

.alert .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.alert .btn-close:hover {
    opacity: 1;
}

/* Additional Enhancements */
.logo-container {
    animation: fadeInUp 0.8s ease-out;
}

.login-card {
    animation: fadeInScale 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.demo-credentials {
    background: rgba(248, 250, 252, 0.8);
    border-radius: 16px;
    padding: 24px;
    margin-top: 32px;
    border: 1px solid rgba(226, 232, 240, 0.5);
}

.demo-card {
    background: white;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.demo-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(202, 119, 59, 0.15);
    border-color: var(--primary-light);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .login-container {
        padding: 0;
    }
    
    .login-card {
        border-radius: 20px;
        padding: 30px 24px;
        margin: 10px 0;
    }
    
    .demo-credentials {
        padding: 20px;
        margin-top: 24px;
    }
    
    .demo-card {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .login-header h1 {
        font-size: 1.75rem;
    }
    
    .demo-header h2 {
        font-size: 1.25rem;
    }
    
    .demo-credentials {
        gap: 12px;
    }
    
    .demo-card {
        padding: 16px;
    }
}

@media (max-width: 576px) {
    body {
        padding: 10px;
    }
    
    .login-panel,
    .demo-panel {
        padding: 30px 20px;
    }
    
    .login-header .logo {
        width: 60px;
        height: 60px;
    }
    
    .login-header .logo i {
        font-size: 1.5rem;
    }
    
    .login-header h1 {
        font-size: 1.5rem;
    }
    
    .form-control {
        padding: 10px 14px;
    }
    
    .btn-login {
        padding: 12px;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Loading Animation */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.d-none {
    display: none;
}

.d-block {
    display: block;
}

.d-flex {
    display: flex;
}

.align-items-center {
    align-items: center;
}

.justify-content-center {
    justify-content: center;
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .demo-panel {
        display: none;
    }
    
    .login-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .form-control {
        border-width: 3px;
    }
    
    .btn-login {
        border: 2px solid #000;
    }
    
    .demo-card {
        border-width: 3px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}