* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

img {
    max-width: 200%!important;
    height: auto;
}

body {
    font-family: 'Cairo', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    overflow-y: auto; 
    position: relative;
    transition: var(--transition);
}

/* Animated Background */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-animation .circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 15s ease-in-out infinite;
}

.bg-animation .circle:nth-child(1) {
    width: 400px;
    height: 400px;
    background: rgba(0, 210, 255, 0.15);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.bg-animation .circle:nth-child(2) {
    width: 300px;
    height: 300px;
    background: rgba(58, 96, 255, 0.12);
    bottom: -50px;
    left: -50px;
    animation-delay: -5s;
}

.bg-animation .circle:nth-child(3) {
    width: 200px;
    height: 200px;
    background: rgba(139, 92, 246, 0.1);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25%       { transform: translate(40px, -40px) scale(1.05); }
    50%       { transform: translate(-30px, 30px) scale(0.95); }
    75%       { transform: translate(20px, 20px) scale(1.02); }
}

.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    padding: 20px;
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100vh;
}

.login-art {
    display: none;
}

@media (min-width: 900px) {
    .login-art {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 350px;
    }

    .login-art .tooth-icon {
        width: 180px;
        height: 180px;
        background: linear-gradient(135deg, rgba(0, 210, 255, 0.15), rgba(58, 96, 255, 0.15));
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 30px;
        border: 2px solid rgba(0, 210, 255, 0.2);
        animation: pulse 3s ease-in-out infinite;
        position: relative;
    }

    .login-art .tooth-icon::before {
        content: '';
        position: absolute;
        width: 210px;
        height: 210px;
        border-radius: 50%;
        border: 1px solid rgba(0, 210, 255, 0.1);
        animation: ring 3s ease-in-out infinite reverse;
    }

    .login-art h2 {
        color: var(--text-primary);
        font-size: 26px;
        font-weight: 800;
        text-align: center;
        margin-bottom: 10px;
    }

    .login-art p {
        color: var(--text-muted);
        font-size: 14px;
        text-align: center;
        line-height: 1.8;
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1);    box-shadow: 0 0 0 0 rgba(0, 210, 255, 0.1); }
    50%       { transform: scale(1.03); box-shadow: 0 0 40px 10px rgba(0, 210, 255, 0.05); }
}

@keyframes ring {
    0%, 100% { transform: scale(1);   opacity: 1; }
    50%       { transform: scale(1.1); opacity: 0.5; }
}

.login-card {
    width: 420px;
    max-width: 100%;
    background: var(--bg-card);
    backdrop-filter: blur(30px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 45px 40px;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.login-card .header {
    text-align: center;
    margin-bottom: 35px;
}

.login-card .header .mobile-icon {
    display: none;
}

@media (max-width: 899px) {
    .login-card .header .mobile-icon {
        display: flex;
        width: 70px;
        height: 70px;
        align-items: center;
        justify-content: center;
        margin: 0 auto 20px;
        font-size: 30px;
        color: white;
    }
}

.login-card .header h1 {
    color: var(--text-primary);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 5px;
}

.login-card .header p {
    color: var(--text-muted);
    font-size: 13px;
}

.form-group {
    margin-bottom: 22px;
    position: relative;
}

.form-group label {
    display: block;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    font-size: 16px;
    transition: color 0.3s;
}

.input-wrapper input {
    width: 100%;
    padding: 15px 45px 15px 45px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    color: var(--text-primary);
    font-family: 'Cairo', sans-serif;
    font-size: 15px;
    transition: all 0.3s;
    outline: none;
}

.input-wrapper input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--bg-card-hover);
}

.input-wrapper input:focus + i,
.input-wrapper input:focus ~ i {
    color: var(--accent-primary);
}

.input-wrapper input::placeholder {
    color: var(--text-dim);
}

.toggle-password {
    position: absolute;
    left: 50px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    cursor: pointer;
    font-size: 16px;
    transition: color 0.3s;
    background: none;
    border: none;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.toggle-password:hover {
    color: var(--accent-primary);
}

.btn-login {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #00d2ff 0%, #3a60ff 100%);
    color: white;
    border: none;
    border-radius: 14px;
    font-family: 'Cairo', sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 5px;
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

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

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

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

.alert {
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-8px); }
    40%       { transform: translateX(8px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}

.footer-text {
    text-align: center;
    color: var(--text-dim);
    font-size: 12px;
    margin-top: 25px;
}

/* Login Theme Toggle */
.login-theme-wrapper {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 100;
}

.login-theme-wrapper .theme-toggle {
    width: 48px;
    height: 48px;
    font-size: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
    border-radius: 14px;
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.login-theme-wrapper .theme-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 210, 255, 0.3);
}

:root.light-mode .login-theme-wrapper .theme-toggle {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e2e8f0;
    color: #475569;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

:root.light-mode .login-theme-wrapper .theme-toggle:hover {
    background: #ffffff;
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
}

/* ===== Login Page Light Mode ===== */
:root.light-mode body { background: #f0f2f5; }

:root.light-mode .bg-animation .circle:nth-child(1) { background: rgba(0, 210, 255, 0.08); }
:root.light-mode .bg-animation .circle:nth-child(2) { background: rgba(58, 96, 255, 0.06); }

:root.light-mode .login-card {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
}

:root.light-mode .login-card .header h1 { color: #1e293b; }
:root.light-mode .login-card .header p  { color: #64748b; }
:root.light-mode .form-group label       { color: #475569; }

:root.light-mode .input-wrapper input {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #1e293b;
}

:root.light-mode .input-wrapper input:focus {
    border-color: #3a60ff;
    box-shadow: 0 0 0 3px rgba(58, 96, 255, 0.15);
    background: #ffffff;
}

:root.light-mode .input-wrapper input::placeholder { color: #94a3b8; }
:root.light-mode .input-wrapper i                  { color: #94a3b8; }

:root.light-mode .input-wrapper input:focus ~ i,
:root.light-mode .input-wrapper input:focus + i    { color: #3a60ff; }

:root.light-mode .toggle-password       { color: #94a3b8; }
:root.light-mode .toggle-password:hover { color: #3a60ff; }

:root.light-mode .alert {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
    color: #dc2626;
}

:root.light-mode .footer-text { color: #94a3b8; }
:root.light-mode .login-art h2 { color: #1e293b; }
:root.light-mode .login-art p  { color: #64748b; }

:root.light-mode .login-art .tooth-icon {
    background: linear-gradient(135deg, rgba(0, 210, 255, 0.1), rgba(58, 96, 255, 0.1));
    border-color: rgba(0, 210, 255, 0.15);
}

:root.light-mode .btn-login       { box-shadow: 0 5px 20px rgba(58, 96, 255, 0.25); }
:root.light-mode .btn-login:hover { box-shadow: 0 10px 30px rgba(58, 96, 255, 0.35); }

/* =========================================
   تصميم زر "تذكرني" المخصص
   ========================================= */
.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.custom-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.custom-checkbox .checkmark {
    width: 22px;
    height: 22px;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    position: relative;
}

.custom-checkbox .checkmark::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: white;
    font-size: 12px;
    opacity: 0;
    transform: scale(0.5) rotate(-20deg);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-checkbox:hover .checkmark {
    border-color: #3a60ff;
    box-shadow: 0 0 0 4px rgba(58, 96, 255, 0.1);
}

.custom-checkbox input:checked ~ .checkmark {
    background: linear-gradient(135deg, #00d2ff 0%, #3a60ff 100%);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(58, 96, 255, 0.3);
}

.custom-checkbox input:checked ~ .checkmark::after {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.custom-checkbox .text {
    font-size: 13px;
    color: rgb(150 163 182);
    font-weight: 600;
    transition: color 0.3s ease;
}

.custom-checkbox:hover .text { color: rgb(66 150 247); }

:root.light-mode .custom-checkbox .checkmark {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

:root.light-mode .custom-checkbox:hover .checkmark {
    border-color: #3a60ff;
    background: #ffffff;
}

:root.light-mode .custom-checkbox input:checked ~ .checkmark {
    background: #439df8;
    border-color: transparent;
}

/* =========================================
   Media Queries for Mobile Devices
   ========================================= */
@media (max-width: 768px) {
    .login-wrapper {
        padding: 15px;
        gap: 0;
    }

    .login-card {
        padding: 35px 25px;
    }
}

@media (max-width: 480px) {
    .login-wrapper {
        padding: 10px;
        align-items: flex-start;
        padding-top: 80px; 
    }

    .login-card {
        padding: 25px 20px;
        border-radius: 20px;
        width: 100%;
    }

    .login-card .header h1 {
        font-size: 20px;
    }

    .login-card .header p {
        font-size: 12px;
    }

    .input-wrapper input {
        padding: 14px 40px 14px 40px;
        font-size: 14px;
    }

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

    .login-theme-wrapper {
        top: 15px;
        left: 15px;
    }

    .login-theme-wrapper .theme-toggle {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .custom-checkbox .text {
        font-size: 12px;
    }
}
