﻿/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    color: white;
    transition: all 0.3s ease;
}

/* Container */
.container {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Background with Animation */
.background {
    position: absolute;
    inset: 0;
    background: linear-gradient(-45deg, #7e22ce, #3b0764, #4c1d95, #581c87);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    z-index: -1;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Navigation */
.nav {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.back-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(88, 28, 135, 0.3);
    border: 1px solid rgba(147, 51, 234, 0.3);
    color: white;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    text-decoration: none;
    transition: all 0.3s ease;
}

    .back-button:hover {
        background: rgba(147, 51, 234, 0.3);
        transform: translateY(-2px);
    }

    .back-button i {
        transition: transform 0.3s ease;
    }

/* Login Container */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card {
    width: 100%;
    max-width: 32rem;
    background-color: rgba(88, 28, 135, 0.4);
    backdrop-filter: blur(12px);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid rgba(147, 51, 234, 0.3);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

    .login-card:hover {
        box-shadow: 0 35px 60px -15px rgba(0, 0, 0, 0.4);
        transform: translateY(-5px);
    }

    .login-card h1 {
        font-size: 2rem;
        text-align: center;
        margin-bottom: 2rem;
        color: white;
        position: relative;
    }

        .login-card h1::after {
            content: '';
            display: block;
            width: 50px;
            height: 3px;
            background: white;
            margin: 0.5rem auto 0;
            border-radius: 3px;
        }

/* Form Elements */
.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

    .input-group .icon {
        position: absolute;
        left: 1rem;
        top: 50%;
        transform: translateY(-50%);
        color: #e9d5ff;
        transition: all 0.3s ease;
    }

    .input-group input,
    .input-group select {
        width: 100%;
        padding: 0.75rem 3rem;
        background-color: rgba(88, 28, 135, 0.3);
        border: 1px solid rgba(147, 51, 234, 0.3);
        border-radius: 9999px;
        color: white;
        font-size: 1rem;
        transition: all 0.3s ease;
    }

        .input-group input::placeholder,
        .input-group select {
            color: #e9d5ff;
        }

            .input-group input:focus,
            .input-group select:focus {
                outline: none;
                border-color: #a855f7;
                box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
            }

    .input-group.password-group {
        position: relative;
    }

        .input-group.password-group input {
            padding-right: 3.5rem !important;
        }

.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #e9d5ff;
    cursor: pointer;
    padding: 0.25rem;
    transition: all 0.3s ease;
    z-index: 2;
}

    .toggle-password:hover {
        color: white;
        transform: translateY(-50%) scale(1.1);
    }

/* Alert */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .alert.warning {
        background-color: rgba(234, 179, 8, 0.2);
        border: 1px solid rgba(234, 179, 8, 0.3);
        color: #fef3c7;
    }

    .alert.danger {
        background-color: rgba(239, 68, 68, 0.2);
        border: 1px solid rgba(239, 68, 68, 0.3);
        color: #fee2e2;
    }

    .alert i {
        font-size: 1.2rem;
    }

/* Login Button */
.login-button {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(45deg, #a855f7, #7e22ce);
    color: white;
    border: none;
    border-radius: 9999px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 1.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

    .login-button::after {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: linear-gradient(to bottom right, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0));
        transform: rotate(30deg);
        transition: all 0.3s ease;
    }

    .login-button:hover {
        transform: translateY(-3px);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    }

        .login-button:hover::after {
            left: 100%;
        }

    .login-button:active {
        transform: translateY(-1px);
    }

/* Register Link */
.register-link {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

    .register-link a {
        color: #e9d5ff;
        text-decoration: none;
        transition: all 0.3s ease;
        font-weight: 600;
    }

        .register-link a:hover {
            color: white;
            text-decoration: underline;
        }

/* Bottom Gradient */
.bottom-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to top, rgba(88, 28, 135, 0.8), transparent);
    z-index: -1;
}

/* Validation Error Styles */
.text-danger {
    color: #f87171 !important;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: block;
    padding-left: 1rem;
}

/* RTL Support - التعديلات المهمة هنا */
[dir="rtl"] {
    text-align: right;
}

    [dir="rtl"] .input-group .icon {
        left: auto;
        right: 1rem;
    }

    [dir="rtl"] .input-group input,
    [dir="rtl"] .input-group select {
        padding: 0.75rem 3.5rem 0.75rem 1rem;
        text-align: right;
    }

    [dir="rtl"] .input-group.password-group input {
        padding-right: 3.5rem !important;
        padding-left: 3.5rem !important;
    }

    [dir="rtl"] .toggle-password {
        right: auto;
        left: 1rem;
    }

    [dir="rtl"] .input-group.password-group .icon {
        right: 1rem;
        left: auto;
    }

    [dir="rtl"] .back-button i {
        transform: rotate(180deg);
    }

    [dir="rtl"] .login-button i {
        transform: rotate(180deg);
    }

    [dir="rtl"] .text-danger {
        padding-left: 0;
        padding-right: 1rem;
        text-align: right;
    }

    [dir="rtl"] .alert {
        text-align: right;
    }

    [dir="rtl"] option {
        text-align: right;
    }

/* Responsive Design */
@media (max-width: 640px) {
    .row {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 1.5rem;
    }

        .login-card h1 {
            font-size: 1.75rem;
        }

    .input-group input,
    .input-group select {
        padding: 0.75rem 2.5rem 0.75rem 3rem;
    }

    [dir="rtl"] .input-group input,
    [dir="rtl"] .input-group select {
        padding: 0.75rem 3rem 0.75rem 2.5rem;
    }
}

/* Floating Labels Effect */
.input-group input:focus + .icon,
.input-group select:focus + .icon {
    color: #a855f7;
    transform: translateY(-50%) scale(1.1);
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    align-items: center;
}
.alert-warning::before {
    content: "⚠️";
    margin-right: 8px;
    font-size: 1.1rem;
}


