:root {
    --primary-color: #6c63ff;
    --primary-light: #8b85ff;
    --primary-dark: #554fd8;
    --secondary-color: #f8f9fa;
    --accent-color: #ffc107;
    --text-dark: #2d3748;
    --text-medium: #4a5568;
    --text-light: #718096;
    --border-color: #e2e8f0;
    --success-color: #38a169;
    --danger-color: #e53e3e;
    --warning-color: #dd6b20;
    --info-color: #3182ce;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
    --gradient-primary: linear-gradient(135deg, #6c63ff 0%, #8b85ff 100%);
}

/* Font Face */
@font-face {
    font-family: "Cairo";
    src: url("/fonts/Cairo/Cairo-VariableFont_slnt,wght.ttf") format("truetype");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

* {
    font-family: "Cairo", sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    direction: rtl;
}

/* Login Container */
.login-container {
    width: 100%;
    max-width: 420px;
    animation: fadeInUp 0.6s ease-out;
}

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

/* Login Card */
.login-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(226, 232, 240, 0.8);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 5px;
    background: var(--gradient-primary);
}

/* Logo Section */
.logo-section {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: white;
    font-size: 32px;
    font-weight: bold;
    box-shadow: 0 8px 20px rgba(108, 99, 255, 0.3);
}

.login-title {
    color: var(--text-dark);
    font-weight: 700;
    font-size: 28px;
    margin-bottom: 5px;
}

.login-subtitle {
    color: var(--text-light);
    font-size: 14px;
}

.checkbox-group {
    margin: 20px 0;
    display: flex;
    justify-content: right;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    cursor: pointer;
    color: #4a5568;
    font-size: 0.9rem;
}

.checkbox-label input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e0;
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label input:checked + .checkmark {
    background: #4f46e5;
    border-color: #4f46e5;
}

.checkbox-label input:checked + .checkmark::after {
    content: "✓";
    position: absolute;
    color: white;
    font-size: 12px;
    font-weight: bold;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Error Messages Container */
.errors-container {
    margin-bottom: 20px;
}

/* Global Errors (at top) */
.global-errors {
    background: linear-gradient(
        135deg,
        rgba(229, 62, 62, 0.1) 0%,
        rgba(229, 62, 62, 0.05) 100%
    );
    border: 1px solid rgba(229, 62, 62, 0.2);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    animation: slideIn 0.3s ease-out;
}

.global-errors p {
    color: var(--danger-color);
    font-size: 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.global-errors p:last-child {
    margin-bottom: 0;
}

.global-errors p i {
    font-size: 12px;
}

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

/* Login Form */
.login-form {
    margin-top: 20px;
}

/* Form Group */
.form-group {
    margin-bottom: 25px;
    position: relative;
}

/* Input Fields */
.form-control {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: white;
    color: var(--text-dark);
}

.form-control::placeholder {
    color: #a0aec0;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
}

/* Field-specific Errors */
.field-error {
    color: var(--danger-color);
    font-size: 13px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Login Button */
.login-btn {
    width: 100%;
    padding: 15px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.2);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 99, 255, 0.3);
}

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

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

/* Footer */
.login-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 13px;
}

/* Toast Container */
.toast-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 9999;
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-card {
        padding: 30px;
    }

    .login-logo {
        width: 70px;
        height: 70px;
        font-size: 28px;
    }

    .login-title {
        font-size: 24px;
    }

    .form-control {
        padding: 14px;
    }
}

@media (max-width: 576px) {
    body {
        padding: 15px;
    }

    .login-card {
        padding: 25px;
        border-radius: 18px;
    }

    .login-logo {
        width: 60px;
        height: 60px;
        font-size: 24px;
        border-radius: 15px;
    }

    .login-title {
        font-size: 22px;
    }

    .form-control {
        padding: 13px;
        font-size: 14px;
    }

    .login-btn {
        padding: 14px;
        font-size: 15px;
    }

    .global-errors {
        padding: 12px;
    }

    .global-errors p {
        font-size: 13px;
    }
}

@media (max-width: 375px) {
    .login-card {
        padding: 20px;
    }

    .login-title {
        font-size: 20px;
    }

    .form-control {
        padding: 12px;
    }
}

/* Print Styles */
@media print {
    .login-card {
        box-shadow: none;
        border: 2px solid #ddd;
    }

    .login-btn {
        background: #f0f0f0;
        color: #333;
        border: 1px solid #ccc;
    }
}
