:root {
    --primary: #0284c7;
    --primary-hover: #0369a1;
    --primary-glow: rgba(2, 132, 199, 0.35);
    --accent: #10b981;
    --bg-dark: #090d16;
    --bg-card: rgba(15, 23, 42, 0.78);
    --border-card: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --input-bg: rgba(30, 41, 59, 0.65);
    --input-border: rgba(255, 255, 255, 0.12);
    --input-focus: #38bdf8;
    --error-color: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

/* Background Grids & Ambient Lighting */
.bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: 1;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: 2;
    pointer-events: none;
    animation: floatOrb 12s infinite alternate ease-in-out;
}

.orb-1 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(2, 132, 199, 0.35) 0%, rgba(15, 23, 42, 0) 70%);
    top: -100px;
    right: -100px;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.25) 0%, rgba(15, 23, 42, 0) 70%);
    bottom: -150px;
    left: -150px;
    animation-delay: -6s;
}

@keyframes floatOrb {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(40px, 30px) scale(1.1);
    }
}

/* Login Card Container */
.login-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 440px;
    padding: 2.5rem;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-card);
    border-radius: 24px;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.6),
        inset 0 1px 1px rgba(255, 255, 255, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-container:hover {
    border-color: rgba(56, 189, 248, 0.3);
    box-shadow:
        0 30px 60px -15px rgba(0, 0, 0, 0.7),
        0 0 30px rgba(2, 132, 199, 0.15);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.brand-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #0284c7, #10b981);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 28px;
    box-shadow: 0 10px 25px var(--primary-glow);
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #ffffff 30%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Form Styling */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #cbd5e1;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.8rem;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 14px;
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.25s ease;
}

body[dir="rtl"] .form-input {
    padding: 0.875rem 2.8rem 0.875rem 2.8rem;
}

.form-input:focus {
    border-color: var(--input-focus);
    background-color: rgba(30, 41, 59, 0.85);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
}

.input-icon-right {
    position: absolute;
    right: 1rem;
    color: var(--text-muted);
    pointer-events: none;
}

.toggle-password {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: var(--text-main);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-input {
    display: none;
}

.custom-checkbox {
    width: 18px;
    height: 18px;
    border: 1px solid var(--input-border);
    border-radius: 5px;
    background: var(--input-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.checkbox-input:checked+.custom-checkbox {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.checkbox-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.forgot-link {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: var(--input-focus);
}

.btn-submit {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 25px var(--primary-glow);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-submit:hover {
    background: linear-gradient(135deg, #0369a1 0%, #0284c7 100%);
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(2, 132, 199, 0.45);
}

.error-message {
    color: var(--error-color);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: block;
}