﻿/* ================================================================
   Auth - صفحة تسجيل الدخول
   ================================================================ */

.auth-body {
    min-height: 100vh;
    background: var(--bg-body);
    font-family: var(--font-family);
    direction: rtl;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.auth-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* ============================================================
   الجانب الأيسر - Hero
   ============================================================ */
.auth-hero {
    position: relative;
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 50%, var(--color-primary-light) 100%);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-10);
    overflow: hidden;
}

    .auth-hero::before {
        content: '';
        position: absolute;
        inset: 0;
        background-image: radial-gradient(circle at 20% 30%, rgba(255, 193, 7, 0.15) 0%, transparent 50%), radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
        pointer-events: none;
    }

    .auth-hero::after {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background-image: repeating-linear-gradient( 45deg, transparent 0, transparent 40px, rgba(255, 255, 255, 0.02) 40px, rgba(255, 255, 255, 0.02) 41px );
        animation: authHeroShift 60s linear infinite;
        pointer-events: none;
    }

@keyframes authHeroShift {
    from {
        transform: translate(0, 0);
    }

    to {
        transform: translate(40px, 40px);
    }
}

.auth-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(11, 59, 47, 0.3), rgba(0, 0, 0, 0.2));
    pointer-events: none;
}

.auth-hero__content {
    position: relative;
    z-index: 2;
    max-width: 520px;
    text-align: center;
}

.auth-hero__logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.1);
    border: 3px solid var(--color-accent);
    border-radius: var(--radius-full);
    margin-bottom: var(--space-6);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: authLogoFloat 4s ease-in-out infinite;
}

    .auth-hero__logo img {
        width: 90px;
        height: 90px;
        object-fit: contain;
        border-radius: var(--radius-full);
    }

@keyframes authLogoFloat {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.auth-hero__title {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: var(--font-weight-black);
    color: var(--text-inverse);
    margin-bottom: var(--space-3);
    letter-spacing: -0.5px;
}

.auth-hero__subtitle {
    font-size: var(--font-size-lg);
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: var(--space-8);
    font-weight: var(--font-weight-medium);
}

.auth-hero__features {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-8) 0;
    text-align: right;
    display: inline-block;
}

    .auth-hero__features li {
        display: flex;
        align-items: center;
        gap: var(--space-3);
        padding: var(--space-3) 0;
        font-size: var(--font-size-base);
        color: rgba(255, 255, 255, 0.9);
    }

        .auth-hero__features li i {
            color: var(--color-accent);
            font-size: 1.1rem;
            flex-shrink: 0;
        }

.auth-hero__footer {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

    .auth-hero__footer i {
        color: var(--color-success);
        font-size: 1rem;
    }

/* ============================================================
   الجانب الأيمن
   ============================================================ */
.auth-form-side {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
    background: var(--bg-surface);
    position: relative;
}

    .auth-form-side::before {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 300px;
        height: 300px;
        background: radial-gradient(circle, var(--color-primary-50) 0%, transparent 70%);
        border-radius: var(--radius-full);
        transform: translate(30%, -30%);
        pointer-events: none;
    }

.auth-form-wrapper {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 420px;
}

/* ============================================================
   رأس النموذج
   ============================================================ */
.auth-form-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.auth-form-header__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    color: var(--color-accent);
    border-radius: var(--radius-lg);
    font-size: 24px;
    margin-bottom: var(--space-4);
    box-shadow: 0 8px 20px rgba(11, 59, 47, 0.25);
}

.auth-form-header h2 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-black);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.auth-form-header p {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin: 0;
}

/* ============================================================
   الحقول
   ============================================================ */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

    .auth-field label {
        display: flex;
        align-items: center;
        gap: var(--space-2);
        font-size: var(--font-size-sm);
        font-weight: var(--font-weight-semibold);
        color: var(--text-secondary);
    }

        .auth-field label i {
            color: var(--color-primary);
            font-size: 14px;
        }

.auth-field__input {
    position: relative;
    display: flex;
    align-items: center;
}

    .auth-field__input input {
        width: 100%;
        height: 52px;
        padding: 0 var(--space-10) 0 var(--space-10);
        background: var(--color-gray-50);
        border: 2px solid var(--color-gray-200);
        border-radius: var(--radius-md);
        font-family: inherit;
        font-size: var(--font-size-base);
        color: var(--text-primary);
        transition: all var(--transition-fast);
    }

        .auth-field__input input::placeholder {
            color: var(--text-muted);
        }

        .auth-field__input input:hover {
            border-color: var(--color-gray-300);
        }

        .auth-field__input input:focus {
            outline: none;
            background: var(--bg-surface);
            border-color: var(--color-primary);
            box-shadow: 0 0 0 4px var(--color-primary-100);
        }

.auth-field__icon {
    position: absolute;
    inset-inline-start: var(--space-4);
    color: var(--text-muted);
    font-size: 16px;
    pointer-events: none;
    transition: color var(--transition-fast);
}

.auth-field__input:focus-within .auth-field__icon {
    color: var(--color-primary);
}

.auth-field__toggle {
    position: absolute;
    inset-inline-end: var(--space-2);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

    .auth-field__toggle:hover {
        background: var(--color-gray-100);
        color: var(--color-primary);
    }

.auth-field__error {
    font-size: var(--font-size-xs);
    color: var(--color-danger);
    min-height: 16px;
    display: block;
}

/* ============================================================
   الخيارات
   ============================================================ */
.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.auth-checkbox {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    user-select: none;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    position: relative;
}

    .auth-checkbox input[type="checkbox"] {
        position: absolute;
        opacity: 0;
        width: 0;
        height: 0;
    }

.auth-checkbox__box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--bg-surface);
    border: 2px solid var(--color-gray-300);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

    .auth-checkbox__box i {
        font-size: 11px;
        color: white;
        opacity: 0;
        transform: scale(0);
        transition: all var(--transition-fast);
    }

.auth-checkbox input[type="checkbox"]:checked + .auth-checkbox__box {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

    .auth-checkbox input[type="checkbox"]:checked + .auth-checkbox__box i {
        opacity: 1;
        transform: scale(1);
    }

.auth-link {
    font-size: var(--font-size-sm);
    color: var(--color-primary);
    text-decoration: none;
    font-weight: var(--font-weight-semibold);
    transition: color var(--transition-fast);
}

    .auth-link:hover {
        color: var(--color-accent-dark);
        text-decoration: underline;
    }

/* ============================================================
   زر تسجيل الدخول
   ============================================================ */
.auth-submit {
    position: relative;
    width: 100%;
    height: 54px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    overflow: hidden;
    transition: all var(--transition-fast);
    box-shadow: 0 6px 16px rgba(11, 59, 47, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .auth-submit::before {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary));
        opacity: 0;
        transition: opacity var(--transition-fast);
    }

    .auth-submit:hover::before {
        opacity: 1;
    }

    .auth-submit:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 24px rgba(11, 59, 47, 0.35);
    }

    .auth-submit:active {
        transform: translateY(0);
    }

.auth-submit__text,
.auth-submit__spinner {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.auth-submit__spinner {
    display: none;
}

.auth-submit.is-loading .auth-submit__text {
    display: none;
}

.auth-submit.is-loading .auth-submit__spinner {
    display: flex;
}

.auth-submit:disabled {
    cursor: wait;
    opacity: 0.85;
}

/* ============================================================
   Alert
   ============================================================ */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    line-height: 1.6;
    animation: authAlertShake 0.4s ease;
}

    .auth-alert i {
        font-size: 18px;
        flex-shrink: 0;
        margin-top: 2px;
    }

.auth-alert--error {
    background: var(--color-danger-light);
    color: var(--color-danger-dark);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-inline-start: 4px solid var(--color-danger);
}

.auth-alert ul {
    margin: 0;
    padding-inline-start: var(--space-4);
}

@keyframes authAlertShake {
    0%, 100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* ============================================================
   Footer
   ============================================================ */
.auth-footer {
    margin-top: var(--space-8);
    padding-top: var(--space-5);
    border-top: 1px solid var(--color-gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.auth-footer__version {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 4px 10px;
    background: var(--color-gray-50);
    border-radius: var(--radius-full);
    font-family: var(--font-family-mono);
    font-weight: var(--font-weight-semibold);
    color: var(--color-primary);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 992px) {
    .auth-wrapper {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .auth-hero {
        padding: var(--space-8) var(--space-5);
        min-height: 320px;
    }

    .auth-hero__logo {
        width: 80px;
        height: 80px;
        margin-bottom: var(--space-4);
    }

        .auth-hero__logo img {
            width: 60px;
            height: 60px;
        }

    .auth-hero__title {
        font-size: 1.6rem;
    }

    .auth-hero__subtitle {
        font-size: var(--font-size-base);
        margin-bottom: var(--space-5);
    }

    .auth-hero__features {
        display: none;
    }

    .auth-form-side {
        padding: var(--space-6) var(--space-4);
        min-height: calc(100vh - 320px);
    }

    .auth-form-wrapper {
        max-width: 100%;
    }
}

@media (max-width: 576px) {
    .auth-hero {
        min-height: 240px;
        padding: var(--space-6) var(--space-4);
    }

    .auth-hero__logo {
        width: 64px;
        height: 64px;
    }

        .auth-hero__logo img {
            width: 48px;
            height: 48px;
        }

    .auth-hero__title {
        font-size: 1.35rem;
    }

    .auth-form-header__icon {
        width: 56px;
        height: 56px;
        font-size: 22px;
    }

    .auth-form-header h2 {
        font-size: var(--font-size-xl);
    }

    .auth-field__input input,
    .auth-submit {
        height: 48px;
    }

    .auth-options {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }

    .auth-footer {
        flex-direction: column;
        text-align: center;
    }
}
