/* ===== Login Page Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    position: relative;
}

/* Ensure top logos are always visible */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: transparent;
    z-index: 9998;
    pointer-events: none;
}



/* ===== Background ===== */
.login-background {
    position: relative;
    min-height: 100vh;
    background: #1d2b24;
    display: flex;
    flex-direction: column;
}

/* Removed all background patterns */

@keyframes backgroundFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(180deg); }
}

/* Removed all background animations */

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

/* All overlays and animations removed */

/* ===== Language Toggle (Top Right) ===== */
.language-toggle-top {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
}

.language-toggle-top .btn {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #007bff;
    color: #007bff;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
}

.language-toggle-top .btn:hover {
    background: #007bff;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* ===== Logos Above Card ===== */
.logos-above-card {
    text-align: center;
    margin-bottom: 2rem;
}

.card-logo {
    height: 60px;
    width: auto;
    max-width: 150px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
    transition: all 0.3s ease;
    object-fit: contain;
    display: inline-block;
    margin: 0 1rem;
}

.card-logo.saudi-logo {
    height: 55px;
}

.card-logo.ministry-logo {
    height: 65px;
    border-radius: 8px;
    border: 2px solid rgba(0, 123, 255, 0.1);
}

.card-logo:hover {
    transform: scale(1.1) translateY(-5px);
    filter: drop-shadow(0 8px 16px rgba(0, 123, 255, 0.25));
}

.saudi-logo:hover,
.ministry-logo:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 4px 12px rgba(0, 123, 255, 0.3));
}



/* ===== Login Container ===== */
/* ===== Logos Above Card ===== */
.logos-above-card {
    text-align: center;
    margin-bottom: 2rem;
    animation: fadeInDown 1s ease;
    z-index: 100;
    position: relative;
}

.logos-above-card .d-flex {
    justify-content: center !important;
    align-items: center !important;
    gap: 2rem !important;
}

.card-logo {
    height: 60px !important;
    width: auto !important;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15)) !important;
    transition: all 0.3s ease !important;
    object-fit: contain !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.card-logo.saudi-logo {
    max-width: 120px !important;
}

.card-logo.ministry-logo {
    max-width: 140px !important;
    border-radius: 8px !important;
    border: 2px solid rgba(0, 123, 255, 0.1) !important;
}

.card-logo:hover {
    transform: scale(1.1) translateY(-5px) !important;
    filter: drop-shadow(0 8px 16px rgba(0, 123, 255, 0.3)) !important;
}

.login-container {
    position: relative;
    z-index: 10;
    padding-top: 50px;
    padding-bottom: 150px; /* Space for footer */
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== Login Card ===== */
.login-card {
    background: #ffffff;
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
    animation: slideUp 0.8s ease;
    position: relative;
}

/* Removed decorative top bar */

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

/* ===== Login Header ===== */
.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.system-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 10px 30px rgba(0, 123, 255, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.system-logo i {
    font-size: 2.5rem;
    color: #007bff;
}

.shield-image {
    width: 48px;
    height: 48px;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 4px 12px rgba(0, 123, 255, 0.3));
    animation: pulse 2s infinite;
    /* Blue shield with enhanced blue glow */
}

.login-title {
    color: #007bff;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 2rem;
    text-shadow: 0 2px 4px rgba(0, 123, 255, 0.1);
}

.login-subtitle {
    color: #6c757d;
    font-size: 1rem;
    margin: 0;
}

/* ===== Security Notice ===== */
.security-notice {
    background: linear-gradient(135deg, #e8f5e8, #f0f8f0);
    border: 1px solid #28a745;
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.security-icon {
    width: 50px;
    height: 50px;
    background: #28a745;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.security-icon i {
    color: white;
    font-size: 1.5rem;
}

.security-text strong {
    color: #155724;
    display: block;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.security-text p {
    color: #6c757d;
    font-size: 0.875rem;
    margin: 0;
}

/* ===== Form Styles ===== */
.login-form {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.input-group {
    position: relative;
}

.input-group-text {
    background: rgba(0, 123, 255, 0.1);
    border: 1px solid #007bff;
    color: #007bff;
    border-radius: 0.75rem 0 0 0.75rem;
    width: 50px;
    justify-content: center;
}

.form-control {
    border: 1px solid #007bff;
    border-left: none;
    border-radius: 0 0.75rem 0.75rem 0;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.form-control:focus {
    border-color: #0056b3;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    background: white;
}

#togglePassword {
    border: 1px solid #007bff;
    border-left: none;
    border-radius: 0 0.75rem 0.75rem 0;
    background: rgba(0, 123, 255, 0.1);
    color: #007bff;
}

#togglePassword:hover {
    background: rgba(0, 123, 255, 0.2);
}

/* ===== Security Features ===== */
.security-features {
    display: flex;
    justify-content: space-between;
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(40, 167, 69, 0.05);
    border-radius: 0.75rem;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #495057;
}

.feature-item i {
    font-size: 1rem;
}

/* ===== Login Button ===== */
.btn-login {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #007bff, #0056b3);
    border: none;
    border-radius: 0.75rem;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    /* overflow removed */
    margin-bottom: 1rem;
}

.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 ease;
}

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

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 123, 255, 0.4);
}

.btn-login:active {
    transform: translateY(0);
}

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

.login-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.login-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

/* ===== Messages ===== */
.error-message {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border: 1px solid #dc3545;
    color: #721c24;
    padding: 1rem;
    border-radius: 0.75rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.success-message {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border: 1px solid #28a745;
    color: #155724;
    padding: 1rem;
    border-radius: 0.75rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.5s ease;
}

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

/* ===== Login Attempts ===== */
.login-attempts {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 1px solid #ffc107;
    color: #856404;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    margin-top: 1rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
}

/* Footer definition moved below */

.system-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6c757d;
    font-size: 0.875rem;
}

.info-item i {
    color: #007bff;
}

/* ===== Language Toggle ===== */
.language-toggle {
    position: fixed;
    top: 2rem;
    left: 2rem;
    z-index: 1001;
}

[dir="rtl"] .language-toggle {
    left: auto;
    right: 2rem;
}

/* ===== Footer ===== */
.login-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem 0; /* Increased padding for more height */
    background: rgba(255, 255, 255, 0.95); /* White background */
    /* backdrop-filter removed */
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.footer-text {
    color: #2c5364; /* Dark blue text to match background */
    font-size: 1rem; /* Slightly larger text */
    margin: 0;
    text-align: center;
    font-weight: 600; /* Bolder text */
    text-shadow: none; /* Remove shadow for white background */
    line-height: 1.8; /* More line height */
}

.company-link {
    color: #0f4c75; /* Darker blue for white background */
    text-decoration: none;
    font-weight: 700; /* Bolder link */
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
    padding: 2px 6px;
    border-radius: 4px;
}

.company-link:hover {
    color: #2c5364; /* Even darker on hover */
    text-decoration: none;
    border-bottom: 2px solid #0f4c75;
    background: rgba(15, 76, 117, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(15, 76, 117, 0.2);
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .login-card {
        padding: 2rem 1.5rem;
        margin: 1rem;
        border-radius: 1.5rem;
    }
    
    .card-logo {
        height: 50px !important;
        margin: 0 0.5rem !important;
    }
    
    .login-container {
        padding-top: 30px;
    }
    
    .language-toggle-top {
        top: 15px;
        right: 15px;
    }
    
    .system-info {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .security-features {
        flex-direction: column;
        gap: 0.75rem;
        align-items: center;
    }
    
    .language-toggle {
        top: 1rem;
        left: 1rem;
    }
    
    [dir="rtl"] .language-toggle {
        left: auto;
        right: 1rem;
    }
    
    .copyright {
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        transform: none;
    }
}

@media (max-width: 576px) {
    .login-card {
        padding: 1.5rem 1rem;
    }
    
    .login-title {
        font-size: 1.5rem;
    }
    
    .system-logo {
        width: 60px;
        height: 60px;
    }
    
    .system-logo i {
        font-size: 2rem;
    }
    
    .security-notice {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
}

/* ===== Loading States ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    /* backdrop-filter removed */
}

.loading-spinner {
    text-align: center;
    color: #007bff;
}

.loading-spinner .spinner-border {
    width: 3rem;
    height: 3rem;
    color: #007bff;
}

/* ===== Security Enhancements ===== */
.form-control[type="password"] {
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

.form-control[type="password"]:not(:placeholder-shown) {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    letter-spacing: normal;
}

/* ===== Accessibility ===== */
.form-control:focus,
.btn:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* ===== Arabic/RTL Specific Styles ===== */
[dir="rtl"] .input-group-text {
    border-radius: 0 0.75rem 0.75rem 0;
    border-right: none;
    border-left: 1px solid #007bff;
}

[dir="rtl"] .form-control {
    border-radius: 0.75rem 0 0 0.75rem;
    border-right: none;
    border-left: 1px solid #007bff;
}

[dir="rtl"] #togglePassword {
    border-radius: 0.75rem 0 0 0.75rem;
    border-right: none;
    border-left: 1px solid #007bff;
}

/* ===== English/LTR Specific Styles ===== */
[dir="ltr"] .login-card {
    text-align: left;
}

[dir="ltr"] .login-header {
    text-align: center;
}

[dir="ltr"] .security-features {
    justify-content: space-around;
}

/* ===== Animation Delays ===== */
.form-group:nth-child(1) { animation: slideUp 0.8s ease 0.1s both; }
.form-group:nth-child(2) { animation: slideUp 0.8s ease 0.2s both; }
.security-features { animation: slideUp 0.8s ease 0.3s both; }
.btn-login { animation: slideUp 0.8s ease 0.4s both; }

/* ===== Hover Effects ===== */
.login-card:hover {
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.3);
}

/* ===== Focus Indicators ===== */
.form-control:focus + .input-group-text,
.input-group-text:focus-within {
    border-color: #0056b3;
    background: rgba(0, 123, 255, 0.2);
}

/* ===== Print Styles ===== */
@media print {
    .login-background {
        background: white !important;
    }
    
    .overlay {
        display: none !important;
    }
    
    .login-card {
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }
} 