/*
 * =====================================================================
 * الوضع المظلم — Dark Theme Tokens
 * =====================================================================
 * هذا الملف يعرّف مجموعة رموز التصميم الكاملة للوضع المظلم فقط.
 * قاعدة ملزمة (SYSTEM-STANDARDS §3): مستقل تمامًا عن light.css، ولا تداخل
 * بين الوضعين. تُختار قيمة data-theme من الخادم حسب جلسة المستخدم.
 */
:root[data-theme="dark"] {
    /* الخلفيات والأسطح */
    /* `ي3` — Δ 11.6. */
    --page-bg:            #0A1220;
    --surface:       #111C2E;
    --surface-muted:   #1B2740;
    --overlay:       rgba(2, 6, 23, .72);

    /* النصوص */
    --text:          #EAF1F8;
    --text-muted:    #A9B6C9;
    /* حبرٌ ثانويٌّ فوق سطحٍ ملوّن (‏`ش7`): 5.29 فوق `surface-alt` و5.06 فوق `primary-soft`. */
    --color-text-on-tint:  #93a1b1;
    --color-text-inverse:  #0f151c;

    /* الحدود والفواصل */
    --border:        #263449;
    --border-strong: #3A4B65;

    /* اللون الأساسي (هوية طبية زرقاء) */
    --primary:       #5aa9f0;
    --primary-dark: #7dbdf5;
    --color-primary-soft:  #12314e;
    --on-accent:    #06121F;

    /* حالات التنبيه */
    --success:       #4ade80;
    --color-success-soft:  #14331f;
    --danger:        #f87171;
    --color-danger-soft:   #3a1616;
    --warning:       #fbbf24;
    --color-warning-soft:  #3a2c0d;
    --info:          #60a5fa;
    --color-info-soft:     #14233d;

    /* الظلال */
    --shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md:  0 4px 14px rgba(0, 0, 0, 0.5);
    --shadow-lg:  0 20px 48px rgba(0, 0, 0, .42);

    /* حلقة التركيز (إتاحة) */
    --focus-ring: rgba(90, 169, 240, .32);

    /* رموز صفحة الهبوط (زرقاء طبية، وذهبي ثانوي للهلال) */
    --color-landing-bg:          #0b1220;
    --color-landing-hero:        #0f1f33;
    --color-landing-deep:        #dbeafe;
    --color-landing-accent:      #5aa9f0;
    --color-landing-accent-soft: #12314e;
    --color-landing-gold:        #e0bc66;
    /* **والداكنُ يعبر بذهبه نفسِه**: 10.30 فوق ترويسة الهبوط — فلا يُغمَق بلا سبب. */
    --color-landing-gold-text:   #e0bc66;
    --color-landing-gold-soft:   #3b3019;
    --color-landing-blue:        #76b8f2;
    --color-landing-blue-soft:   #162b3e;
    --color-landing-glow:        rgba(90, 169, 240, 0.15);
    --color-landing-glass:       rgba(26, 34, 44, 0.88);
    --color-landing-line:        rgba(90, 169, 240, 0.10);

    /* **ونظيرُهما في الداكن يعتم ولا يضيء** — والعلّةُ في ملفّ الفاتح. */
    --color-entry-bar:     #0f1f33;
    --color-entry-bar-ink: #dbeafe;

    /* هوية لوحات النظام */
    --color-brand-gold:          #e0bc66;
    --color-brand-gold-soft:     #3b3019;
    --color-panel-sidebar:       #07223d;
    --color-panel-sidebar-alt:   #0c3157;
    --color-panel-sidebar-text:  #eef5ff;
    --color-panel-sidebar-muted: #9bbce0;
    --color-panel-sidebar-line:  rgba(255, 255, 255, 0.10);
    --color-panel-topbar:        rgba(26, 34, 44, 0.92);
    --color-table-stripe:        #1b2634;
    --color-auth-glow:           rgba(90, 169, 240, 0.12);

    /*
     * رمز QR — **متطابق عمدًا مع light.css: لا يُقلب في الوضع المظلم.**
     * الرمز يُقرأ بكاميرا لا بعين. قلبه (فاتح على داكن) ترفضه كثير من
     * تطبيقات المصادقة، وتخفيف تباينه ليلائم الوضع المظلم يُفشل المسح.
     * فاستثناءٌ مقصود من قاعدة «لكل وضع قيمه»: هذه القيم تخدم آلة لا عينًا،
     * فلا يعنيها الوضع. اللوح الأبيض في auth.css هو ما يحمله فوق خلفية
     * مظلمة، فيبقى الرمز مقروءًا والصفحة مظلمة.
     */
    --color-qr-module: #000000;
    --color-qr-plate:  #ffffff;

    color-scheme: dark;
}
