
/*
 * صفحات الدخول الثلاث بالشكل الموحد (login.php · register.php · router_login.php):
 * رأس متدرج فيه اللوجو والعنوان، وبطاقة فيها الحقول (ايقونة + عنوان داخل الحقل) وزر كبير.
 *
 * ⚠ كل الأسماء ببادئة lg- (لا تلمس .panel/.field/.submit المشتركة مع صفحات الحساب الأخرى).
 * ⚠ ألوان الموقع (نفس متغيرات account_ui.php) فتصلح للثيمين. وصفحة الدخول المباشر لا تحمل القالب المشترك، فالمتغيرات هنا كاملة.
 * ⚠ الجسم (body) في القالب المشترك يوسط بطاقة واحدة بحشو 20: هنا صفحة كاملة، فنلغي ذلك.
 */
:root {
    --bg-1: #0a0f1c; --bg-2: #0d1526; --surface: #131d33; --surface-2: #192545; --border: #23304f; --text: #eef2f8; --text-dim: #8892ab;
    --primary: #3978E8; --primary-2: #5b93ee; --success: #20A866; --danger: #D94343; --warning: #F39A22;
    --lg-hd: #1d4fbf;
}
html[data-theme="light"] {
    --bg-1: #F4F7FC; --bg-2: #eaf0fb; --surface: #fff; --surface-2: #F4F7FC; --border: #e2e8f5; --text: #172033; --text-dim: #697386;
    --lg-hd: #7fa8f5;
}
* { box-sizing: border-box; }
body {
    margin: 0; min-height: 100vh; padding: 0; display: block; color: var(--text);
    background: linear-gradient(160deg, var(--bg-2) 0%, var(--bg-1) 100%);
    font-family: 'Tajawal', 'Cairo', 'TajawalFallback', 'Segoe UI', Tahoma, 'Noto Sans Arabic', Arial, sans-serif;
}
.ic-sun { display: none; }
.ic-moon { display: block; }
html[data-theme="light"] .ic-sun { display: block; }
html[data-theme="light"] .ic-moon { display: none; }

.lg-page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

/* الرأس */
.lg-hero {
    position: relative; overflow: hidden; padding: 12px 16px 58px;
    background: linear-gradient(180deg, var(--lg-hd) 0%, var(--bg-2) 100%);
}
.lg-in { position: relative; z-index: 1; max-width: 460px; margin: 0 auto; }
.lg-c1, .lg-c2, .lg-c3 { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, 0.07); pointer-events: none; }
.lg-c1 { top: -50px; inset-inline-start: -60px; width: 200px; height: 200px; }
.lg-c2 { top: 90px; inset-inline-end: 30px; width: 56px; height: 56px; }
.lg-c3 { top: 170px; inset-inline-end: -70px; width: 190px; height: 190px; background: rgba(255, 255, 255, 0.05); }

/* أزرار الثيم واللغة فوق الرأس */
.lg-hero .panel-top { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.lg-hero .icon-btn, .lg-hero a.lang-switch.lang-globe {
    width: 36px !important; min-width: 36px !important; height: 36px !important; padding: 0; border-radius: 999px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.35) !important; background: rgba(255, 255, 255, 0.12) !important; color: #fff !important;
}
.lg-hero .icon-btn svg { width: 18px; height: 18px; }
html[data-theme="light"] .lg-hero .icon-btn, html[data-theme="light"] .lg-hero a.lang-switch.lang-globe {
    border-color: rgba(23, 32, 51, 0.25) !important; background: rgba(255, 255, 255, 0.55) !important; color: #172033 !important;
}

.lg-brand { text-align: center; margin-top: 2px; }
.lg-tile {
    width: 76px; height: 76px; margin: 0 auto 10px; border-radius: 22px; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(160deg, var(--primary-2), var(--primary)); box-shadow: 0 14px 28px -12px rgba(8, 20, 60, 0.7);
}
.lg-tile img { width: 46px; height: 46px; display: block; }
.lg-brand h1 { margin: 0 0 4px; font-size: 21px; font-weight: 800; color: #fff; }
.lg-brand p { margin: 0; font-size: 12.5px; font-weight: 600; color: rgba(255, 255, 255, 0.78); }
html[data-theme="light"] .lg-brand h1 { color: #172033; }
html[data-theme="light"] .lg-brand p { color: #44506b; }

/* البطاقة */
.lg-wrap { position: relative; z-index: 2; width: 100%; max-width: 492px; margin: -34px auto 0; padding: 0 16px 22px; flex: 1; }
.lg-card {
    display: flex; flex-direction: column; gap: 11px; padding: 14px; border-radius: 26px;
    background: var(--surface); border: 1px solid var(--border); box-shadow: 0 24px 50px -28px rgba(0, 0, 0, 0.6);
}
.lg-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 5px; border-radius: 18px; background: var(--bg-1); border: 1px solid var(--border); }
.lg-tabs span, .lg-tabs a {
    display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 6px; border-radius: 14px; text-align: center;
    font-size: 14px; font-weight: 800; color: var(--text-dim); text-decoration: none;
}
.lg-tabs .on { color: #fff; background: linear-gradient(135deg, var(--primary-2), var(--primary)); }
.lg-form { display: flex; flex-direction: column; gap: 11px; margin: 0; }

/* الحقول: ايقونة + عنوان داخل الحقل يختفي عند الكتابة */
.lg-fld {
    display: flex; align-items: center; gap: 11px; min-height: 58px; padding: 0 12px; border-radius: 18px; cursor: text;
    --fb: var(--surface); background: var(--fb); border: 1px solid var(--border); transition: border-color 0.15s;
}
html:not([data-theme="light"]) .lg-fld { --fb: var(--surface-2); }
.lg-fld:focus-within { border-color: var(--primary); }
.lg-fld .ic { width: 36px; height: 36px; flex: 0 0 auto; border-radius: 11px; display: flex; align-items: center; justify-content: center; color: var(--primary); background: rgba(57, 120, 232, 0.16); }
.lg-fld .ic svg { width: 19px; height: 19px; }
.lg-inp { position: relative; flex: 1; min-width: 0; align-self: stretch; display: flex; align-items: center; }
.lg-inp input, .lg-inp select {
    flex: 1; min-width: 0; width: 100%; height: 56px; padding: 0; border: 0; outline: none; background: transparent; border-radius: 0;
    color: var(--text); font-family: inherit; font-size: 14px; font-weight: 700;
}
.lg-inp input::placeholder { color: transparent; opacity: 1; }
.lg-lb {
    position: absolute; inset: 0; display: flex; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-size: 14px; font-weight: 700; color: var(--text-dim); pointer-events: none;
}
.lg-lb i { font-style: normal; color: var(--danger); margin-inline-start: 4px; }
.lg-inp input:not(:placeholder-shown) ~ .lg-lb { display: none; }
/*
 * ⚠ تعبئة المتصفح التلقائية (Autofill): اسم المستخدم وكلمة المرور المحفوظان.
 *
 * ١) كروم على الكمبيوتر يعتبر الخانة المعباة تلقائيا فارغة لـ:placeholder-shown، فكان العنوان يبقى ظاهرا فوق القيمة. نخفيه بحالة autofill نفسها.
 *    (قاعدتان منفصلتان: لو جهل المتصفح احد الاسمين سقطت قاعدته وحدها.)
 * ٢) والمتصفح يرسم للخانة المعباة خلفية زرقاء فاتحة بزوايا حادة وكتابة سوداء، فتبدو غريبة في الثيم الفاتح وتختفي الكتابة في الغامق.
 *    فنرسم فوقها ظلا داخليا بلون الخانة نفسها (--surface-2) ونفرض لون الكتابة (--text)، فتبدو الخانة كما هي بلا مستطيل.
 *    والـtransition الطويل يمنع المتصفح من تلوين الخلفية لاحقا.
 */
.lg-inp input:-webkit-autofill ~ .lg-lb { display: none; }
.lg-inp input:autofill ~ .lg-lb { display: none; }
.lg-inp input:-webkit-autofill,
.lg-inp input:-webkit-autofill:hover,
.lg-inp input:-webkit-autofill:focus,
.lg-inp input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--text);
    caret-color: var(--text);
    -webkit-box-shadow: 0 0 0 1000px var(--fb, var(--surface)) inset;
    box-shadow: 0 0 0 1000px var(--fb, var(--surface)) inset;
    transition: background-color 600000s 0s, color 600000s 0s;
}
.lg-inp input:autofill {
    -webkit-text-fill-color: var(--text);
    caret-color: var(--text);
    box-shadow: 0 0 0 1000px var(--fb, var(--surface)) inset;
}
.lg-inp select { appearance: none; -webkit-appearance: none; cursor: pointer; }
.lg-inp select option { background: var(--surface-2); color: var(--text); }
.lg-chv { display: flex; flex: 0 0 auto; color: var(--text-dim); pointer-events: none; }
.lg-chv svg { width: 18px; height: 18px; }
.ltr-right { text-align: right; }

/* عين اظهار كلمة المرور (assets/js/auth-eye.js) */
.lg-eye {
    flex: 0 0 auto; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px; background: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center; color: var(--text-dim); transition: color 0.15s, background 0.15s;
}
.lg-eye:hover { color: var(--primary); background: var(--surface); }
.lg-eye svg { width: 20px; height: 20px; }
.lg-eye .off { display: none; }
.lg-eye.showing { color: var(--primary); }
.lg-eye.showing .on { display: none; }
.lg-eye.showing .off { display: block; }

/* أزواج الحقول */
.lg-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lg-hp { display: grid; grid-template-columns: 1fr 80px; gap: 10px; }
.lg-pair .lg-fld, .lg-hp .lg-fld { padding: 0 10px; gap: 8px; }
.lg-pair .ic, .lg-hp .ic { width: 30px; height: 30px; border-radius: 9px; }
.lg-pair .ic svg, .lg-hp .ic svg { width: 16px; height: 16px; }
.lg-pair .lg-lb, .lg-hp .lg-lb { font-size: 13px; }
@media (max-width: 339px) { .lg-pair { grid-template-columns: 1fr; } }
/* عنوان الجهاز طويل: على الشاشة الضيقة نوفر مكان الايقونة له */
@media (max-width: 349px) { .lg-hp .lg-fld:first-child .ic { display: none; } }

/* المنفذ: بجوار العنوان دائما، بعرض يكفي 5 ارقام (اقصى منفذ 65535): بلا ايقونة، والعنوان والرقم في الوسط */
.lg-port { padding: 0 6px; gap: 0; }
.lg-port .lg-lb { justify-content: center; font-size: 12px; }
.lg-port input { text-align: center; font-size: 14px; letter-spacing: 0.5px; }

/* الهاتف: رمز الدولة ثم الحقل */
.lg-phone { display: flex; gap: 8px; }
.lg-phone .lg-fld { flex: 1; min-width: 0; }
.lg-dial {
    display: flex; align-items: center; justify-content: center; min-width: 64px; padding: 0 10px; border-radius: 18px; direction: ltr; white-space: nowrap;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim); font-size: 14px; font-weight: 800;
}

/* زر الدخول/التسجيل */
.lg-go {
    display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 54px; border: 0; border-radius: 18px; cursor: pointer;
    font-family: inherit; font-size: 16px; font-weight: 800; color: #fff;
    background: linear-gradient(135deg, var(--primary-2), var(--primary)); box-shadow: 0 8px 14px -12px rgba(57, 120, 232, 0.85);
}
.lg-go:hover { filter: brightness(1.05); }
.lg-go:active { transform: scale(0.99); }
.lg-go svg { width: 20px; height: 20px; flex: 0 0 auto; }
.lg-msg { margin: 0; font-size: 12.5px; font-weight: 700; text-align: center; line-height: 1.7; }
.lg-msg.bad { color: var(--danger); }
.lg-rule { height: 1px; margin: 1px 6px; background: var(--border); }
.lg-rule span { display: none; }
.lg-rows { display: flex; flex-direction: column; gap: 11px; }

/* صف رابط (الدخول المباشر / رجوع لتسجيل الدخول) */
.lg-row {
    display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 12px; border-radius: 18px;
    text-decoration: none; color: var(--text); background: var(--surface-2); border: 1px solid var(--border);
    transition: border-color 0.15s, background 0.15s;
}
.lg-row:hover { border-color: var(--primary); background: rgba(57, 120, 232, 0.08); }
.lg-row:active { transform: scale(0.99); }
.lg-row:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.lg-row .ic { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--primary); background: rgba(57, 120, 232, 0.14); }
.lg-row .ic svg { width: 22px; height: 22px; }
.lg-row b { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 800; line-height: 1.4; }
.lg-row .ch { width: 18px; height: 18px; flex: 0 0 auto; color: var(--text-dim); }
html[dir="ltr"] .lg-row .ch { transform: scaleX(-1); }

/* خانة "حفظ بيانات الدخول" */
.lg-rem { display: flex; align-items: center; gap: 11px; min-height: 50px; padding: 0 4px; cursor: pointer; user-select: none; }
.lg-rem input { position: absolute; opacity: 0; pointer-events: none; }
.lg-rem .bx {
    width: 24px; height: 24px; flex: 0 0 auto; border-radius: 8px; display: flex; align-items: center; justify-content: center;
    background: var(--surface-2); border: 1.5px solid var(--border); transition: background 0.15s, border-color 0.15s;
}
.lg-rem .bx svg { width: 15px; height: 15px; stroke: #fff; opacity: 0; transform: scale(0.7); transition: opacity 0.14s, transform 0.14s; }
.lg-rem input:checked + .bx { border-color: var(--primary); background: linear-gradient(135deg, var(--primary-2), var(--primary)); }
.lg-rem input:checked + .bx svg { opacity: 1; transform: scale(1); }
.lg-rem input:focus-visible + .bx { outline: 3px solid rgba(57, 120, 232, 0.25); outline-offset: 2px; }
.lg-rem b { font-size: 13.5px; font-weight: 800; }

/*
 * زر "ثبت التطبيق" العائم (shared-install.css) يظهر افتراضيا أعلى اليسار، وهناك أزرار الثيم واللغة في رأس هذه الصفحات فيغطيها.
 * فنضعه هنا أعلى اليمين (بداية السطر). والتخصيص ببادئة body ليتغلب على قاعدته دون !important، والصفحات الاخرى لا تحمل هذا الملف.
 */
body .mt-install { inset-inline-end: auto; inset-inline-start: 16px; }
@media (max-width: 480px) { body .mt-install { inset-inline-end: auto; inset-inline-start: 10px; } }

/* اسفل بطاقة الدخول والتسجيل: رابطا الصفحتين القانونيتين نصا صغيرا ثم الاصدار والحقوق، كل في سطر (mt_auth_foot في app_info.php) */
.lg-fine, .lg-cp { display: flex; align-items: center; justify-content: center; flex-wrap: nowrap; gap: 9px; white-space: nowrap; line-height: 1.8; }
.lg-fine { margin: 16px 0 0; font-size: 11.5px; font-weight: 800; }
.lg-fine a { color: var(--text-dim); text-decoration: none; }
.lg-fine a:hover, .lg-fine a:focus-visible { color: var(--primary); }
.lg-cp { margin: 6px 0 0; font-size: 11.5px; font-weight: 700; color: var(--text-dim); }
.lg-fine i, .lg-cp i { width: 3px; height: 3px; flex: 0 0 auto; border-radius: 50%; background: var(--text-dim); opacity: 0.55; }
.lg-cp .n { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* خطأ تحت الحقل (رقم مكرر · بريد غير صحيح ...) */
.lg-fld.err, .lg-fld.err:focus-within { border-color: var(--danger); background: rgba(217, 67, 67, 0.07); }
.lg-fld.err .ic { color: var(--danger); background: rgba(217, 67, 67, 0.14); }
.lg-ferr { display: flex; align-items: center; gap: 6px; margin: -5px 6px 0; font-size: 12px; font-weight: 800; line-height: 1.6; color: var(--danger); }
.lg-ferr svg { width: 15px; height: 15px; flex: 0 0 auto; }

/*
 * زر جوجل: وجه بتصميمنا + زر جوجل الرسمي (اطار) فوقه شفاف تماما.
 * الضغطة تقع فعليا على زر جوجل فيعمل الدخول بالرمز المعتمد، والوجه ما يراه العميل.
 */
.lg-g { position: relative; min-height: 54px; border-radius: 18px; overflow: hidden; }
.lg-g .face {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 12px; border-radius: 18px;
    background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: 15px; font-weight: 800;
    box-shadow: 0 10px 22px -18px rgba(20, 40, 80, 0.55); pointer-events: none; transition: border-color 0.15s, background 0.15s;
}
html:not([data-theme="light"]) .lg-g .face { background: var(--surface-2); }
.lg-g:hover .face { border-color: var(--primary); }
.lg-g .face svg { width: 22px; height: 22px; flex: 0 0 auto; }
.lg-g .hit { position: absolute; inset: 0; z-index: 2; opacity: 0.01; overflow: hidden; display: flex; justify-content: center; }
.lg-g .hit > div, .lg-g .hit iframe { max-width: none !important; }
.lg-g.busy .face { opacity: 0.6; }

/* رمز التأكيد: ست خانات */
.lg-otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; direction: ltr; }
.lg-otp input {
    width: 100%; min-width: 0; height: 58px; padding: 0; border-radius: 15px; text-align: center; outline: none;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-family: inherit; font-size: 23px; font-weight: 800; caret-color: var(--primary);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.lg-otp input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(57, 120, 232, 0.18); }
.lg-otp input.f { border-color: var(--primary); }
.lg-otp.err input { border-color: var(--danger); background: rgba(217, 67, 67, 0.07); }
.lg-otp.err { animation: lgShake 0.34s; }
@keyframes lgShake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.lg-cd { margin: 0; text-align: center; font-size: 12.5px; font-weight: 700; color: var(--text-dim); min-height: 22px; }
.lg-cd b { color: var(--text); font-weight: 800; direction: ltr; unicode-bidi: isolate; display: inline-block; }
.lg-link {
    display: block; width: 100%; padding: 8px 4px; border: 0; background: none; cursor: pointer; text-align: center; text-decoration: none;
    font-family: inherit; font-size: 13.5px; font-weight: 800; color: var(--primary);
}
.lg-link:hover { text-decoration: underline; }
.lg-em { direction: ltr; unicode-bidi: isolate; font-weight: 800; }

/* بطاقة حساب جوجل في شاشة اكمال البيانات */
.lg-chip { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 0 12px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--border); }
.lg-chip .av { width: 42px; height: 42px; flex: 0 0 auto; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px; font-weight: 800; background: linear-gradient(135deg, var(--primary-2), var(--primary)); }
.lg-chip .tx { flex: 1; min-width: 0; line-height: 1.5; }
.lg-chip .tx b { display: block; font-size: 14px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-chip .tx small { display: block; direction: ltr; text-align: start; font-size: 12px; font-weight: 700; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-chip .ok { width: 26px; height: 26px; flex: 0 0 auto; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; background: var(--success); }
.lg-chip .ok svg { width: 15px; height: 15px; }
.lg-gblock[hidden] { display: none; }
.lg-gblock { display: flex; flex-direction: column; gap: 8px; }
.lg-gblock .lg-msg[hidden] { display: none; }

/* نسيت كلمة المرور: الرابط تحت الحقل + مؤشر القوة + علامة النجاح */
.lg-fgt { display: block; align-self: flex-start; margin: -3px 4px 0; font-size: 12.5px; font-weight: 800; color: var(--primary); text-decoration: none; }
.lg-fgt:hover, .lg-fgt:focus-visible { text-decoration: underline; }
.lg-str { display: flex; gap: 6px; margin: -3px 4px 0; }
.lg-str[hidden], .lg-str-l[hidden] { display: none; }
.lg-str i { flex: 1; height: 5px; border-radius: 9px; background: var(--border); transition: background 0.15s; }
.lg-str-l { margin: -2px 6px 0; font-size: 12px; font-weight: 800; }
.lg-ok { width: 84px; height: 84px; margin: 6px auto 2px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--success); background: rgba(32, 168, 102, 0.14); }
.lg-ok svg { width: 42px; height: 42px; }

/*
 * ═══ الكمبيوتر (900px فأكثر): شاشة منقسمة ═══
 * لوحة زرقاء للهوية (.lg-side من mt_auth_side في app_info.php) بجانب النموذج، بدل الرأس المتدرج والبطاقة.
 * الرأس والعنوان يبقيان في الـDOM كما هما (display:contents) فيصيران عناصر شبكة مباشرة، فلا يتغير شيء من منطق الصفحات.
 * الجوال بلا أي تغيير: اللوحة مخفية والقواعد كلها داخل هذا الاستعلام.
 */
.lg-side { display: none; }
@media (min-width: 900px) {
    body:has(.lg-page:not(.lg-legal)) { background: var(--bg-1); }
    .lg-page:not(.lg-legal) {
        position: relative; display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-rows: minmax(60px, 1fr) auto auto minmax(40px, 1.1fr);
    }
    /* اللوحة الزرقاء: أول عمود (يمين في العربية، يسار في الانجليزية) */
    .lg-page:not(.lg-legal) > .lg-side {
        grid-column: 1; grid-row: 1 / -1; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center;
        padding: 48px 56px; color: #fff; min-height: 100vh;
        background: linear-gradient(160deg, #173a80 0%, #1f4aa8 48%, #2f63d6 100%);
    }
    .lg-sc1, .lg-sc2 { position: absolute; border-radius: 50%; pointer-events: none; }
    .lg-sc1 { width: 760px; height: 760px; inset-inline-start: -330px; bottom: -280px; background: rgba(255, 255, 255, 0.05); box-shadow: 0 0 0 80px rgba(255, 255, 255, 0.03); }
    .lg-sc2 { width: 300px; height: 300px; inset-inline-end: -110px; top: -110px; background: rgba(255, 255, 255, 0.05); }
    .lg-side-in { position: relative; z-index: 1; width: min(520px, 100%); display: flex; flex-direction: column; align-items: flex-start; gap: 0; }
    .lg-sb { display: flex; align-items: center; gap: 14px; margin-bottom: 52px; }
    .lg-sb img { width: 56px; height: 56px; padding: 12px; border-radius: 16px; background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.22); }
    .lg-sb span { display: flex; flex-direction: column; gap: 3px; }
    .lg-sb b { font-size: 24px; font-weight: 800; line-height: 1.1; letter-spacing: 0.2px; }
    .lg-sb small { font-size: 10.5px; font-weight: 700; letter-spacing: 2px; color: rgba(255, 255, 255, 0.72); direction: ltr; unicode-bidi: isolate; }
    .lg-side h2 { margin: 0 0 16px; font-size: 44px; font-weight: 800; line-height: 1.45; color: #fff; text-wrap: balance; }
    .lg-side p { margin: 0 0 40px; max-width: 440px; font-size: 16px; font-weight: 600; line-height: 1.9; color: rgba(255, 255, 255, 0.82); }
    .lg-art { position: relative; width: 340px; height: 190px; margin-bottom: 34px; }
    .lg-cardx {
        position: absolute; inset: 34px 22px 26px 6px; transform: rotate(-7deg); border-radius: 18px; padding: 34px 22px 0; display: flex; gap: 8px; align-items: flex-start;
        background: linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(190, 210, 250, 0.9)); box-shadow: 0 26px 40px -20px rgba(5, 15, 50, 0.65);
        direction: ltr;
    }
    .lg-cardx i { width: 22px; height: 11px; border-radius: 3px; background: #3a62b8; }
    .lg-chip-a, .lg-chip-b {
        position: absolute; z-index: 2; padding: 5px 12px; border-radius: 9px; font-size: 11px; font-weight: 800; letter-spacing: 0.4px; color: #fff; white-space: nowrap; direction: ltr;
        background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.34); backdrop-filter: blur(6px);
    }
    .lg-chip-a { top: 0; inset-inline-start: 8px; }
    .lg-chip-b { bottom: 0; inset-inline-end: 0; }
    .lg-sf { font-size: 12.5px; font-weight: 700; color: rgba(255, 255, 255, 0.7); }

    /* الرأس: لا يرسم شيئا، يبقى عنوانه فقط ازرار الثيم واللغة في ركن عمود النموذج */
    .lg-page:not(.lg-legal) > .lg-hero, .lg-page:not(.lg-legal) > .lg-hero > .lg-in { display: contents; }
    .lg-page:not(.lg-legal) .lg-c1, .lg-page:not(.lg-legal) .lg-c2, .lg-page:not(.lg-legal) .lg-c3, .lg-page:not(.lg-legal) .lg-tile { display: none; }
    .lg-page:not(.lg-legal) .lg-hero .panel-top { position: absolute; top: 22px; inset-inline-end: 28px; z-index: 3; }
    html .lg-page .lg-hero .icon-btn, html .lg-page .lg-hero a.lang-switch.lang-globe {
        width: 40px !important; min-width: 40px !important; height: 40px !important; border-radius: 12px;
        border: 1px solid var(--border) !important; background: var(--surface) !important; color: var(--text) !important;
        box-shadow: 0 6px 14px -10px rgba(20, 40, 80, 0.5);
    }
    html .lg-page .lg-hero a.lang-switch.lang-globe { border-radius: 50%; }
    html .lg-page .lg-hero .icon-btn:hover, html .lg-page .lg-hero a.lang-switch.lang-globe:hover { border-color: var(--primary) !important; color: var(--primary) !important; }
    html .lg-page .lg-hero .icon-btn svg, html .lg-page .lg-hero a.lang-switch.lang-globe svg { color: inherit; stroke: currentColor; }

    /* العنوان فوق الحقول */
    .lg-page:not(.lg-legal) .lg-brand {
        grid-column: 2; grid-row: 2; justify-self: center; align-self: end; width: min(500px, calc(100% - 64px)); margin: 0 0 30px; text-align: start;
    }
    html .lg-page .lg-brand h1 { margin: 0 0 10px; font-size: 32px; font-weight: 800; line-height: 1.3; color: var(--text); }
    html .lg-page .lg-brand p { margin: 0; font-size: 14.5px; font-weight: 600; line-height: 1.7; color: var(--text-dim); }

    /* النموذج بلا بطاقة */
    .lg-page:not(.lg-legal) > .lg-wrap {
        grid-column: 2; grid-row: 3; justify-self: center; width: min(500px, calc(100% - 64px)); max-width: none; margin: 0; padding: 0 0 28px; flex: none;
    }
    .lg-page:not(.lg-legal) .lg-card { gap: 14px; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
    .lg-page:not(.lg-legal) .lg-form { gap: 14px; }
    .lg-page:not(.lg-legal) .lg-fld { min-height: 56px; border-radius: 14px; }
    .lg-page:not(.lg-legal) .lg-go { min-height: 56px; border-radius: 14px; box-shadow: 0 12px 22px -16px rgba(57, 120, 232, 0.9); }
    .lg-page:not(.lg-legal) .lg-g, .lg-page:not(.lg-legal) .lg-g .face { border-radius: 14px; }

    /* التبويبان ظاهران اعلى النموذج كما في الموبايل */
    .lg-page:not(.lg-legal) .lg-tabs { order: -2; margin-bottom: 2px; }
    .lg-page:not(.lg-legal) .lg-tabs span, .lg-page:not(.lg-legal) .lg-tabs a { min-height: 46px; border-radius: 12px; }
    .lg-page:not(.lg-legal) .lg-tabs { border-radius: 16px; }
    .lg-page:not(.lg-legal) .lg-form { order: -1; }

    /* فاصل "أو" بين الدخول وجوجل */
    .lg-page:not(.lg-legal) .lg-gblock { order: 2; }
    .lg-page:not(.lg-legal) .lg-rule:has(span) { order: 1; display: flex; align-items: center; gap: 14px; height: auto; margin: 2px 0; background: none; }
    .lg-page:not(.lg-legal) .lg-rule:has(span)::before, .lg-page:not(.lg-legal) .lg-rule:has(span)::after { content: ""; flex: 1; height: 1px; background: var(--border); }
    .lg-page:not(.lg-legal) .lg-rule:has(span) span { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-dim); }
    .lg-page:not(.lg-legal) .lg-msg { order: 0; }

    /* الدخول المباشر وتحميل التطبيق: بلاطتان جنبا الى جنب */
    .lg-page:not(.lg-legal) .lg-rows { order: 3; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .lg-page:not(.lg-legal) .lg-rows .lg-row { min-height: 56px; padding: 8px 12px; gap: 10px; border-radius: 14px; }
    .lg-page:not(.lg-legal) .lg-rows .lg-row .ic { width: 36px; height: 36px; border-radius: 11px; }
    .lg-page:not(.lg-legal) .lg-rows .lg-row .ic svg { width: 20px; height: 20px; }
    .lg-page:not(.lg-legal) .lg-rows .lg-row b { font-size: 13px; }

    /* باقي الصفحات: رابط ثانوي كنص بلا فاصل */
    .lg-page:not(.lg-legal) .lg-rule:not(:has(span)) { display: none; }
    .lg-page:not(.lg-legal) .lg-card > .lg-row { min-height: 40px; padding: 4px 2px; gap: 8px; border: 0; background: none; border-radius: 10px; color: var(--primary); }
    .lg-page:not(.lg-legal) .lg-card > .lg-row:hover { background: none; text-decoration: underline; }
    .lg-page:not(.lg-legal) .lg-card > .lg-row .ic, .lg-page:not(.lg-legal) .lg-card > .lg-row .ch { display: none; }
    .lg-page:not(.lg-legal) .lg-card > .lg-row b { font-size: 14px; color: var(--primary); }
    .lg-page:not(.lg-legal) .lg-fine { margin-top: 26px; }

    /* زر "ثبت التطبيق" العائم لا يغطي اللوحة */
    body:has(.lg-side) .mt-install { display: none; }
}
@media (min-width: 900px) and (max-width: 1099.98px) {
    .lg-page:not(.lg-legal) > .lg-side { padding: 36px 32px; }
    .lg-side h2 { font-size: 34px; }
    .lg-art { transform: scale(0.85); transform-origin: top start; }
}
@media (min-width: 900px) and (max-height: 720px) {
    .lg-sb { margin-bottom: 30px; }
    .lg-side p { margin-bottom: 24px; }
    .lg-art { display: none; }
}
