/* ====================================================================
   صفحة دخول المكتب (Account/Login) — تصميم معتمد (2026-10-27).
   مستقلة عن app.css: الـ tokens هنا على مستوى الصفحة بس (.lp)، بلا تدرّجات ولا ظلال تقيلة ولا حركات زخرفية.
   RTL: العمود الأول في الشبكة = اليمين (النموذج 44%)، والتاني = اليسار (لوحة الهوية 56%).
   ==================================================================== */
.lp-body {   /* على الـ body عشان خلفيته كمان تستخدمها؛ .lp بيورثها */
    --lp-ink: #141610;   /* أسود زيتي من التصميم المعتمد — مش لون الشريط (#2B3318) عشان الطبقة فوق الصورة تفضل محايدة */
    --lp-overlay: color-mix(in srgb, var(--lp-ink) 84%, transparent);
    --lp-olive: #566C2E;
    --lp-olive-dark: #46591F;
    --lp-gold: #B8962E;
    --lp-paper: #F5F4EF;
    --lp-on-ink: #F3F1EA;
    --lp-surface: #FFFFFF;
    --lp-text: #1A1E23;
    --lp-muted: #5B636D;
    --lp-border: #CFCBC1;
    --lp-divider: #DEDAD1;
    --lp-error: #B42318;
    --lp-error-bg: #FDF1EF; --lp-error-border: #F0C6BF; --lp-error-text: #8A1C12;
    --lp-notice-bg: #F3EEDF; --lp-notice-border: #D9D2BE; --lp-notice-text: #4A3F17;
    --lp-radius: 8px;
    --lp-sans: 'Cairo', Tahoma, Arial, sans-serif;
    --lp-serif: 'Noto Naskh Arabic', 'Cairo', serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body.lp-body { background: var(--lp-paper); }

.lp {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 44fr) minmax(0, 56fr);
    background: var(--lp-paper);
    color: var(--lp-text);
    font-family: var(--lp-sans);
    font-size: 16px;
    line-height: 1.6;
}

/* ===== جانب النموذج ===== */
.lp-main { display: flex; flex-direction: column; min-height: 100vh; padding: 56px 72px 40px; }
.lp-wrap { width: 100%; max-width: 400px; margin: auto; }
.lp-mlogo { display: none; }

.lp-title { margin: 0 0 8px; font-family: var(--lp-serif); font-weight: 700; font-size: 38px; line-height: 1.3; }
.lp-lead { margin: 0 0 28px; font-size: 16px; color: var(--lp-muted); }

/* رسائل أعلى الحقول: خطأ الدخول (أحمر) / حساب موقوف (هادئ) */
.lp-banner { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 20px; padding: 12px 14px; border: 1px solid; border-radius: var(--lp-radius); font-size: 14px; line-height: 1.6; }
.lp-banner svg { flex: none; width: 18px; height: 18px; margin-top: 2px; }
.lp-banner p { margin: 0; }
.lp-banner--error { background: var(--lp-error-bg); border-color: var(--lp-error-border); color: var(--lp-error-text); }
.lp-banner--notice { background: var(--lp-notice-bg); border-color: var(--lp-notice-border); color: var(--lp-notice-text); }

.lp-field { margin: 0 0 18px; }
.lp-label { display: block; margin: 0 0 6px; font-size: 14px; font-weight: 500; color: var(--lp-text); }
.lp .lp-input {
    display: block; width: 100%; height: 48px; margin: 0; padding: 0 14px;
    border: 1px solid var(--lp-border); border-radius: var(--lp-radius); background: var(--lp-surface);
    font: inherit; font-size: 16px; color: var(--lp-text);
}
.lp .lp-input:focus { outline: none; border-color: var(--lp-olive); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lp-olive) 22%, transparent); }
.lp .lp-input[aria-invalid="true"] { border-color: var(--lp-error); }
.lp .lp-input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(180, 35, 24, .18); }
.lp-err { display: block; margin-top: 6px; font-size: 13px; color: var(--lp-error); }
.lp-err:empty { display: none; }

/* كلمة المرور: زر الإظهار داخل الخانة في نهاية السطر (اليسار في RTL) */
.lp-pw { position: relative; }
.lp .lp-pw .lp-input { padding-inline-end: 52px; }
.lp-eye {
    position: absolute; top: 50%; inset-inline-end: 4px; transform: translateY(-50%);
    width: 44px; height: 40px; padding: 0; display: grid; place-items: center;
    border: 0; border-radius: 6px; background: none; color: var(--lp-muted); cursor: pointer;
}
.lp-eye:hover { color: var(--lp-text); }
.lp-eye svg { width: 20px; height: 20px; }
.lp-eye .lp-eye-off, .lp-eye[aria-pressed="true"] .lp-eye-on { display: none; }
.lp-eye[aria-pressed="true"] .lp-eye-off { display: block; }

.lp-check { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0 0 14px; font-size: 15px; cursor: pointer; }
.lp-check input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--lp-olive); cursor: pointer; }

.lp-captcha { display: flex; justify-content: center; margin: 0 0 16px; }

.lp-btn {
    width: 100%; height: 52px; display: flex; align-items: center; justify-content: center; gap: 10px;
    border: 0; border-radius: var(--lp-radius); background: var(--lp-olive); color: #fff;
    font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; transition: background-color 150ms;
}
.lp-btn:hover { background: var(--lp-olive-dark); }
.lp-btn[aria-busy="true"] { background: var(--lp-olive-dark); cursor: progress; }
.lp-btn:disabled { opacity: 1; }
.lp-spin { display: none; width: 18px; height: 18px; animation: lp-spin .8s linear infinite; }
.lp-btn[aria-busy="true"] .lp-spin { display: block; }
@keyframes lp-spin { to { transform: rotate(360deg); } }

.lp-btn:focus-visible, .lp-eye:focus-visible, .lp-check input:focus-visible { outline: 2px solid var(--lp-olive); outline-offset: 2px; }

.lp-help { margin: 24px 0 0; padding-top: 18px; border-top: 1px solid var(--lp-divider); text-align: center; font-size: 14px; color: var(--lp-muted); }
.lp-foot { margin: 32px 0 0; text-align: center; font-size: 13px; color: var(--lp-muted); }

/* ===== لوحة الهوية: صورة المكتب + طبقة صلبة (بلا تدرّج) ===== */
.lp-brand {
    position: relative; display: flex; flex-direction: column; justify-content: space-between;
    padding: 64px 72px; color: var(--lp-on-ink);
    background: var(--lp-ink) var(--lp-photo, url("../images/branding/login-office.jpg")) center 40% / cover no-repeat;   /* --lp-photo = صورة الماستر */
}
.lp-brand::before { content: ""; position: absolute; inset: 0; background: var(--lp-overlay); }
.lp-brand > * { position: relative; }
.lp-brand-logo { display: block; width: 360px; max-width: 100%; height: auto; }
/* من غير شعار (اختيار الماستر): اسم المكتب مكانه */
.lp-brand-name { margin: 0; max-width: 420px; font-family: var(--lp-serif); font-weight: 700; font-size: 30px; line-height: 1.5; color: #fff; }
/* ختم المكتب (من غير شعار): أول حرف من الاسم في دايرة ذهبية */
.lp-ident { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.lp-seal { position: relative; width: 76px; height: 76px; border-radius: 50%; border: 1.5px solid var(--lp-gold); display: grid; place-items: center; flex: none; }
.lp-seal::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--lp-gold) 55%, transparent); }
.lp-seal span { font-family: var(--lp-serif); font-weight: 700; font-size: 32px; line-height: 1; color: var(--lp-gold); }

/* ===== مشهد «الميزان» — من غير صورة خلفية (اختيار الماستر) ===== */
.lp-brand.is-scene { overflow: hidden; }
.lp-glow { position: absolute; left: 50%; top: 55%; width: 520px; height: 520px; border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--lp-gold) 16%, transparent), transparent); transition: left .6s, top .6s; }
.lp-scales { flex: 1; min-height: 0; display: grid; place-items: center; padding: 16px 0; pointer-events: none; }
.lp-scales svg { width: min(70%, 340px); max-height: 38vh; height: auto; }
.lp-ln { fill: none; stroke: var(--lp-gold); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 900; stroke-dashoffset: 900; animation: lp-draw 2.6s ease forwards; }
.lp-ln.is-faint { stroke: rgba(243, 241, 234, .18); stroke-width: 1; }
@keyframes lp-draw { to { stroke-dashoffset: 0; } }
.lp-beam { transform-origin: 200px 92px; transition: transform 1.2s cubic-bezier(.3, .8, .3, 1); animation: lp-sway 7s ease-in-out 2.6s infinite; }
@keyframes lp-sway { 0%, 100% { transform: rotate(-2.2deg); } 50% { transform: rotate(2.2deg); } }
.lp-quotes { min-height: 132px; }
.lp-quotes .lp-values { transition: opacity .6s, transform .6s; }
.lp-quotes .lp-values.is-out { opacity: 0; transform: translateY(8px); }
.lp-qsrc { display: block; min-height: 1.4em; margin-top: 6px; font-size: 13px; color: var(--lp-gold); }
.lp-qdots { display: flex; gap: 6px; margin-top: 12px; }
.lp-qdots i { width: 18px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .25); }
.lp-qdots i.is-on { background: var(--lp-gold); }

.lp-mname { margin: 0; font-family: var(--lp-serif); font-weight: 700; font-size: 24px; line-height: 1.5; color: var(--lp-text); }
.lp-rule { width: 56px; height: 2px; margin: 0 0 18px; background: var(--lp-gold); }
.lp-values { margin: 0; font-family: var(--lp-serif); font-weight: 600; font-size: 30px; line-height: 1.7; color: var(--lp-on-ink); }

/* ===== الشاشات القصيرة (لابتوب 1366×650): النموذج كامل بلا تمرير ===== */
@media (min-width: 1024px) and (max-height: 720px) {
    .lp-main { padding: 28px 72px 20px; }
    .lp-title { font-size: 32px; }
    .lp-lead { margin-bottom: 18px; }
    .lp-field { margin-bottom: 12px; }
    .lp-check { margin-bottom: 8px; }
    .lp-help { margin-top: 16px; padding-top: 12px; }
    .lp-foot { margin-top: 16px; }
    .lp-brand { padding: 40px 72px; }
    .lp-values { font-size: 26px; }
    .lp-ident { gap: 10px; }
    .lp-seal { width: 60px; height: 60px; }
    .lp-seal span { font-size: 26px; }
    .lp-brand-name { font-size: 26px; }
    .lp-scales svg { max-height: 30vh; }
    .lp-quotes { min-height: 110px; }
}

/* ===== تابلت (768–1023): الهوية شريط علوي بالشعار بس، والنموذج تحته ===== */
@media (max-width: 1023px) {
    .lp { grid-template-columns: minmax(0, 1fr); align-content: start; }
    .lp-brand { order: -1; height: 220px; padding: 24px; align-items: center; justify-content: center; }
    .lp-brand-logo { width: 280px; }
    .lp-brand-name { text-align: center; font-size: 26px; }
    .lp-ident { align-items: center; gap: 10px; }
    .lp-seal { width: 56px; height: 56px; }
    .lp-seal span { font-size: 24px; }
    .lp-scales, .lp-glow { display: none; }
    .lp-brand-values { display: none; }
    .lp-main { min-height: 0; padding: 40px 24px 28px; }
    .lp-wrap { max-width: 440px; margin: 0 auto; }
}

/* ===== موبايل (< 768): بلا لوحة داكنة — الشعار الملوّن أعلى الصفحة ===== */
@media (max-width: 767px) {
    .lp-brand { display: none; }
    .lp-main { min-height: 100vh; padding: 40px 24px 28px; }
    .lp-mlogo { display: block; margin: 0 auto 28px; text-align: center; }
    .lp-mlogo img { display: block; width: min(280px, 80vw); height: auto; margin: 0 auto; }
    .lp-mlogo .lp-rule { width: 40px; margin: 16px auto 0; }
    .lp-wrap { margin: 0 auto; }
    .lp-title { font-size: 30px; }
    .lp .lp-input { height: 50px; }
    .lp-foot { margin-top: auto; padding-top: 28px; }
}

/* معاينة الماستر: شريط تنبيه فوق الصفحة */
.lp-preview-bar { position: sticky; top: 0; z-index: 5; padding: 8px 16px; text-align: center; font: 600 13px var(--lp-sans); background: var(--lp-notice-bg); color: var(--lp-notice-text); border-bottom: 1px solid var(--lp-notice-border); }

@media (prefers-reduced-motion: reduce) {
    .lp-spin { animation: none; }
    .lp-ln { animation: none; stroke-dashoffset: 0; }
    .lp-beam, .lp-glow { animation: none; transition: none; }
    .lp-btn { transition: none; }
}
