﻿/* كل شيء داخل .authx فقط — أسماء مُعزولة وإجبارية بفضل !important حيث يلزم */
.authx {
    --ax-brand-1: #0a71c0;
    --ax-brand-2: #1ea9f1;
    --ax-brand-dark: #085a9b;
    --ax-bg: #ffffff;
    --ax-text: #13304a;
    --ax-muted: #7b8aa0;
    --ax-input-bg: #f5f7fb;
    --ax-input-border: #e7ecf3;
    --ax-outline: rgba(30,169,241,.35);
    --ax-card: #ffffff;
    --ax-shadow: 0 16px 40px rgba(10,113,192,.10);
    display: flex !important;
    min-height: 100vh !important;
    width: 100% !important;
    background: var(--ax-bg) !important;
    isolation: isolate; /* يمنع تأثيرات خارجية */
}

    /* اللوحة الترحيبية */
    .authx .authx-welcome {
        width: 50% !important;
        color: #fff !important;
        background: radial-gradient(80% 120% at 100% 0%, rgba(30,169,241,.30), transparent 60%), linear-gradient(135deg, var(--ax-brand-dark) 0%, var(--ax-brand-1) 45%, var(--ax-brand-2) 100%) !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 48px 40px !important;
    }

    .authx .authx-welcome-inner {
        text-align: center !important;
        max-width: 440px !important;
    }

    .authx .authx-logo {
        max-width: 120px !important;
        margin-bottom: 1.5rem !important;
        filter: drop-shadow(0 3px 8px rgba(255,255,255,.25)) !important;
    }

    .authx .authx-title {
        font-weight: 800 !important;
        font-size: 2.2rem !important;
        margin: .5rem 0 !important;
    }

    .authx .authx-subtitle {
        font-size: 1.05rem !important;
        opacity: .95 !important;
    }

    /* لوحة الفورم */
    .authx .authx-panel {
        width: 50% !important;
        background: linear-gradient(180deg, #f7fbff 0%, #ffffff 60%) !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 48px 24px !important;
    }

    .authx .authx-card {
        width: 100% !important;
        max-width: 460px !important;
        background: var(--ax-card) !important;
        border: 1px solid #eef2f8 !important;
        border-radius: 18px !important;
        padding: 28px 24px !important;
        box-shadow: var(--ax-shadow) !important;
    }

    /* عناوين */
    .authx .authx-form-title {
        font-weight: 800 !important;
        font-size: 1.6rem !important;
        color: var(--ax-text) !important;
        margin-bottom: .25rem !important;
        letter-spacing: .2px !important;
    }

    .authx .authx-form-subtitle {
        color: var(--ax-muted) !important;
        margin-bottom: 1.25rem !important;
    }

    /* الحقول */
    .authx .authx-form {
        width: 100% !important;
    }

    .authx .authx-group {
        margin-bottom: 1.2rem !important;
    }

    .authx .authx-label {
        font-weight: 700 !important;
        margin-bottom: .4rem !important;
        color: var(--ax-text) !important;
        display: block !important;
    }

    .authx .authx-input-wrap {
        position: relative !important;
    }

    .authx .authx-input {
        width: 100% !important;
        border-radius: 12px !important;
        border: 1px solid var(--ax-input-border) !important;
        background: var(--ax-input-bg) !important;
        padding: 12px 44px !important;
        font-size: 1rem !important;
        color: var(--ax-text) !important;
        transition: border-color .18s ease, box-shadow .18s ease, background .18s ease !important;
    }

        .authx .authx-input:focus {
            background: #fff !important;
            border-color: var(--ax-brand-2) !important;
            box-shadow: 0 0 0 3px var(--ax-outline) !important;
            outline: none !important;
        }

    /* أيقونة ومدلول الاتجاه */
    .authx[dir="ltr"] .authx-ico {
        left: 12px !important;
        right: auto !important;
    }

    .authx[dir="rtl"] .authx-ico {
        right: 12px !important;
        left: auto !important;
    }

    .authx .authx-ico {
        position: absolute !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        color: var(--ax-muted) !important;
        font-size: 1.2rem !important;
        pointer-events: none !important;
    }

    /* زر إظهار/إخفاء كلمة السر */
    .authx .authx-toggle {
        position: absolute !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        border: 0 !important;
        background: transparent !important;
        font-size: 1.1rem !important;
        color: var(--ax-brand-dark) !important;
        cursor: pointer !important;
        padding: 6px !important;
        line-height: 1 !important;
        border-radius: 8px !important;
        transition: transform .12s ease, background .12s ease !important;
    }

        .authx .authx-toggle:active {
            transform: translateY(-50%) scale(.95) !important;
        }

    .authx[dir="ltr"] .authx-toggle {
        right: 8px !important;
        left: auto !important;
    }

    .authx[dir="rtl"] .authx-toggle {
        left: 8px !important;
        right: auto !important;
    }

    /* فالديشن */
    .authx .authx-validation {
        color: #dc3545 !important;
        font-size: .85rem !important;
        margin-top: .35rem !important;
    }

    /* روابط مساعدة */
    .authx .authx-aux {
        display: flex !important;
        justify-content: flex-end !important;
        margin-bottom: 1rem !important;
    }

    .authx .authx-link {
        color: var(--ax-brand-dark) !important;
        text-decoration: none !important;
        font-weight: 600 !important;
    }

        .authx .authx-link:hover {
            text-decoration: underline !important;
        }

    /* زر الدخول */
    .authx .authx-submit {
        width: 100% !important;
        height: 48px !important;
        border: 0 !important;
        border-radius: 12px !important;
        font-weight: 800 !important;
        color: #fff !important;
        background: linear-gradient(90deg, var(--ax-brand-1), var(--ax-brand-2)) !important;
        box-shadow: 0 8px 22px rgba(10,113,192,.22) !important;
        transition: transform .12s ease, box-shadow .18s ease, filter .18s ease !important;
    }

        .authx .authx-submit:hover:not(:disabled) {
            transform: translateY(-1px) !important;
            box-shadow: 0 12px 28px rgba(10,113,192,.28) !important;
            filter: brightness(1.02) !important;
        }

        .authx .authx-submit:disabled {
            opacity: .65 !important;
            cursor: not-allowed !important;
        }

/* ريسبونسيف */
@media (max-width: 992px) {
    .authx {
        flex-direction: column !important;
    }

        .authx .authx-welcome {
            display: none !important;
        }

        .authx .authx-panel {
            width: 100% !important;
            min-height: 100vh !important;
            padding: 32px 16px !important;
            background: linear-gradient(180deg, #f3f8ff 0%, #ffffff 60%) !important;
        }

        .authx .authx-card {
            padding: 22px 18px !important;
            border-radius: 16px !important;
        }
}

/* دارك (اختياري) */
@media (prefers-color-scheme: dark) {
    .authx {
        --ax-bg: #0b1220;
        --ax-card: #0f1629;
        --ax-text: #e6edf7;
        --ax-muted: #9bb0c5;
        --ax-input-bg: #0c1426;
        --ax-input-border: #162033;
        --ax-shadow: 0 16px 40px rgba(0,0,0,.35);
    }

        .authx .authx-panel {
            background: linear-gradient(180deg, #0b1220 0%, #0f1629 60%) !important;
        }

        .authx .authx-input:focus {
            box-shadow: 0 0 0 3px rgba(30,169,241,.2) !important;
        }
}
