/* ==========================================================================
   assets/css/auth.css — شاشات مصادقة موظّفي النظام
   (login.php / forgot_password.php / reset_password.php)
   ==========================================================================

   يُحمَّل في صفحات المصادقة وحدها، ويصف تخطيطها **وشكلها** كاملَين.

   ── لماذا لا نبني على أصناف بوتستراب ─────────────────────────────────────
   ثلاثة عيوب مقيسة فرضت ذلك:

   1) شريط تمرير رأسي وهمي:
      style.css يجعل الجسم عموداً مرناً (body{display:flex;flex-direction:column})
      ليلتصق الفوتر بالأسفل. أي غلاف داخل <body> يصير عنصراً مرناً، وغلافُ
      ‎.container.min-vh-100‎ القديم كان min-height تمنعه من الانكماش، فيصبح
      ارتفاع الصفحة = 100vh + ارتفاع الفوتر (قِيس: ‎+56px‎ على 1280 و‎+74px‎
      على 360). العلاج: ‎.auth-shell{flex:1 0 auto}‎ — يملأ ما تبقّى بالضبط.

   2) البطاقة تلتصق بأقصى اليمين حين لا تصل حزمة CDN:
      التوسيط كان معتمداً على ‎.container{margin-inline:auto}‎ من bootstrap.rtl
      الخارجية. بلا الحزمة يبقى للبطاقة عرض مقيَّد بلا هوامش تلقائية داخل تدفّق
      كتلي ‎dir="rtl"‎، فتُهمَل الهوامش الزائدة يساراً (CSS 2.1 §10.3.3) وتلتصق
      بالحافة اليمنى (قِيس: انحراف ‎407px‎). النظام يعمل على XAMPP وقد ينقطع
      النت، فهذه حالة عطل حقيقية لا فرضية.

   3) ‎.text-muted‎ لا وجود لها في الوضع الليلي:
      style.css فيه ‎html[data-theme="dark"] .text-muted{color:var(--text-main)!important}‎،
      أي أن النص الثانوي يصير بلون النص الأساسي تماماً — فتنهار الهرميّة
      البصرية (العنوان والسطر الشارح بلون واحد). لذلك لا نستعمل أصناف
      بوتستراب النصّية هنا إطلاقاً، بل أصنافاً خاصّة ‎.auth-*‎.

   النتيجة: الصفحة تُرسم **بالشكل نفسه** سواء وصلت حزم CDN أم لم تصل، لأن كل
   ما تحتاجه (التوسيط، الشبكة، الحقول، الأزرار، الأيقونات SVG المضمَّنة في
   HTML) محلّي. بوتستراب حين يصل لا يتعارض — لا نستعمل أصنافه أصلاً.

   ── الألوان ───────────────────────────────────────────────────────────────
   الرموز مورَّثة من style.css (‎--text-main‎ ‎--glass-bg‎ …) فتتبع الصفحة الوضع
   الليلي/النهاري تلقائياً. أما لون العلامة فيُحقَن من PHP في ‎<style>‎ بعد هذا
   الملف، ومعه نسخةٌ محسوبة منه لكل خلفية (انظر modules/auth/auth_view.php):
   لون النظام قابل للتغيير من الإعدادات، وقيمته الحالية ‎#00bfff‎ تعطي تبايناً
   ‎2.1:1‎ مع الأبيض — أي نصّاً غير مقروء لو استعملناه كما هو.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. الرموز — قيم افتراضية يستبدلها <style> المحقون من PHP
   -------------------------------------------------------------------------- */
:root {
    --auth-accent:          #4f46e5;
    --auth-accent-rgb:      79, 70, 229;
    --auth-on-accent:       #ffffff;   /* نصّ فوق لون العلامة */
    --auth-accent-on-light: #4338ca;   /* لون العلامة معدَّلاً ليُقرأ على خلفية فاتحة */
    --auth-accent-on-dark:  #a5b4fc;   /* ونفسه ليُقرأ على خلفية داكنة */

    --auth-danger:  #dc2626;
    --auth-warn:    #b45309;
    --auth-ok:      #047857;

    /* سطح الحقل — مصمت عمداً: الإكمال التلقائي في كروم يطلي خلفية الحقل،
       ولا يمكن إخفاء طلائه إلا بظلٍّ داخلي بلون مصمت (انظر :-webkit-autofill). */
    --auth-field:       #ffffff;
    --auth-field-solid: #ffffff;
    --auth-field-line:  rgba(15, 23, 42, .14);

    --auth-link:  var(--auth-accent-on-light);
    --auth-ring:  rgba(var(--auth-accent-rgb), .20);

    --auth-radius:    18px;
    --auth-radius-lg: 26px;
    --auth-ease:      cubic-bezier(.4, 0, .2, 1);
}

html[data-theme="dark"], html[data-bs-theme="dark"] {
    --auth-danger: #f87171;
    --auth-warn:   #fbbf24;
    --auth-ok:     #34d399;

    --auth-field:       rgba(255, 255, 255, .05);
    --auth-field-solid: #19212f;
    --auth-field-line:  rgba(255, 255, 255, .13);

    --auth-link: var(--auth-accent-on-dark);
    --auth-ring: rgba(var(--auth-accent-rgb), .28);
}

/* --------------------------------------------------------------------------
   1. أساسٌ لا يُفترض من إعادة ضبط بوتستراب
   -------------------------------------------------------------------------- */
/* هامش الجسم الافتراضي (8px من المتصفح) يزيح الصفحة كلها حين تغيب الحزمة */
body { margin: 0; }

.auth-shell,
.auth-shell *,
.auth-shell *::before,
.auth-shell *::after { box-sizing: border-box; }

.auth-shell img,
.auth-shell svg { max-width: 100%; }
.auth-shell svg { display: block; }

/* --------------------------------------------------------------------------
   2. الغلاف — عنصر مرن داخل جسم الصفحة العمودي
   -------------------------------------------------------------------------- */
.auth-shell {
    flex: 1 0 auto;              /* يملأ المتبقّي بعد الفوتر: لا فائض ولا نقص */
    display: flex;
    width: 100%;
    max-width: none;
    margin: 0;
    min-width: 0;
    padding: clamp(1rem, 3vw, 2.5rem) clamp(.75rem, 3vw, 2rem);
    /* هواتف ذات شقّ سفلي: الحافّة الآمنة تُضاف لا تُستبدل */
    padding-bottom: calc(clamp(1rem, 3vw, 2.5rem) + env(safe-area-inset-bottom, 0px));
    font-family: var(--font-family, system-ui, -apple-system, 'Segoe UI', sans-serif);
    color: var(--text-main);
}

/* --------------------------------------------------------------------------
   3. اللوحة — توسيط لا يعتمد على أي ملف خارجي
   --------------------------------------------------------------------------
   هامش auto على المحورين: يوسّط أفقياً ورأسياً، ولا يفيض من حافة البداية أبداً
   (بخلاف align-items:center الذي يقصّ الأعلى إذا طال المحتوى على شاشة قصيرة). */
.auth-panel {
    width: 100%;
    max-width: 460px;
    margin: auto;
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr;
    border-radius: var(--auth-radius-lg);
    overflow: hidden;
    background: var(--glass-bg, #fff);
    border: 1px solid var(--glass-border, rgba(0, 0, 0, .08));
    box-shadow: var(--glass-shadow, 0 18px 50px rgba(0, 0, 0, .12));
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
}

.auth-main {
    min-width: 0;
    padding: clamp(1.5rem, 5vw, 2.75rem);
    /* نصّ طويل بلا فواصل (بريد أو رمز) يلتفّ ولا يوسّع اللوحة */
    overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   4. عمود العلامة — يظهر على الشاشات العريضة وحدها
   --------------------------------------------------------------------------
   داكنٌ في الوضعين عمداً، لسببين لا لذوق:
   • شعار الشركة المرفوع أبيضُ على شفافية (قِيس: كل بكسلاته المعتمة ‎#FFFFFF‎)،
     فيختفي تماماً فوق بطاقة فاتحة. لوحة داكنة تضمن ظهوره أياً كان وضع الصفحة،
     وأياً كان الشعار الذي يرفعه عميل آخر.
   • ثبات الهوية: العمود نفسه في الوضعين يجعل الشاشة تُقرأ كعلامة واحدة. */
.auth-aside {
    display: none;
    position: relative;
    overflow: hidden;
    padding: clamp(2rem, 3vw, 3rem);
    color: #f1f5f9;
    background:
        radial-gradient(120% 90% at 15% 0%, rgba(var(--auth-accent-rgb), .38), transparent 60%),
        radial-gradient(100% 80% at 100% 100%, rgba(var(--auth-accent-rgb), .22), transparent 55%),
        linear-gradient(150deg, #0d1424 0%, #131c30 55%, #0b1220 100%);
}

/* شبكة رفيعة تعطي العمق دون صورة خارجية (لا CDN، لا طلب إضافي) */
.auth-aside::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
    background-size: 34px 34px;
    -webkit-mask-image: radial-gradient(120% 90% at 20% 10%, #000, transparent 70%);
    mask-image: radial-gradient(120% 90% at 20% 10%, #000, transparent 70%);
    pointer-events: none;
}

.auth-aside > * { position: relative; z-index: 1; }

.auth-aside__lead {
    margin: 1.75rem 0 0;
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: -.01em;
}
.auth-aside__text {
    margin: .625rem 0 0;
    font-size: .9375rem;
    line-height: 1.75;
    color: rgba(226, 232, 240, .72);
}

.auth-points {
    list-style: none;
    margin: 1.75rem 0 0;
    padding: 0;
    display: grid;
    gap: .875rem;
}
.auth-points li {
    display: flex;
    align-items: flex-start;
    gap: .625rem;
    font-size: .9375rem;
    line-height: 1.6;
    color: rgba(226, 232, 240, .88);
}
.auth-points svg {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin-top: .125rem;
    color: var(--auth-accent);
}

.auth-aside__foot {
    margin: 2rem 0 0;
    font-size: .75rem;
    letter-spacing: .02em;
    color: rgba(226, 232, 240, .45);
}

/* --------------------------------------------------------------------------
   5. كتلة العلامة (الشعار + الاسم)
   -------------------------------------------------------------------------- */
.auth-brand {
    display: flex;
    align-items: center;
    gap: .875rem;
    min-width: 0;
}

/* لوحة الشعار: داكنة دائماً — انظر تعليق .auth-aside أعلاه */
.auth-brand__plate {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    padding: 9px;
    border-radius: 16px;
    background:
        linear-gradient(140deg, rgba(var(--auth-accent-rgb), .55), rgba(var(--auth-accent-rgb), .12)),
        linear-gradient(140deg, #101a2c, #0a1120);
    box-shadow: 0 8px 22px rgba(8, 12, 22, .32),
                inset 0 0 0 1px rgba(255, 255, 255, .10);
}
.auth-brand__plate img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
/* بلا شعار مرفوع: أول حرفين من اسم الشركة */
.auth-brand__initials {
    font-size: 1.125rem;
    font-weight: 800;
    letter-spacing: .02em;
    color: #fff;
}

.auth-brand__name {
    min-width: 0;
    font-size: 1.0625rem;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: -.01em;
    color: var(--text-main);
}
.auth-brand__tag {
    display: block;
    margin-top: .1875rem;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--text-muted);
}
.auth-aside .auth-brand__name { color: #fff; }
.auth-aside .auth-brand__tag  { color: rgba(226, 232, 240, .6); }

/* النسخة المصغّرة أعلى النموذج — تحلّ محلّ العمود على الشاشات الضيّقة */
.auth-brand--compact { margin-bottom: 1.75rem; }

/* --------------------------------------------------------------------------
   6. العناوين
   -------------------------------------------------------------------------- */
.auth-head { margin-bottom: 1.5rem; }
.auth-title {
    margin: 0;
    font-size: clamp(1.375rem, 1.1rem + 1.2vw, 1.75rem);
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: -.02em;
    color: var(--text-main);
}
.auth-sub {
    margin: .5rem 0 0;
    font-size: .9375rem;
    line-height: 1.7;
    color: var(--text-muted);
}
.auth-sub strong { color: var(--text-main); font-weight: 700; }

/* سطر إرشادي تحت حقل — أصغر من .auth-sub وأقرب إلى الحقل الذي يشرحه */
.auth-hint {
    margin: -.125rem 0 1.25rem;
    font-size: .8125rem;
    line-height: 1.7;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   7. اللافتات (نجاح / خطأ / تحذير / معلومة)
   -------------------------------------------------------------------------- */
.auth-note {
    display: flex;
    align-items: flex-start;
    gap: .625rem;
    margin: 0 0 1.25rem;
    padding: .875rem 1rem;
    border: 1px solid transparent;
    border-radius: 14px;
    font-size: .875rem;
    line-height: 1.7;
}
.auth-note[hidden] { display: none; }
/* الأيقونة تحمل لون الحالة (currentColor) والنصّ يبقى بلون النصّ الأساسي:
   فقرةٌ كاملة بالأحمر تصرخ، وأيقونةٌ بلون النصّ لا تدلّ على شيء. */
.auth-note__icon { flex: 0 0 auto; display: block; margin-top: .125rem; }
.auth-note > svg,
.auth-note__icon svg { flex: 0 0 auto; display: block; width: 20px; height: 20px; }
.auth-note > svg { margin-top: .125rem; }
.auth-note__text { min-width: 0; color: var(--text-main); }

.auth-note--info   { color: var(--auth-link);   background: rgba(var(--auth-accent-rgb), .08); }
.auth-note--warn   { color: var(--auth-warn);   background: rgba(180, 83, 9, .09); }
.auth-note--danger { color: var(--auth-danger); background: rgba(220, 38, 38, .09); }
.auth-note--ok     { color: var(--auth-ok);     background: rgba(4, 120, 87, .09); }

html[data-theme="dark"] .auth-note--warn   { background: rgba(251, 191, 36, .10); }
html[data-theme="dark"] .auth-note--danger { background: rgba(248, 113, 113, .10); }
html[data-theme="dark"] .auth-note--ok     { background: rgba(52, 211, 153, .10); }

/* الحدّ بلون النصّ لكنه أخفت — currentColor بالكامل يصرخ. المتصفّح الذي لا
   يعرف color-mix يبقى على حدٍّ شفّاف، والخلفية وحدها تحمل الدلالة. */
@supports (color: color-mix(in srgb, red 50%, blue)) {
    .auth-note { border-color: color-mix(in srgb, currentColor 26%, transparent); }
}

/* --------------------------------------------------------------------------
   8. الحقول
   -------------------------------------------------------------------------- */
.auth-form { margin: 0; }
.auth-field { margin-bottom: 1.125rem; }

.auth-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .5rem;
}
.auth-label {
    display: block;
    margin-bottom: .5rem;
    font-size: .8125rem;
    font-weight: 700;
    letter-spacing: .01em;
    color: var(--text-muted);
}
.auth-label-row .auth-label { margin-bottom: 0; }

.auth-control {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    min-height: 54px;
    padding-inline: .875rem;
    border: 1px solid var(--auth-field-line);
    border-radius: var(--auth-radius);
    background: var(--auth-field);
    transition: border-color .2s var(--auth-ease), box-shadow .2s var(--auth-ease);
}
.auth-control:focus-within {
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 4px var(--auth-ring);
}
.auth-control__icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    transition: color .2s var(--auth-ease);
}
.auth-control:focus-within .auth-control__icon { color: var(--auth-accent); }

.auth-input {
    flex: 1 1 auto;
    width: 1%;                /* مع min-width:0 يمنع الحقل من دفع المجموعة خارج اللوحة */
    min-width: 0;
    margin: 0;
    padding: .875rem 0;
    border: 0;
    background: transparent;
    color: var(--text-main);
    font-family: inherit;
    /* 16px حدٌّ أدنى لا تفصيل جمالي: سفاري على iOS يقرّب الصفحة تلقائياً عند
       التركيز على أي حقل خطُّه أصغر من ذلك، ثم يترك المستخدم مكبَّراً. */
    font-size: 16px;
    line-height: 1.5;
    -webkit-appearance: none;
    appearance: none;
}
.auth-input:focus { outline: none; }
.auth-input::placeholder { color: var(--text-muted); opacity: .55; }
.auth-input::-ms-reveal,
.auth-input::-ms-clear { display: none; }   /* لدينا زرّ إظهار خاص بنا */

/* الإكمال التلقائي في كروم يطلي الحقل بلون ثابت لا يقبل background —
   الظلّ الداخلي المصمت هو الحيلة الوحيدة التي تعمل، ومعه لون النصّ. */
.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus {
    -webkit-box-shadow: inset 0 0 0 60px var(--auth-field-solid);
    box-shadow: inset 0 0 0 60px var(--auth-field-solid);
    -webkit-text-fill-color: var(--text-main);
    caret-color: var(--text-main);
}

/* حالة الخطأ */
.auth-control.is-invalid { border-color: var(--auth-danger); }
.auth-control.is-invalid:focus-within { box-shadow: 0 0 0 4px rgba(220, 38, 38, .18); }
.auth-control.is-invalid .auth-control__icon { color: var(--auth-danger); }

.auth-msg {
    display: flex;
    align-items: flex-start;
    gap: .375rem;
    margin: .5rem 0 0;
    font-size: .8125rem;
    line-height: 1.6;
    color: var(--auth-danger);
}
.auth-msg[hidden] { display: none; }
.auth-msg svg { flex: 0 0 auto; width: 15px; height: 15px; margin-top: .1875rem; }

/* حقلٌ معطّل — الحالة معرَّفة لا متروكة للمصادفة */
.auth-control.is-disabled { opacity: .55; }
.auth-input:disabled { cursor: not-allowed; }

/* زرّ إظهار كلمة المرور — 44×44 هو أصغر هدف لمسٍ مقبول (WCAG 2.5.5 / iOS HIG) */
.auth-reveal {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: color .2s var(--auth-ease), background-color .2s var(--auth-ease);
}
.auth-reveal:hover { color: var(--text-main); background: rgba(125, 125, 125, .12); }
.auth-reveal svg { width: 19px; height: 19px; }
.auth-reveal .auth-reveal__off { display: none; }
.auth-reveal.is-on .auth-reveal__on  { display: none; }
.auth-reveal.is-on .auth-reveal__off { display: block; }

/* --------------------------------------------------------------------------
   9. مقياس قوة كلمة المرور
   -------------------------------------------------------------------------- */
.auth-meter {
    display: flex;
    gap: 4px;
    margin-top: .625rem;
}
.auth-meter__seg {
    flex: 1 1 0;
    height: 4px;
    border-radius: 999px;
    background: rgba(125, 125, 125, .25);
    transition: background-color .25s var(--auth-ease);
}
.auth-meter.lv1 .auth-meter__seg:nth-child(-n+1),
.auth-meter.lv2 .auth-meter__seg:nth-child(-n+2) { background: var(--auth-danger); }
.auth-meter.lv3 .auth-meter__seg:nth-child(-n+3) { background: var(--auth-warn); }
.auth-meter.lv4 .auth-meter__seg:nth-child(-n+4) { background: var(--auth-ok); }
.auth-meter.lv5 .auth-meter__seg                 { background: var(--auth-ok); }

.auth-meter-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
    margin-top: .375rem;
    font-size: .75rem;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   10. الأزرار
   -------------------------------------------------------------------------- */
.auth-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    min-height: 54px;
    margin: 0;
    padding: .875rem 1.25rem;
    border: 0;
    border-radius: var(--auth-radius);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -.01em;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    /* لون العلامة مسطّحاً + طبقة تدرّج خفيفة: التباين يُحسب على اللون المسطّح
       في PHP، والطبقة أخفت من أن تُبطل الحساب. */
    color: var(--auth-on-accent);
    background-color: var(--auth-accent);
    background-image: linear-gradient(135deg, rgba(255, 255, 255, .10), rgba(0, 0, 0, .14));
    box-shadow: 0 10px 24px rgba(var(--auth-accent-rgb), .28);
    transition: transform .18s var(--auth-ease), box-shadow .18s var(--auth-ease),
                opacity .18s var(--auth-ease);
}
.auth-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(var(--auth-accent-rgb), .38); }
.auth-btn:active { transform: translateY(0); }
.auth-btn svg { width: 18px; height: 18px; }

.auth-btn--ghost {
    color: var(--text-main);
    background-color: transparent;
    background-image: none;
    border: 1px solid var(--auth-field-line);
    box-shadow: none;
}
.auth-btn--ghost:hover { background-color: rgba(125, 125, 125, .10); box-shadow: none; }

.auth-btn + .auth-btn { margin-top: .75rem; }

/* حالة الإرسال: القفل يمنع الضغط المزدوج (طلبٌ ثانٍ يُبطل رمز الأول)،
   والدوّامة CSS خالصة فتظهر حتى لو لم تصل حزمة الأيقونات الخارجية. */
.auth-btn[disabled] {
    cursor: progress;
    opacity: .78;
    transform: none;
    box-shadow: none;
}
.auth-btn[disabled] > svg,
.auth-btn[disabled] > i { display: none; }
.auth-btn[disabled]::after {
    content: "";
    width: 17px;
    height: 17px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: auth-spin .7s linear infinite;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   11. الروابط وذيل البطاقة
   -------------------------------------------------------------------------- */
.auth-link {
    color: var(--auth-link);
    font-weight: 700;
    text-decoration: none;
    border-radius: 6px;
}
.auth-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.auth-link--sm { font-size: .8125rem; }

.auth-foot {
    margin: 1.5rem 0 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--auth-field-line);
    font-size: .875rem;
    text-align: center;
    color: var(--text-muted);
}
.auth-foot a { color: var(--auth-link); font-weight: 700; text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; text-underline-offset: 3px; }

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    color: var(--text-muted);
    font-size: .875rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 8px;
}
.auth-back:hover { color: var(--text-main); }
.auth-back svg { width: 16px; height: 16px; }

/* --------------------------------------------------------------------------
   12. التركيز — مرئيٌّ دائماً للوحة المفاتيح
   -------------------------------------------------------------------------- */
.auth-shell :focus-visible {
    outline: 2px solid var(--auth-accent);
    outline-offset: 3px;
}
/* الحقل يُظهر حلقته على الغلاف لا على نفسه (وإلا حلقتان متداخلتان) */
.auth-input:focus-visible { outline: none; }

.auth-sr {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --------------------------------------------------------------------------
   13. زخارف الواجهة المسجَّلة لا محلّ لها هنا
   -------------------------------------------------------------------------- */
/* الفوتر المشترك يحمل margin-right بعرض الشريط الجانبي — ولا شريط جانبي هنا.
   وتنسيقه معتمد على أصناف بوتستراب (py-3 / text-center / small)، فنُثبّتها
   محلياً حتى لا يتشوّه حين لا تصل الحزمة. */
#mainFooter {
    margin-inline: 0 !important;
    padding: 1rem;
    font-size: .8125rem;
    text-align: center;
    color: var(--text-muted);
}
#mainFooter .fw-bold { font-weight: 600; }

/* مؤشّر الرسائل العائم يخصّ مستخدماً مسجَّلاً؛ الزائر هنا غير مسجَّل. */
#globalDmIndicator { display: none !important; }

/* --------------------------------------------------------------------------
   14. الشاشات العريضة — عمودان
   --------------------------------------------------------------------------
   1fr للنموذج و‎.86fr‎ للعلامة: النموذج هو المهمّة، والعلامة سياق. وفي RTL
   يقع العمود الأول يميناً، أي أن النموذج يبدأ حيث تبدأ العين. */
@media (min-width: 992px) {
    .auth-panel {
        max-width: 1020px;
        grid-template-columns: 1fr .86fr;
    }
    .auth-main  { grid-column: 1; padding: 3rem; }
    .auth-aside { grid-column: 2; display: flex; flex-direction: column; justify-content: center; }
    .auth-brand--compact { display: none; }
}

@media (min-width: 1400px) {
    .auth-panel { max-width: 1100px; }
    .auth-main  { padding: 3.5rem; }
}

/* --------------------------------------------------------------------------
   15. الشاشات الصغيرة — حتى 320px
   -------------------------------------------------------------------------- */
@media (max-width: 400px) {
    .auth-brand__plate { width: 48px; height: 48px; border-radius: 14px; padding: 7px; }
    .auth-brand__name  { font-size: 1rem; }
    .auth-control      { min-height: 50px; padding-inline: .75rem; }
    .auth-btn          { min-height: 50px; }
    .auth-label-row    { flex-wrap: wrap; gap: .25rem .5rem; }
}

/* شاشة قصيرة (نافذة أفقية على هاتف، أو شاشة 1366×640) */
@media (max-height: 620px) and (min-width: 992px) {
    .auth-main  { padding: 2.25rem 3rem; }
    .auth-aside { padding: 2.25rem; }
}

/* --------------------------------------------------------------------------
   16. احترام تقليل الحركة
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .auth-shell *,
    .auth-shell *::before,
    .auth-shell *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
    /* الدوّامة لا تدور: تبقى حلقةً ساكنة — ونصّ «جاري…» يحمل المعنى */
    .auth-btn[disabled]::after { animation: none !important; border-top-color: currentColor; opacity: .55; }
    .auth-btn:hover { transform: none; }
}
