/* [UNMIGRATED 2026-09-07] أُخرج هذا الملف من @layer screens — رصدٌ حىٌّ (لا نظرى، عبر
   Claude in Chrome على السيرفر الفعلى) أثبت أن خلفيات .swl-submit/.swl-btn-secondary/
   .swl-btn-ghost كانت تُفرَّغ فعلياً فى المتصفح (button{background-color:transparent}
   من Tailwind وقت التشغيل — بلا طبقة، فيغلب تلقائياً أى قاعدةٍ داخل طبقةٍ مسمّاة بصرف
   النظر عن الانتقائية) رغم أن ترويسة [MIGRATED 2026-07-27] أدناه ادّعت فحصاً سابقاً بلا
   تعارض — على الأرجح فُحص وقتها بلا اتصال فعلى بمصدر Tailwind CDN. نفس السبب المُوثَّق
   فى رأس palm_grid_form.css وsw-components.css، وبنفس الحل: إخراج الملف من الطبقة. */
/* [MIGRATED 2026-07-27] auth-login.css — تحقّق حسابى مسبق أثبت صفر تعارض محدّدات مع themes.css/a11y-responsive.css/base.html inline وصفر تعارض بين ملفات screens الثلاثة نفسها. */

/* ==========================================================================
   SWANCO ERP — Auth Experience (Login Revolution) v2
   [ADDED 2026-07-23 / REVISED 2026-07-23]
   ==========================================================================
   نسخة ثانية بعد مراجعة: تحوّل من لوحة داكنة مزدحمة بالنصوص إلى تصميم
   فاتح شبيه بمنتجات SaaS الحديثة (Ghost, Linear, Stripe) — النص الأساسي
   كله فى لوحة النموذج، ولوحة العلامة رسم توضيحي بصري بالكامل تقريباً
   (Dashboard + مستندات مالية) بدل فقرات تسويقية.

   الألوان هنا تعتمد على design-tokens.css (بادئة --sw-) وهى نفس قيم
   الثيم الفاتر "pearl" الافتراضي فى باقي النظام — لا ألوان hex عشوائية.
   كل الأصناف مسبوقة بـ "swl-" لضمان عدم التصادم مع أى ملف CSS آخر.
   ========================================================================== */

#s-login.swl-screen {
    background: linear-gradient(165deg, #F6FBF9 0%, #EFF8F3 45%, #FBF8EE 100%);
    padding: 0;
    overflow: hidden;
    position: relative;
}

.swl-shell {
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    width: 100%;
    min-height: 100vh;
    position: relative;
}

/* ==========================================================================
   1. لوحة الرسم التوضيحي (Illustration Panel) — أولاً فى DOM
      [REVISED 2026-07-23] تظهر يمين الشاشة فى RTL (مرجع MailFlow) — أول ما
      تقرأه العين فى الاتجاه العربى. بصري بالكامل تقريباً، بلا فقرات نصية.
   ========================================================================== */

.swl-illustration-side {
    position: relative; display: flex; flex-direction: column;
    padding: 40px 44px; overflow: hidden;
    background:
        radial-gradient(ellipse 65% 55% at 40% 25%, rgba(15,110,86,0.07) 0%, transparent 65%),
        linear-gradient(170deg, #EFFAF6 0%, #E6F5EE 55%, #FAF6EA 100%);
    border-inline-end: 1px solid rgba(15,110,86,0.08);
}

.swl-logo-row { display: flex; align-items: center; gap: 12px; position: relative; z-index: 2; }

.swl-logo-mark {
    width: 44px; height: 44px; flex-shrink: 0;
    filter: drop-shadow(0 8px 18px rgba(15,110,86,0.25));
}

.swl-logo-word {
    /* [FIX] كان letter-spacing:.05em مضبوطاً لكلمة لاتينية قصيرة (SWANCO ERP)؛
       على نص عربى طويل (اسم الشركة) يكسر تشكيل الحروف المتصلة ويبدو غير احترافى،
       لذا أُزيل هنا وعُدِّل المقاس والالتفاف ليلائم نصاً أطول. */
    font-size: 15px; font-weight: 900; letter-spacing: normal; line-height: 1.35;
    color: var(--sw-primary-700, #0D5442);
    max-width: 230px;
}

.swl-logo-sub { font-size: 10px; color: var(--sw-text-secondary, #63746F); font-weight: 600; margin-top: 2px; }

.swl-illustration {
    flex: 1; display: flex; align-items: center; justify-content: center;
    position: relative; z-index: 1; min-height: 0;
}

.swl-illustration svg { width: 100%; height: auto; max-width: 440px; transition: transform .2s ease; }

/* ==========================================================================
   2. لوحة النموذج (Form Panel) — ثانياً فى DOM (تظهر يسار الشاشة فى RTL)
   ========================================================================== */

.swl-form-side {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 40px 32px; position: relative; overflow-y: auto;
    background: var(--sw-bg-surface, #FFFFFF);
}

.swl-form-card { width: 100%; max-width: 380px; animation: swl-fade-up .5s var(--sw-ease-standard, ease); }

@keyframes swl-fade-up {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.swl-mobile-brand { display: none; align-items: center; gap: 12px; margin-bottom: 28px; }
.swl-mobile-brand .swl-logo-mark { width: 40px; height: 40px; }

.swl-form-head { margin-bottom: 26px; }
.swl-form-head h2 { font-size: 21px; font-weight: 800; color: var(--sw-text-primary, #1E2422); margin-bottom: 5px; }
.swl-form-head p  { font-size: 12.5px; color: var(--sw-text-secondary, #63746F); }

/* --- حقول الدخول: ملصق ثابت أعلى المربع (نمط الأنظمة المؤسسية) ---
   [REDESIGNED 2026-09-07] كان "ملصقاً عائماً" يبدأ داخل صندوق الإدخال نفسه
   ثم يطفو لأعلى عبر :not(:placeholder-shown) — نمط شائع فى تطبيقات
   استهلاكية، لكنه فى أنظمة SAP/Oracle المؤسسية غير معتاد، وسبَّب هنا فعلياً
   أكثر من عِلّة (تراكب مع بيانات autofill، غموض بصرى قبل الكتابة). استُبدل
   بملصقٍ عاديٍّ فى تدفّق الصفحة أعلى المربع — أبسط، بلا أى منطق تزامن JS،
   وأقرب لما يتوقّعه مستخدم نظام محاسبى احترافى. */

/* [FIX 2026-09-07] .swl-input/.swl-select/.swl-field تتطابق صدفةً مع محدّدات
   ui-2026.css العامة ([class$="-input"], [class$="-select"], [class$="-field"])
   التى تخدم 87+ شاشة فى النظام, وتفرض !important على padding/font-size/
   font-weight/line-height/border-radius/font-family — !important يتجاوز أى
   فارق انتقائية، فحتى بعد رفع الانتقائية بـ #s-login وحده كانت قيمة padding
   الحقيقية (0 40px) لا تزال تُستبدَل بـ 0.55rem 0.85rem !important فيُغطّى
   النص المكتوب بأيقونة القفل/البريد. الحل هنا مزدوج: تسبيق بـ #s-login (لضمان
   الفوز عند تساوى !important) + إعادة تأكيد نفس الخصائص !important في القواعد الثلاث أدناه بقيمها الأصلية المقصودة.
   ملحوظة: .swl-btn-secondary/.swl-btn-ghost تتطابق أيضاً مع محدّدات ui-2026.css
   ([class*="-btn-secondary"]/[class*="-btn-ghost"]) لكن بلا التذقاتي تدريجياً، عند http://localhost:5000/swanco
   افهمنا من حقول الزر الذك (design system) أنه يختف عن ذلك النظام — أمتاس العندمة فصلية
   للتوضيح. */

#s-login .swl-field { margin-bottom: 16px; padding: 0 !important; }

.swl-label {
    display: block;
    font-size: 12px; font-weight: 700; color: var(--sw-text-secondary, #63746F);
    margin-bottom: 7px;
}

.swl-input-wrap { position: relative; }

#s-login .swl-input {
    /* [FIX 2026-09-07] padding/font-size/font-weight/line-height/border-radius/
       font-family كلها !important فى ui-2026.css لنفس المحدّدات العامة، والـ
       !important يتجاوز أى فارق فى الانتقائية (حتى مع #s-login) — فأُعيد تأكيدها
       !important هنا أيضاً لاستعادة القيم الأصلية المقصودة لهذا الحقل تحديداً. */
    box-sizing: border-box;
    width: 100%; height: 46px; padding: 0 40px !important;
    border-radius: 12px !important; background: var(--sw-neutral-50, #FBFBFB);
    border: 1.5px solid var(--sw-neutral-200, #E6EAE9);
    color: var(--sw-text-primary, #1E2422); font-size: 13.5px !important; font-weight: 400 !important;
    line-height: normal !important; font-family: 'Cairo', sans-serif !important;
    outline: none; transition: border-color .18s ease, background .18s ease;
}

#s-login .swl-input::placeholder { color: var(--sw-neutral-400, #ACB9B6); }

#s-login .swl-input:focus { border-color: var(--sw-primary-500, #1BB18C); background: #FFFFFF; }

.swl-field-icon {
    position: absolute; inset-inline-end: 14px; top: 50%; transform: translateY(-50%); /* relative to .swl-input-wrap */
    color: var(--sw-neutral-400, #ACB9B6); font-size: 15px; pointer-events: none; transition: color .18s ease;
}
#s-login .swl-input:focus ~ .swl-field-icon { color: var(--sw-primary-600, #0F6E56); }

.swl-field-toggle {
    position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; padding: 4px; color: var(--sw-neutral-400, #ACB9B6);
    display: flex; transition: color .15s ease;
}
.swl-field-toggle:hover { color: var(--sw-primary-600, #0F6E56); }

/* [2026-08-18] علامة الصحة (✓) كانت على ‎--sw-success‎ وتباينه ‎3.13:1‎ —
   يمرّ حدَّ المكوّنات الرسومية (‎3:1‎) بهامش ضئيل جداً، وهو رمز صغير بحجم 14px
   يُقرأ كنص. نُقل إلى ‎--sw-success-hover‎ (‎4.97:1‎) فصار مريحاً `عندماق بلا أى تضيير
   فى الهوية — نفس عائلة النعناع، درجة واحدة أعمق.
   القاعدة كاملةً فى design-tokens.css القسم 4. */
.swl-field-valid {
    position: absolute; inset-inline-start: 38px; top: 50%; transform: translateY(-50%) scale(0.5);
    color: var(--sw-success-hover, #107F60); font-size: 14px; opacity: 0; transition: all .18s ease;
}
.swl-field.is-valid .swl-field-valid { opacity: 1; transform: translateY(-50%) scale(1); }
#s-login .swl-field.is-invalid .swl-input { border-color: var(--sw-danger-border, #FCA5A5); }

.swl-field-row { display: flex; justify-content: flex-end; margin-top: -8px; margin-bottom: 14px; }
.swl-link {
    font-size: 10.5px; color: var(--sw-primary-600, #0F6E56); text-decoration: none; cursor: pointer;
    font-weight: 600; transition: color .15s ease;
}
.swl-link:hover { color: var(--sw-primary-700, #0D5442); }

/* --- خيارات متقدمة (اختيار الشركة) --- */

.swl-advanced { margin-bottom: 18px; }

.swl-advanced summary {
    list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px;
    font-size: 11px; color: var(--sw-text-secondary, #63746F); font-weight: 600; user-select: none;
    padding: 4px 0;
}
.swl-advanced summary::-webkit-details-marker { display: none; }
.swl-advanced summary i { font-size: 12px; transition: transform .18s ease; }
.swl-advanced[open] summary i { transform: rotate(90deg); }
.swl-advanced summary:hover { color: var(--sw-primary-600, #0F6E56); }

.swl-advanced-body { padding-top: 10px; }
.swl-advanced-hint { font-size: 10px; color: var(--sw-neutral-400, #ACB9B6); margin-top: 6px; }

#s-login .swl-select {
    width: 100%; padding: 11px 12px !important; border-radius: 10px !important;
    background: var(--sw-neutral-50, #FBFBFB); border: 1.5px solid var(--sw-neutral-200, #E6EAE9);
    color: var(--sw-text-primary, #1E2422); font-size: 12.5px !important; font-weight: 400 !important;
    line-height: normal !important; font-family: 'Cairo', sans-serif !important;
    outline: none; cursor: pointer;
    transition: border-color .18s ease;
}
#s-login .swl-select:focus { border-color: var(--sw-primary-500, #1BB18C); }

/* --- لوحة نسيت كلمة المرور --- */

.swl-panel {
    margin-bottom: 16px; padding: 14px; border-radius: 12px;
    background: var(--sw-neutral-50, #FBFBFB); border: 1px solid var(--sw-neutral-200, #E6EAE9);
    animation: swl-fade-up .25s ease;
}

.swl-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.swl-tab {
    flex: 1; padding: 7px; border-radius: 9px; cursor: pointer; font-size: 11px; font-weight: 700;
    font-family: 'Cairo', sans-serif; border: 1px solid var(--sw-neutral-200, #E6EAE9);
    background: #FFFFFF; color: var(--sw-text-secondary, #63746F); transition: all .15s ease;
    display: flex; align-items: center; justify-content: center; gap: 5px;
}
.swl-tab.swl-tab-active {
    border-color: var(--sw-primary-400, #3CDDB4); background: var(--sw-primary-50, #EFFAF8); color: var(--sw-primary-700, #0D5442);
}

.swl-panel-text { font-size: 11px; color: var(--sw-text-secondary, #63746F); line-height: 1.7; margin-bottom: 10px; }

.swl-mini-input {
    width: 100%; padding: 10px 12px; border-radius: 9px; margin-bottom: 9px;
    background: #FFFFFF; border: 1px solid var(--sw-neutral-200, #E6EAE9);
    color: var(--sw-text-primary, #1E2422); font-size: 12.5px; font-family: 'Cairo', sans-serif; outline: none;
    transition: border-color .15s ease;
}
.swl-mini-input:focus { border-color: var(--sw-primary-500, #1BB18C); }
.swl-mini-input.swl-otp { text-align: center; letter-spacing: 7px; font-weight: 800; font-size: 15px; }

.swl-btn-secondary {
    width: 100%; padding: 9px; border-radius: 9px; border: none; cursor: pointer;
    background: linear-gradient(135deg, var(--sw-primary-600, #0F6E56), var(--sw-mint-400, #1AD19D)); color: #FFFFFF;
    font-size: 11.5px; font-weight: 800; font-family: 'Cairo', sans-serif;
    transition: filter .15s ease, transform .1s ease;
}
.swl-btn-secondary:hover { filter: brightness(1.06); }
.swl-btn-secondary:active { transform: translateY(1px); }
.swl-btn-secondary:disabled { opacity: .6; cursor: not-allowed; }

.swl-btn-ghost {
    width: 100%; margin-top: 8px; padding: 8px 14px; border-radius: 9px; cursor: pointer;
    background: #FFFFFF; border: 1px solid var(--sw-neutral-200, #E6EAE9);
    color: var(--sw-text-secondary, #63746F); font-size: 10.5px; font-family: 'Cairo', sans-serif;
    transition: all .15s ease;
}
.swl-btn-ghost:hover { background: var(--sw-neutral-100, #F4F6F5); }

.swl-panel-msg { font-size: 11px; margin: 8px 0; display: none; }

/* --- خطوة المصادقة الثنائية --- */

.swl-2fa-icon {
    width: 52px; height: 52px; border-radius: 16px; margin: 0 auto 10px;
    display: flex; align-items: center; justify-content: center; font-size: 22px;
    background: var(--sw-primary-50, #EFFAF8); border: 1px solid var(--sw-primary-200, #B6EDDF); color: var(--sw-primary-600, #0F6E56);
}

.swl-2fa-code {
    width: 100%; padding: 14px; border-radius: 12px; text-align: center;
    letter-spacing: 9px; font-size: 19px; font-weight: 800;
    background: var(--sw-neutral-50, #FBFBFB); border: 1.5px solid var(--sw-primary-300, #81E4CB);
    color: var(--sw-text-primary, #1E2422); outline: none; margin-bottom: 14px; font-family: 'Cairo', sans-serif;
    transition: border-color .15s ease;
}
.swl-2fa-code:focus { border-color: var(--sw-primary-600, #0F6E56); }

/* --- رسالة الخطأ --- */

.swl-error {
    display: none; align-items: center; gap: 8px;
    background: var(--sw-danger-bg, #FEE2E2); border: 1px solid var(--sw-danger-border, #FCA5A5);
    border-radius: 10px; padding: 11px 13px; margin-bottom: 16px; font-size: 12px; color: var(--sw-danger-text, #991B1B);
}
.swl-error i { flex-shrink: 0; font-size: 14px; }

/* --- زر الدخول الرئيسي (بحالات: عادي / تحميل / نجاح) --- */

.swl-submit {
    /* [FIX] الزرار كان أضيق بصرياً من نص «تسجيل الدخول» — كُبِّر الحشو والمقاس
       والارتفاع الأدنى ليصبح عنصر CTA واضحاً يلائم نظاماً احترافياً. */
    width: 100%; min-height: 50px; padding: 15px; border-radius: 12px; border: none; cursor: pointer;
    background: linear-gradient(135deg, var(--sw-primary-600, #0F6E56), var(--sw-mint-400, #1AD19D)); color: #FFFFFF;
    font-size: 14.5px; font-weight: 800; font-family: 'Cairo', sans-serif;
    box-shadow: var(--sw-shadow-lg, 0 12px 32px rgba(9,42,34,.12));
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: filter .18s ease, transform .12s ease, box-shadow .18s ease;
}
.swl-submit:hover  { filter: brightness(1.06); transform: translateY(-1px); }
.swl-submit:active { transform: translateY(0); }
.swl-submit:disabled { cursor: default; }

.swl-submit.is-success {
    background: linear-gradient(135deg, var(--sw-mint-500, #12A57C), var(--sw-mint-300, #4CE6BA));
    animation: swl-pulse-success .55s ease;
}
@keyframes swl-pulse-success {
    0%   { box-shadow: 0 0 0 0 rgba(18,165,124,0.45); }
    100% { box-shadow: 0 0 0 14px rgba(18,165,124,0); }
}

.swl-spinner {
    display: inline-block; width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.35); border-top-color: #FFFFFF;
    border-radius: 50%; animation: swl-spin .7s linear infinite;
}
@keyframes swl-spin { to { transform: rotate(360deg); } }

/* --- اهتزاز عند الخطأ --- */

.swl-shake { animation: swl-shake .42s cubic-bezier(.36,.07,.19,.97); }
@keyframes swl-shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

.swl-footer { text-align: center; margin-top: 22px; font-size: 10px; color: var(--sw-neutral-400, #ACB9B6); }

/* ==========================================================================
   3. الاستجابة (Responsive)
   ========================================================================== */

@media (max-width: 980px) {
    .swl-shell { grid-template-columns: 1fr; }
    .swl-illustration-side {
        padding: 28px 24px 8px; border-inline-end: none;
        border-bottom: 1px solid rgba(15,110,86,0.08); min-height: 0;
    }
    .swl-illustration { max-height: 200px; }
    .swl-illustration svg { max-width: 260px; }
    .swl-form-side { padding: 28px 24px 40px; }
}

@media (max-width: 560px) {
    .swl-illustration-side { display: none; }
    .swl-mobile-brand { display: flex; }
}

/* ==========================================================================
   4. إمكانية الوصول (Accessibility)
   ========================================================================== */

#s-login .swl-input:focus-visible,
#s-login .swl-select:focus-visible,
#s-login .swl-submit:focus-visible,
#s-login .swl-btn-secondary:focus-visible,
#s-login .swl-link:focus-visible,
#s-login .swl-tab:focus-visible {
    outline: 2px solid var(--sw-primary-500, #1BB18C); outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .swl-form-card, .swl-shake, .swl-submit.is-success, .swl-illustration * {
        animation: none; transition: none;
    }
}

/* ==========================================================================
   [REDESIGNED 2026-11-10] لوحة القمر الصناعى — منظر حقيقى للمزرعة خلف هوية النظام
   ========================================================================== */
.swl-illustration-side { background: #0a241b; color: #fff; }
.swl-illustration-side .swl-logo-word { color: #fff; }
.swl-illustration-side .swl-logo-sub  { color: rgba(255,255,255,.72); }
.swl-sat { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
#swl-sat-map { position: absolute; inset: -6%; background: #0a241b; animation: swl-drift 60s ease-in-out infinite alternate; }
#swl-sat-map .leaflet-tile-pane { filter: saturate(1.08) contrast(1.05); }
.swl-sat::after { content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(180deg, rgba(6,28,21,.82) 0%, rgba(6,28,21,.25) 34%, rgba(6,28,21,.35) 58%, rgba(6,28,21,.92) 100%); }
@keyframes swl-drift { from { transform: scale(1) translate(0,0); } to { transform: scale(1.08) translate(-2%, 1.5%); } }
@media (prefers-reduced-motion: reduce) { #swl-sat-map { animation: none; } }
.swl-sat .leaflet-control-attribution { background: rgba(0,0,0,.45) !important; color: rgba(255,255,255,.75) !important; font-size: 9px; }
.swl-sat .leaflet-control-attribution a { color: rgba(255,255,255,.85) !important; }
.swl-pitch { position: relative; z-index: 2; margin-top: auto; max-width: 460px; }
.swl-pitch-kicker { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 700; color: #9ff0cf;
    background: rgba(26,209,157,.14); border: 1px solid rgba(159,240,207,.28); border-radius: 999px; padding: 5px 12px; backdrop-filter: blur(6px); }
.swl-pitch h1 { font-size: 34px; line-height: 1.35; font-weight: 900; margin: 14px 0 18px; text-shadow: 0 2px 18px rgba(0,0,0,.45); }
.swl-pitch ul { list-style: none; padding: 0; margin: 0 0 6px; display: grid; gap: 10px; }
.swl-pitch li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 14px;
    background: rgba(6,28,21,.46); border: 1px solid rgba(255,255,255,.10); backdrop-filter: blur(8px); }
.swl-pitch li i { font-size: 20px; color: #6ee7b7; margin-top: 2px; }
.swl-pitch li b { display: block; font-size: 14px; }
.swl-pitch li span { font-size: 12px; color: rgba(255,255,255,.72); }
@media (max-width: 980px) { .swl-pitch h1 { font-size: 22px; margin: 8px 0 10px; } .swl-pitch ul { display: none; } .swl-illustration-side { min-height: 230px; } }
#swl-sat-map{direction:ltr}
