/* ===== صفحة تسجيل الدخول — SATR ===== */
:root {
    --auth-navy: #061A35;
    --auth-deep: #073B7A;
    --auth-royal: #1264F5;
    --auth-electric: #008CFF;
    --auth-cyan: #00D9E8;
    --auth-light: #F5F8FC;
    --auth-text: #0B2348;
    --auth-muted: #7C8DA8;
}

.auth-page {
    display: flex;
    width: 100%;
    min-height: 100vh;
    background: var(--auth-light);
    font-family: 'Cairo', sans-serif;
}

/* ===== قسم النموذج (يمين) ===== */
.auth-form-side {
    flex: 0 0 42%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 44px 40px 32px;
    box-shadow: 0 20px 60px rgba(6, 26, 53, 0.12), 0 4px 16px rgba(6, 26, 53, 0.06);
    text-align: center;
}

.auth-card-logo {
    width: 64px;
    height: 88px;
    margin: 0 auto 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card-logo img {
    max-width: 100%;
    max-height: 100%;
    filter: drop-shadow(0 4px 14px rgba(0, 140, 255, 0.35));
}

.auth-card-name {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--auth-text);
    line-height: 1.2;
}

.auth-card-latin {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 6px;
    color: var(--auth-muted);
    margin-bottom: 22px;
}

.auth-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--auth-text);
    margin-bottom: 4px;
}

.auth-subtitle {
    font-size: 0.85rem;
    color: var(--auth-muted);
    margin-bottom: 26px;
}

/* ===== الحقول ===== */
.auth-field {
    position: relative;
    margin-bottom: 16px;
    text-align: right;
}

.auth-input {
    width: 100%;
    height: 52px;
    border: 1.5px solid #E2E8F0;
    border-radius: 14px;
    background: #F8FAFC;
    padding: 0 48px 0 48px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--auth-text);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.auth-input::placeholder {
    color: #A3B1C6;
}

.auth-input:focus {
    outline: none;
    border-color: var(--auth-electric);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(0, 140, 255, 0.12);
}

.auth-field-icon {
    position: absolute;
    top: 26px;
    right: 18px;
    transform: translateY(-50%);
    color: #A3B1C6;
    font-size: 0.95rem;
    pointer-events: none;
}

.auth-eye {
    position: absolute;
    top: 26px;
    left: 8px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #A3B1C6;
    cursor: pointer;
    padding: 8px;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.auth-eye:hover {
    color: var(--auth-royal);
}

.auth-field-error {
    display: block;
    font-size: 0.78rem;
    color: #DC2626;
    margin-top: 5px;
    padding-right: 4px;
}

.auth-error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #B91C1C;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.85rem;
    margin-bottom: 18px;
    text-align: right;
}

.auth-error:empty {
    display: none;
}

/* ===== تذكرني / نسيت كلمة المرور ===== */
.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 6px 0 22px;
    font-size: 0.85rem;
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--auth-text);
    cursor: pointer;
    margin: 0;
}

.auth-remember input {
    width: 17px;
    height: 17px;
    accent-color: var(--auth-royal);
    cursor: pointer;
    margin: 0;
}

.auth-forgot {
    color: var(--auth-royal);
    text-decoration: none;
    font-size: 0.82rem;
    transition: color 0.2s;
}

.auth-forgot:hover {
    color: var(--auth-electric);
    text-decoration: underline;
}

/* ===== زر الدخول ===== */
.auth-submit {
    width: 100%;
    height: 54px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(90deg, var(--auth-royal) 0%, var(--auth-electric) 60%, var(--auth-cyan) 100%);
    color: #fff;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    box-shadow: 0 8px 20px rgba(18, 100, 245, 0.3);
}

.auth-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(18, 100, 245, 0.4);
}

.auth-submit:active:not(:disabled) {
    transform: translateY(0);
}

.auth-submit:disabled {
    opacity: 0.75;
    cursor: not-allowed;
}

.auth-submit .spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin 0.8s linear infinite;
    display: none;
}

.auth-submit.loading .spinner {
    display: inline-block;
}

.auth-submit.loading i, .auth-submit.loading .auth-submit-text {
    display: none;
}

@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

/* ===== تذييل البطاقة ===== */
.auth-card-footer {
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid #EDF1F7;
    font-size: 0.78rem;
    color: var(--auth-muted);
}

.auth-phone {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--auth-royal);
    font-weight: 600;
    margin-bottom: 4px;
}

/* ===== قسم الهوية (يسار) ===== */
.auth-brand-side {
    flex: 1;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse 80% 60% at 70% 20%, rgba(0, 140, 255, 0.22) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 20% 85%, rgba(0, 217, 232, 0.14) 0%, transparent 55%),
        linear-gradient(150deg, #08224A 0%, var(--auth-navy) 45%, #04122A 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* أشكال هندسية شفافة مستوحاة من حرف S */
.auth-shape {
    position: absolute;
    border-radius: 42px;
    transform: rotate(45deg);
    pointer-events: none;
}

.auth-shape.s1 {
    width: 340px;
    height: 130px;
    top: -60px;
    left: -90px;
    background: linear-gradient(135deg, rgba(0, 217, 232, 0.14), rgba(18, 100, 245, 0.10));
}

.auth-shape.s2 {
    width: 420px;
    height: 150px;
    bottom: -70px;
    right: -110px;
    background: linear-gradient(135deg, rgba(18, 100, 245, 0.12), rgba(0, 217, 232, 0.10));
}

.auth-shape.s3 {
    width: 180px;
    height: 80px;
    top: 18%;
    right: -50px;
    background: linear-gradient(135deg, rgba(0, 140, 255, 0.10), transparent);
}

.auth-shape.s4 {
    width: 150px;
    height: 70px;
    bottom: 22%;
    left: -40px;
    background: linear-gradient(135deg, rgba(0, 217, 232, 0.08), transparent);
}

.auth-brand-inner {
    position: relative;
    z-index: 1;
    text-align: center;
    color: #fff;
    padding: 20px;
}

.auth-brand-logo {
    height: 220px;
    max-width: 260px;
    object-fit: contain;
    margin-bottom: 18px;
    filter: drop-shadow(0 0 34px rgba(0, 217, 232, 0.45)) drop-shadow(0 8px 24px rgba(0, 140, 255, 0.35));
}

.auth-brand-name-lg {
    font-size: 3.4rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 2px;
}

.auth-brand-latin-lg {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 14px;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 18px;
    padding-right: 14px; /* موازنة المسافات بين الأحرف */
}

.auth-brand-tagline {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.65);
    position: relative;
    display: inline-block;
    padding-bottom: 14px;
    margin: 0;
}

.auth-brand-tagline::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    transform: translateX(50%);
    width: 56px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--auth-cyan), var(--auth-electric));
}

/* ===== تابلت ===== */
@media (max-width: 1100px) {
    .auth-form-side { flex: 0 0 46%; }
    .auth-brand-logo { height: 170px; }
    .auth-brand-name-lg { font-size: 2.6rem; }
    .auth-brand-latin-lg { letter-spacing: 10px; }
}

/* ===== موبايل ===== */
@media (max-width: 768px) {
    .auth-page {
        flex-direction: column;
    }

    /* الهوية تتحول إلى ترويسة مدمجة في الأعلى */
    .auth-brand-side {
        flex: 0 0 auto;
        min-height: 190px;
        padding: 22px 16px;
        order: -1;
    }

    .auth-shape.s1 { width: 200px; height: 80px; top: -40px; left: -60px; }
    .auth-shape.s2 { width: 240px; height: 90px; bottom: -50px; right: -70px; }
    .auth-shape.s3, .auth-shape.s4 { display: none; }

    .auth-brand-logo { height: 88px; margin-bottom: 6px; }
    .auth-brand-name-lg { font-size: 1.7rem; }
    .auth-brand-latin-lg { font-size: 0.65rem; letter-spacing: 8px; margin-bottom: 8px; padding-right: 8px; }
    .auth-brand-tagline { font-size: 0.8rem; padding-bottom: 10px; }

    .auth-form-side {
        flex: 1;
        padding: 18px 16px;
        align-items: flex-start;
    }

    .auth-card {
        padding: 30px 24px 24px;
        border-radius: 24px;
        margin-top: -30px;
        position: relative;
        z-index: 2;
    }

    .auth-card-logo { width: 48px; height: 66px; }
    .auth-card-name { font-size: 1.3rem; }
    .auth-title { font-size: 1.15rem; }

    .auth-input { height: 50px; font-size: 16px; } /* منع التكبير التلقائي في iOS */
    .auth-submit { height: 52px; }
}

/* ===== صفحة الاستعادة الطارئة - لوحة المستخدمين ===== */
.recovery-shell {
    min-height: 100vh;
    width: 100%;
    background: linear-gradient(160deg, #f5f8fc 0%, #e8eef7 100%);
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.recovery-panel {
    width: 100%;
    max-width: 880px;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 14px 40px rgba(11, 35, 72, 0.10);
    padding: 28px 30px;
}

.recovery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid #e8eef7;
}

.recovery-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.recovery-header-brand img {
    height: 52px;
    width: auto;
}

.recovery-header-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0b2348;
    margin: 0;
}

.recovery-header-sub {
    font-size: 0.78rem;
    color: #7c8da8;
    margin: 0;
}

.recovery-exit {
    border: none;
    background: #fdeaea;
    color: #c0392b;
    border-radius: 10px;
    padding: 9px 18px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.recovery-exit:hover { background: #f8d5d5; }

.recovery-alert {
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.recovery-alert.success { background: #e8f9ee; color: #1e7e44; border: 1px solid #b8e6c9; }
.recovery-alert.error { background: #fdeaea; color: #b03a2e; border: 1px solid #f2c4be; }

.recovery-search {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.recovery-search .auth-input {
    height: 46px;
    font-size: 0.9rem;
    margin-bottom: 0;
}

.recovery-search-btn {
    border: none;
    border-radius: 12px;
    padding: 0 22px;
    background: linear-gradient(135deg, #1264f5, #008cff);
    color: #fff;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.recovery-search-btn:hover { opacity: 0.9; }

.recovery-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.recovery-table th {
    text-align: right;
    color: #7c8da8;
    font-weight: 700;
    font-size: 0.76rem;
    padding: 10px 12px;
    border-bottom: 2px solid #e8eef7;
    white-space: nowrap;
}

.recovery-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f4fa;
    color: #0b2348;
    vertical-align: middle;
}

.recovery-table tr:last-child td { border-bottom: none; }

.recovery-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
}

.recovery-badge.role { background: #e8f1fe; color: #1264f5; }
.recovery-badge.active { background: #e8f9ee; color: #1e7e44; }
.recovery-badge.inactive { background: #fdeaea; color: #b03a2e; }

.recovery-reset-btn {
    border: none;
    border-radius: 10px;
    padding: 7px 14px;
    background: linear-gradient(135deg, #1264f5, #008cff);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.recovery-reset-btn:hover { opacity: 0.9; }

.recovery-empty {
    text-align: center;
    color: #7c8da8;
    padding: 30px 0;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .recovery-panel { padding: 20px 16px; border-radius: 18px; }
    .recovery-shell { padding: 14px 10px; }

    .recovery-table thead { display: none; }
    .recovery-table tr {
        display: block;
        background: #f8fafd;
        border-radius: 12px;
        margin-bottom: 12px;
        padding: 10px 6px;
    }
    .recovery-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border: none;
        padding: 7px 10px;
        font-size: 0.84rem;
    }
    .recovery-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #7c8da8;
        font-size: 0.74rem;
    }
}
