/* Layout: top bar + centered working column; exam view gets a two-pane body (question / navigator).
   Identity: Qarar brand navy + gold (from the platform banner), with the highlighter yellow the answer sheets use for correct answers. */
:root {
  --bg: #f3f6fa;
  --surface: #ffffff;
  --surface-2: #edf2f8;
  --line: #d9e1ec;
  --ink: #142033;
  --ink-2: #4b5a70;
  --ink-3: #7a879a;
  --primary: #174f93;      /* كحلي قرار */
  --primary-ink: #ffffff;
  --primary-soft: #e3ecf8;
  --gold: #b48a35;         /* ذهبي قرار */
  --orange: #f97316;       /* لون التفاعل عند المرور */
  --orange-strong: #ea580c;
  --orange-ink: #c2410c;   /* نص برتقالي مقروء على الخلفية الفاتحة */
  --hl: #fde56a;           /* قلم التظليل */
  --hl-ink: #3b3000;
  --letter: #c62d2d;       /* لون حروف الخيارات كما في الأوراق */
  --good: #15803d; --good-soft: #dcf3e3;
  --mid: #b45309;  --mid-soft: #fdefd6;
  --low: #c0262d;  --low-soft: #fbe2e2;
  --shadow: 0 1px 2px rgba(16, 40, 30, .06), 0 6px 18px rgba(16, 40, 30, .06);
  --radius: 12px;
  --font-body: 'Calibri', 'Carlito', Arial, 'Segoe UI', Tahoma, system-ui, sans-serif;
  --font-display: 'Calibri', 'Carlito', Arial, 'Segoe UI', Tahoma, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e141d; --surface: #151d29; --surface-2: #1b2533; --line: #283446;
    --ink: #e7edf6; --ink-2: #a9b5c7; --ink-3: #7b889c;
    --primary: #6ea3e8; --primary-ink: #0a1a30; --primary-soft: #1a2b45; --gold: #d8b468; --orange-ink: #fb923c;
    --hl: #e6c935; --hl-ink: #241d00; --letter: #f07272;
    --good: #4ade80; --good-soft: #163524; --mid: #fbbf24; --mid-soft: #3a2c0e; --low: #f87171; --low-soft: #3d1a1b;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e141d; --surface: #151d29; --surface-2: #1b2533; --line: #283446;
  --ink: #e7edf6; --ink-2: #a9b5c7; --ink-3: #7b889c;
  --primary: #6ea3e8; --primary-ink: #0a1a30; --primary-soft: #1a2b45; --gold: #d8b468; --orange-ink: #fb923c;
  --hl: #e6c935; --hl-ink: #241d00; --letter: #f07272;
  --good: #4ade80; --good-soft: #163524; --mid: #fbbf24; --mid-soft: #3a2c0e; --low: #f87171; --low-soft: #3d1a1b;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
/* حجم الخط الأساسي: كل المقاسات بالـ rem فتكبر معه — كمبيوتر / آيباد / جوال */
html { font-size: 20px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (max-width: 1100px) { html { font-size: 19.5px; } }
@media (max-width: 760px) { html { font-size: 18.5px; } }
@media (max-width: 380px) { html { font-size: 17.5px; } }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 1rem; line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.3; margin: 0; text-wrap: balance; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0; }
a { color: inherit; }
code { font-size: .9em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
mark { background: linear-gradient(transparent 55%, var(--hl) 55%); color: inherit; padding: 0 2px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.tnum, .tiles strong, .pill, .num-chip { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.center { text-align: center; justify-content: center; }
.t-good { color: var(--good); } .t-mid { color: var(--mid); } .t-low { color: var(--low); }
.danger-text { color: var(--low) !important; }

/* ---------- أزرار وحقول ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 16px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: 500 .95rem var(--font-body); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: var(--low); border-color: var(--low); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: .85rem; border-radius: 7px; }
.btn.lg { min-height: 46px; font-size: 1.02rem; }
.btn.block { width: 100%; }
.btn.dashed { border-style: dashed; background: transparent; color: var(--primary); min-height: 52px; margin-top: 12px; }
.btn.pulse { box-shadow: 0 0 0 3px color-mix(in srgb, var(--hl) 70%, transparent); }
.icon-btn { border: 0; background: transparent; color: var(--ink-2); width: 32px; height: 32px; border-radius: 7px; cursor: pointer; font-size: 1rem; }
.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--primary); text-decoration: none; cursor: pointer; font: inherit; }
.link:hover { text-decoration: underline; }
.link.strong { font-weight: 600; color: var(--ink); }
.link.back { font-size: .88rem; display: inline-block; margin-bottom: 4px; }

.input {
  width: 100%; min-height: 40px; padding: 8px 12px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: 400 .95rem var(--font-body);
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input:disabled { background: var(--surface-2); color: var(--ink-3); }
.input.sm { min-height: 32px; padding: 4px 8px; width: auto; font-size: .88rem; }
textarea.input { resize: vertical; line-height: 1.7; }
.mono, .mono-ar { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: .85rem; }
.mono-ar { font-family: var(--font-body); font-size: .92rem; white-space: pre-wrap; }
.input.search { max-width: 340px; }
.input-group { display: flex; gap: 8px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: .88rem; font-weight: 500; color: var(--ink-2); }
.field small { font-weight: 400; color: var(--ink-3); }
.field.check { flex-direction: row; align-items: center; gap: 8px; cursor: pointer; }
.field.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.field.collapsed { display: none; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-err { color: var(--low); background: var(--low-soft); padding: 8px 12px; border-radius: 8px; font-size: .9rem; }
.hint { color: var(--ink-3); font-size: .85rem; margin-top: 6px; }

/* ---------- عناصر صغيرة ---------- */
.pill { display: inline-flex; align-items: center; padding: 1px 9px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.mid { background: var(--mid-soft); color: var(--mid); }
.pill.low { background: var(--low-soft); color: var(--low); }
.pill.st-active { background: var(--good-soft); color: var(--good); }
.pill.st-pending { background: var(--mid-soft); color: var(--mid); }
.pill.st-disabled { background: var(--low-soft); color: var(--low); }
.pill.role-admin { background: var(--primary); color: var(--primary-ink); }
.pill.role-teacher { background: var(--primary-soft); color: var(--primary); }
.num-chip { display: inline-grid; place-items: center; min-width: 28px; height: 24px; padding: 0 6px; margin-inline-end: 8px; border-radius: 6px; background: var(--hl); color: var(--hl-ink); font-weight: 700; font-size: .82rem; }
.count { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font: 600 .8rem var(--font-body); vertical-align: middle; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 4px 13px; font: 500 .85rem var(--font-body); cursor: pointer; }
.chip.on { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.sec-tag { font-size: .78rem; font-weight: 600; color: var(--primary); background: var(--primary-soft); padding: 1px 8px; border-radius: 5px; }
.letter { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 6px; border: 1.5px solid currentColor; color: var(--letter); font-weight: 700; font-size: .95rem; }
.toggle { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-3); border-radius: 999px; padding: 2px 12px; font: 600 .8rem var(--font-body); cursor: pointer; }
.toggle.on { background: var(--good-soft); color: var(--good); border-color: transparent; }

.loading { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--ink-3); padding: 60px 0; }
.loading.full { min-height: 100vh; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--primary); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 36px 16px; color: var(--ink-2); }
.empty strong { font-family: var(--font-display); font-size: 1.1rem; color: var(--ink); font-weight: 700; }
.empty p { max-width: 46ch; color: var(--ink-3); }
.empty .btn, .empty .head-actions { margin-top: 6px; }

/* ---------- الدخول ---------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; }
.auth-banner { background: var(--surface); border-bottom: 4px solid var(--primary); }
.auth-banner img { display: block; width: 100%; max-width: 1600px; height: auto; margin: 0 auto; }
.auth-body { flex: 1; width: 100%; margin: 0 auto; display: flex; justify-content: center; align-items: flex-start; padding-block: 28px 48px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.auth-info { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.auth-info h1 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.45; color: var(--primary); }
.auth-info mark { background: linear-gradient(transparent 60%, color-mix(in srgb, var(--gold) 40%, transparent) 60%); color: inherit; }
.auth-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; color: var(--ink-2); font-size: .95rem; }
.auth-points b { color: var(--ink); }
.sample-q { background: #fff; color: #16211d; border: 1px solid #d9e1ec; border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow); max-width: 440px; }
.sq-label { font-size: .75rem; font-weight: 700; color: #b48a35; }
.sq-stem { font-weight: 700; color: #c62d2d; margin: 2px 0 10px; font-size: 1.05rem; }
.sq-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: .9rem; }
.sq-opts span { border: 1px solid #d9e1ec; border-radius: 6px; padding: 4px 8px; }
.sq-opts .hl { background: #fde56a; border-color: #e8cf4c; font-weight: 600; }
.auth-main { display: flex; justify-content: center; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 18px; }
.auth-card.center { align-items: center; text-align: center; }
.auth-card.center .logo { width: 64px; height: 64px; }
.tabs { display: flex; background: var(--surface-2); border-radius: 10px; padding: 4px; }
.tab { flex: 1; border: 0; background: transparent; padding: 8px; border-radius: 7px; font: 700 .95rem var(--font-body); color: var(--ink-2); cursor: pointer; }
.tab.on { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
.demo-box { border: 1px dashed var(--line); border-radius: 10px; padding: 12px; font-size: .88rem; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.demo-accounts { display: flex; flex-wrap: wrap; gap: 6px; }
.blocked { min-height: 100vh; display: grid; place-items: center; padding-block: 24px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.blocked p { color: var(--ink-2); }
.pw-wrap { position: relative; display: block; }
.pw-wrap .input { padding-inline-end: 46px; }
.pw-toggle { position: absolute; top: 50%; inset-inline-end: 6px; transform: translateY(-50%); width: 34px; height: 34px; display: grid; place-items: center; border: 0; background: transparent; border-radius: 7px; color: var(--ink-3); cursor: pointer; }
.pw-wrap .input[dir="ltr"] ~ .pw-toggle { inset-inline-end: auto; left: 6px; }
.pw-wrap .input[dir="ltr"] { padding-inline-end: 12px; padding-left: 46px; }
.pw-toggle:hover { background: var(--surface-2); color: var(--primary); }
.pw-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.forgot-head { display: flex; flex-direction: column; gap: 6px; }
.forgot-head h2 { font-size: 1.25rem; color: var(--primary); }
.forgot-head p { color: var(--ink-2); font-size: .92rem; }
.sent-box { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding-block: 8px; }
.sent-box h2 { font-size: 1.25rem; color: var(--primary); }
.sent-box p { color: var(--ink-2); }
.sent-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--good-soft); color: var(--good); font-size: 1.6rem; font-weight: 800; }
.bell { position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); border: 1px solid var(--line); background: var(--surface); flex: none; }
.bell:hover { color: var(--primary); border-color: var(--primary); }
.bell.has { color: var(--primary); }
.bell svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bell-count { position: absolute; top: -4px; inset-inline-end: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--low); color: #fff; font-size: .72rem; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--surface); }
.min0 { min-width: 0; }
.hero-banner { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }

/* ---------- الإطار ---------- */
.logo { width: 40px; height: 40px; flex: none; object-fit: contain; background: #fff; border-radius: 10px; padding: 2px; }
.brand-line { display: inline-flex; align-items: center; gap: 10px; font: 700 1.08rem var(--font-display); text-decoration: none; color: var(--ink); white-space: nowrap; }
.demo-strip { background: var(--hl); color: var(--hl-ink); text-align: center; font-size: .82rem; font-weight: 600; padding: 4px 16px; }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--surface); }
.topbar-inner { max-width: 1320px; margin: 0 auto; display: flex; align-items: center; gap: 28px; min-height: 64px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.nav { display: flex; gap: 6px; flex: 1; min-width: 0; align-self: stretch; overflow-x: auto; scrollbar-width: none; }
.nav a { display: flex; align-items: center; text-decoration: none; color: var(--ink-2); padding: 0 14px; font-weight: 600; font-size: .95rem; white-space: nowrap; border-bottom: 3px solid transparent; border-top: 3px solid transparent; transition: color .15s, border-color .15s; }
.nav a:hover { color: var(--primary); }
.nav a.on { color: var(--primary); border-bottom-color: var(--gold); }
.profile { position: relative; }
.profile-btn { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 4px 6px 4px 12px; font: 600 .9rem var(--font-body); cursor: pointer; }
.profile-btn:hover, .profile-btn[aria-expanded="true"] { border-color: var(--primary); }
.caret { width: 12px; height: 12px; fill: none; stroke: var(--ink-3); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.profile-menu { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; min-width: 240px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(20, 32, 51, .16); padding: 6px; z-index: 40; display: flex; flex-direction: column; }
.pm-head { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.pm-head span[dir] { color: var(--ink-3); font-size: .82rem; }
.pm-head .pill { margin-top: 6px; }
.profile-menu a, .profile-menu button { text-align: start; text-decoration: none; color: var(--ink); background: none; border: 0; padding: 9px 12px; border-radius: 8px; font: 500 .92rem var(--font-body); cursor: pointer; }
.profile-menu a:hover, .profile-menu button:hover { background: var(--surface-2); }
.profile-menu .pm-out { color: var(--low); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); display: grid; place-items: center; font-weight: 700; }
.user-name { font-size: .9rem; font-weight: 500; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page { max-width: 1320px; margin: 0 auto; padding-block: 28px 64px; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 20px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head > div:first-child { min-width: 0; text-align: start; }
.page-head .sub { color: var(--ink-2); font-size: .9rem; margin-top: 4px; }
.sticky-head { position: sticky; top: calc(62px + env(safe-area-inset-top, 0px)); z-index: 10; background: var(--bg); padding-block: 10px; margin-block: -10px; }
.eyebrow { font-size: .8rem; font-weight: 700; color: var(--gold); letter-spacing: .02em; margin-bottom: 2px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mini-stats { display: flex; gap: 18px; color: var(--ink-2); font-size: .9rem; }
.mini-stats b { color: var(--ink); font-size: 1.15rem; margin-inline-end: 4px; }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.toolbar .input:not(.search) { width: auto; }
.toolbar.split { justify-content: space-between; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.toolbar.split .input.search { flex: 1; max-width: 420px; background: var(--surface-2); border-color: transparent; }
.toolbar.split .input.search:focus { background: var(--surface); border-color: var(--primary); }

/* بطاقات الإحصائيات للطالب */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.metric { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.metric-label { font-size: .82rem; color: var(--ink-2); font-weight: 500; }
.metric strong { font: 800 1.6rem var(--font-display); line-height: 1.25; font-variant-numeric: tabular-nums; }
.metric strong small { font: 600 .9rem var(--font-body); color: var(--ink-3); }
.metric-bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 4px; }
.metric-bar span { display: block; height: 100%; background: var(--gold); border-radius: 999px; }

/* شريط الهوية */
.brand-hero { position: relative; display: flex; align-items: stretch; justify-content: space-between; height: 190px; border-radius: 16px; overflow: hidden; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, #1f5fae 0%, #154688 45%, #0f3466 100%); box-shadow: 0 10px 30px rgba(15, 52, 102, .18); }
.brand-hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 5px; background: linear-gradient(90deg, #b48a35, #e2c27a, #b48a35); }
.bh-text { display: flex; align-items: center; gap: 22px; padding: 22px 28px; min-width: 0; z-index: 1; }
.bh-logo { width: 88px; height: 88px; flex: none; background: #fff; border-radius: 22px; padding: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.bh-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bh-copy h2 { font: 800 clamp(1.35rem, 2.4vw, 1.9rem) var(--font-display); color: #fff; line-height: 1.35; }
.bh-copy h2 span { color: #e2c27a; }
.bh-name { font: 700 1.05rem var(--font-display); color: #fff; opacity: .95; }
.bh-tag { color: #e2c27a; font-weight: 600; font-size: .95rem; }
.bh-social { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.bh-social a { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.14); transition: background .15s; }
.bh-social a:hover { background: #e2c27a; }
.bh-social svg { width: 17px; height: 17px; fill: #fff; }
.bh-social a:hover svg { fill: #0f3466; }
.bh-social span { font-size: .88rem; font-weight: 600; color: rgba(255,255,255,.9); margin-inline-start: 4px; }
.bh-photo { width: 280px; height: 100%; flex: none; object-fit: cover; object-position: 50% 12%; -webkit-mask-image: linear-gradient(to right, #000 55%, transparent); mask-image: linear-gradient(to right, #000 55%, transparent); }
.auth-top { width: 100%; max-width: 1240px; margin: 0 auto; padding-top: 24px; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.narrow { max-width: 640px; }
.panel.notice { border-color: color-mix(in srgb, var(--hl) 70%, var(--line)); background: color-mix(in srgb, var(--hl) 10%, var(--surface)); }
.panel-title { font-size: 1rem; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head .panel-title { margin-bottom: 0; }
.panel-head.between { margin-bottom: 0; }
.h2 { display: flex; align-items: center; gap: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-2.align-start { align-items: start; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.tile-label { font-size: .82rem; color: var(--ink-2); }
.tile strong { font: 700 1.7rem var(--font-display); line-height: 1.3; }
.tile strong.tile-small { font-size: 1.05rem; padding-top: 8px; }
.tile small { color: var(--ink-3); font-size: .8rem; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: start; font-weight: 600; font-size: .8rem; color: var(--ink-3); padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.panel:not(.flush) .table th { background: transparent; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table.compact td { padding: 8px 10px; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: var(--surface-2); }
.table tr.row-err td { background: var(--low-soft); }
.table th.sortable { cursor: pointer; user-select: none; }
.table th[data-dir="asc"]::after { content: " ▲"; font-size: .7em; }
.table th[data-dir="desc"]::after { content: " ▼"; font-size: .7em; }
.row-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.rows { list-style: none; margin: 0; padding: 0; }
.row-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.row-item:last-child { border-bottom: 0; }

/* أشرطة الأقسام */
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 104px; gap: 10px; align-items: center; font-size: .9rem; }
.bar-label { font-weight: 500; }
.bar-track { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; }
.bar-fill.good { background: var(--good); } .bar-fill.mid { background: var(--mid); } .bar-fill.low { background: var(--low); }
.bar-val { font-variant-numeric: tabular-nums; font-weight: 600; }
.bar-val small { color: var(--ink-3); font-weight: 400; }

/* تطور الدرجات */
.trend { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding: 18px 4px 0; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to top, transparent 0 33px, var(--surface-2) 33px 34px); }
.trend-col { flex: 1; max-width: 46px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; text-decoration: none; }
.trend-bar { width: 100%; border-radius: 5px 5px 0 0; min-height: 3px; }
.trend-bar.good { background: var(--good); } .trend-bar.mid { background: var(--mid); } .trend-bar.low { background: var(--low); }
.trend-col:hover .trend-bar { filter: brightness(1.15); }
.trend-val { font-size: .72rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* الأسئلة في المراجعة */
.wrong-list { display: flex; flex-direction: column; gap: 12px; }
.wq { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.wq.bad { border-inline-start: 3px solid var(--low); }
.wq.ok { border-inline-start: 3px solid var(--good); }
.wq-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .82rem; color: var(--ink-3); }
.wq-text { font-weight: 600; font-size: 1.02rem; }
.opt-review { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.opt-review li { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: .93rem; min-width: 0; }
.opt-review li span { flex: 1; min-width: 0; }
.opt-review li em { font-style: normal; font-size: .75rem; font-weight: 600; color: var(--ink-2); }
.opt-review li.is-correct { background: var(--hl); color: var(--hl-ink); border-color: transparent; font-weight: 600; }
.opt-review li.is-correct em { color: var(--hl-ink); }
.opt-review li.is-wrong { background: var(--low-soft); border-color: var(--low); }
.opt-review li.is-wrong em { color: var(--low); }
.explain { font-size: .9rem; color: var(--ink-2); background: var(--surface-2); padding: 8px 12px; border-radius: 8px; }
.passage { white-space: pre-line; margin: 0; padding: 14px 16px; background: var(--surface-2); border-inline-start: 4px solid var(--primary); border-radius: 8px; font-size: 1.02rem; line-height: 1.9; }
.passage.small { font-size: .9rem; padding: 8px 12px; }

/* ---------- قائمة الاختبارات للطالب ---------- */
.test-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.test-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 6px; transition: border-color .15s, box-shadow .15s; }
.test-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.test-card h3 { font-size: 1.08rem; }
.tc-top { display: flex; align-items: center; gap: 8px; justify-content: space-between; min-height: 30px; }
.tc-num { font: 800 1.25rem var(--font-display); color: var(--gold); }
.tc-best { font-size: .78rem; color: var(--ink-3); display: flex; gap: 6px; align-items: center; margin-inline-start: auto; }
.tc-meta { color: var(--ink-3); font-size: .85rem; margin-bottom: 8px; }
.test-card .btn { margin-top: auto; }

/* ---------- صفحة حل الاختبار ---------- */
.take { display: flex; flex-direction: column; gap: 18px; }
.take-head { position: sticky; top: calc(62px + env(safe-area-inset-top, 0px)); z-index: 10; background: var(--bg); padding-block: 8px 0; display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: end; }
.take-head h1 { font-size: 1.35rem; }
.take-status { display: flex; gap: 12px; align-items: center; font-size: .9rem; color: var(--ink-2); }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; background: var(--surface); border: 1px solid var(--line); padding: 3px 12px; border-radius: 999px; color: var(--ink); }
.timer.warn { background: var(--low-soft); color: var(--low); border-color: var(--low); }
.progress { grid-column: 1 / -1; height: 4px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--primary); transition: width .25s; }
.take-body { display: grid; grid-template-columns: 1fr 250px; gap: 20px; align-items: start; }
.q-area { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 26px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.q-section { font-size: .82rem; font-weight: 600; color: var(--primary); }
.q-text { font-family: var(--font-body); font-size: 1.3rem; font-weight: 700; line-height: 1.7; display: flex; gap: 12px; align-items: baseline; }
.q-n { display: inline-grid; place-items: center; flex: none; min-width: 32px; height: 32px; padding: 0 6px; border-radius: 8px; background: var(--primary); color: var(--primary-ink); font-size: .9rem; font-variant-numeric: tabular-nums; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.option { display: flex; align-items: center; gap: 12px; text-align: start; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 10px; padding: 12px 14px; font: 500 1.05rem var(--font-body); cursor: pointer; min-height: 56px; transition: border-color .12s, background .12s; }
.option:hover { border-color: var(--primary); }
.option.picked { border-color: var(--primary); background: var(--primary-soft); }
.option.picked .letter { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.q-actions { display: flex; justify-content: space-between; gap: 10px; padding-top: 6px; }
.q-nav { position: sticky; top: calc(150px + env(safe-area-inset-top, 0px)); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.q-nav-title { font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.q-dots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.dot { aspect-ratio: 1; max-width: 100%; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 8px; font: 600 .82rem var(--font-body); cursor: pointer; font-variant-numeric: tabular-nums; }
.dot.answered { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.dot.current { outline: 2px solid var(--gold); outline-offset: 1px; }

/* النتيجة */
.result-hero { display: grid; grid-template-columns: auto auto 1fr; gap: 32px; align-items: center; }
.ring { width: 150px; height: 150px; }
.ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 12; }
.ring-fg { fill: none; stroke-width: 12; stroke-linecap: round; }
.ring-fg.good { stroke: var(--good); } .ring-fg.mid { stroke: var(--mid); } .ring-fg.low { stroke: var(--low); }
.ring-text { fill: var(--ink); font: 700 26px var(--font-display); }
.result-counts { display: flex; flex-direction: column; gap: 6px; font-size: .95rem; }
.result-counts b { font-size: 1.2rem; margin-inline: 4px; font-variant-numeric: tabular-nums; }
.dot-legend { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.dot-legend.ok { background: var(--good); } .dot-legend.bad { background: var(--low); } .dot-legend.skip { background: var(--ink-3); }
.result-sections { min-width: 0; }

/* ---------- محرر الاختبار ---------- */
.meta-grid { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 12px; align-items: end; margin-bottom: 12px; }
.q-list { display: flex; flex-direction: column; gap: 12px; }
.q-edit { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.q-edit-head { display: flex; align-items: center; gap: 10px; }
.q-tools { margin-inline-start: auto; display: flex; gap: 2px; }
.opt-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt-row { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 9px; border: 1px solid transparent; }
.opt-row input[type=radio] { width: 18px; height: 18px; accent-color: var(--primary); flex: none; cursor: pointer; }
.opt-row.is-correct { background: color-mix(in srgb, var(--hl) 45%, transparent); border-color: var(--hl); }
.opt-row .input { min-height: 36px; }

/* الاستيراد */
.drop { display: grid; place-items: center; border: 2px dashed var(--line); border-radius: 12px; padding: 34px 16px; text-align: center; cursor: pointer; color: var(--ink-2); margin-top: 12px; }
.drop:hover, .drop.over { border-color: var(--primary); background: var(--primary-soft); }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop b { color: var(--primary); }
#imp-text { margin: 12px 0; }
.format-help { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.modal .format-help { margin-bottom: 12px; }
.format-help summary { cursor: pointer; font-weight: 600; color: var(--primary); }
.format-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin-top: 12px; }
.format-grid pre { margin: 0; background: var(--surface-2); border-radius: 8px; padding: 12px; line-height: 1.7; overflow-x: auto; }
.format-rules { margin: 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 6px; font-size: .92rem; color: var(--ink-2); }

/* المستخدمين */
.roles-help { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.roles-help > div { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; font-size: .88rem; color: var(--ink-2); }
.roles-help b { display: block; color: var(--ink); font-family: var(--font-display); font-weight: 700; }
.cred { background: var(--surface-2); border-radius: 8px; padding: 12px; font-family: ui-monospace, Consolas, monospace; margin-top: 10px; text-align: left; }

/* المفاتيح */
.switch { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch-ui { flex: none; width: 42px; height: 24px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; margin-top: 2px; }
.switch-ui::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: inset-inline-start .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .switch-ui { background: var(--primary); }
.switch input:checked + .switch-ui::after { inset-inline-start: 21px; }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--primary); outline-offset: 2px; }
.switch b { display: block; font-weight: 600; }
.switch small { color: var(--ink-3); font-size: .85rem; }

/* النوافذ والتنبيهات */
.modal-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(10, 20, 16, .45); display: grid; place-items: center; padding-block: 16px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: 16px; box-shadow: 0 30px 60px rgba(0,0,0,.25); display: flex; flex-direction: column; }
.modal.wide { max-width: 860px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.toast { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); z-index: 200; background: var(--primary); color: var(--primary-ink); padding: 10px 18px; border-radius: 10px; font-weight: 500; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.toast.err { background: var(--low); color: #fff; }
.toast.warn { background: var(--hl); color: var(--hl-ink); }


/* ================= واجهة الطالب: لمسة حيوية ================= */
.page::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(900px 420px at 85% -10%, color-mix(in srgb, var(--primary) 9%, transparent), transparent 70%),
              radial-gradient(700px 380px at 0% 30%, color-mix(in srgb, var(--gold) 8%, transparent), transparent 70%); }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn svg path[d^="M7 4.5"] { fill: currentColor; }
.btn.soft { background: var(--primary-soft); border-color: transparent; color: var(--primary); }
.btn.soft:hover { background: color-mix(in srgb, var(--primary) 16%, var(--surface)); }

.welcome { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.welcome h1 { font-size: 1.7rem; color: var(--ink); }
.welcome p { color: var(--ink-2); margin-top: 2px; }
.wave { display: inline-block; transform-origin: 70% 70%; animation: wave 2.4s ease-in-out 1s 2; }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(16deg); } 20%, 40% { transform: rotate(-8deg); } }
.cta { gap: 10px; padding: 0 22px; border-radius: 12px; box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 30%, transparent); background: linear-gradient(135deg, #1f5fae, var(--primary)); }
.cta:hover { transform: translateY(-1px); box-shadow: 0 12px 26px color-mix(in srgb, var(--primary) 36%, transparent); }

/* بطاقات الإحصائيات بأيقونات ملونة */
.metric { flex-direction: row; align-items: center; gap: 14px; padding: 16px; position: relative; overflow: hidden; transition: transform .2s, box-shadow .2s; }
.metric:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.metric::after { content: ""; position: absolute; inset-inline-end: -26px; bottom: -26px; width: 90px; height: 90px; border-radius: 50%; background: var(--m-soft); opacity: .7; }
.m-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; position: relative; z-index: 1; }
.m-icon { width: 50px; height: 50px; flex: none; border-radius: 14px; display: grid; place-items: center; color: #fff; background: var(--m-grad); box-shadow: 0 8px 18px var(--m-shadow); position: relative; z-index: 1; }
.m-icon svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.metric strong { color: var(--m-ink); }
.m-blue  { --m-grad: linear-gradient(135deg, #3b82f6, #174f93); --m-shadow: rgba(23, 79, 147, .28); --m-soft: rgba(59, 130, 246, .10); --m-ink: var(--primary); }
.m-gold  { --m-grad: linear-gradient(135deg, #e2c27a, #b48a35); --m-shadow: rgba(180, 138, 53, .3);  --m-soft: rgba(226, 194, 122, .18); --m-ink: var(--gold); }
.m-green { --m-grad: linear-gradient(135deg, #34d399, #0f9d6b); --m-shadow: rgba(15, 157, 107, .28); --m-soft: rgba(52, 211, 153, .12); --m-ink: var(--good); }
.m-rose  { --m-grad: linear-gradient(135deg, #fb7185, #e11d48); --m-shadow: rgba(225, 29, 72, .25); --m-soft: rgba(251, 113, 133, .12); --m-ink: #e11d48; }
.metric-bar span { background: linear-gradient(90deg, #3b82f6, #174f93); }

/* البحث والفلاتر */
.search-wrap { position: relative; flex: 1; max-width: 420px; display: block; }
.search-wrap svg { position: absolute; top: 50%; inset-inline-start: 12px; transform: translateY(-50%); width: 18px; height: 18px; fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.toolbar.split .search-wrap .input.search { max-width: none; width: 100%; padding-inline-start: 38px; }
.chip b { font-weight: 700; margin-inline-start: 4px; opacity: .75; font-variant-numeric: tabular-nums; }

/* بطاقات الاختبارات */
.test-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.test-card { padding: 0; gap: 0; overflow: hidden; border-radius: 16px; transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .22s, border-color .22s;
  animation: rise .45s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes rise { from { transform: translateY(12px); } to { transform: none; } }
.test-card:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); box-shadow: 0 16px 34px rgba(20, 50, 100, .14); }
.tc-band { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 84px; padding: 14px 18px; color: #fff; overflow: hidden;
  background: radial-gradient(140% 120% at 100% 0%, #2468b8 0%, #174f93 55%, #103a70 100%); }
.tc-band::before { content: ""; position: absolute; inset-inline-end: -30px; top: -40px; width: 130px; height: 130px; border-radius: 50%; border: 18px solid rgba(255,255,255,.06); box-shadow: 0 0 0 22px rgba(255,255,255,.03); }
.tc-band::after { content: ""; position: absolute; inset: auto 0 0 0; height: 3px; background: linear-gradient(90deg, #b48a35, #e2c27a, #b48a35); }
.test-card.done .tc-band { background: radial-gradient(140% 120% at 100% 0%, #1f8a6a 0%, #146b52 55%, #0e4f3d 100%); }
.tc-id { display: flex; flex-direction: column; line-height: 1.1; position: relative; }
.tc-label { font-size: .75rem; opacity: .8; font-weight: 600; }
.tc-num { font: 800 2.1rem var(--font-display); color: #e2c27a; }
.tc-badge { position: relative; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); color: #fff; font-size: .78rem; font-weight: 700; padding: 3px 12px; border-radius: 999px; }
.mini-ring { width: 52px; height: 52px; position: relative; }
.mr-bg { fill: rgba(255,255,255,.12); stroke: rgba(255,255,255,.2); stroke-width: 4; }
.mr-fg { fill: none; stroke: #e2c27a; stroke-width: 4; stroke-linecap: round; }
.mini-ring.good .mr-fg { stroke: #6ee7b7; }
.mini-ring.low .mr-fg { stroke: #fca5a5; }
.mini-ring text { fill: #fff; font: 700 13px var(--font-body); }
.tc-body { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px 18px; flex: 1; }
.tc-body h3 { font-size: 1.12rem; }
.tc-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--ink-2); font-size: .86rem; margin: 0; }
.tc-meta span { display: inline-flex; align-items: center; gap: 5px; }
.tc-meta svg { width: 16px; height: 16px; fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tc-secs { display: flex; flex-wrap: wrap; gap: 5px; }
.tc-secs span { font-size: .72rem; font-weight: 600; color: var(--primary); background: var(--primary-soft); padding: 2px 8px; border-radius: 6px; }
.tc-body .btn { margin-top: auto; gap: 8px; }
@media (prefers-reduced-motion: reduce) { .test-card, .wave { animation: none; } }


/* ================= صفحة الدخول (تصميم قرار) ================= */
.auth2 { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); }
.auth-side-form { display: flex; align-items: center; justify-content: center; padding-block: 40px; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px));
  background: radial-gradient(600px 400px at 20% 90%, color-mix(in srgb, var(--gold) 14%, transparent), transparent 70%), linear-gradient(160deg, var(--surface-2), var(--bg)); }
.auth-card.glass { max-width: 440px; padding: 30px; border-radius: 22px; background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid color-mix(in srgb, var(--line) 70%, #fff); box-shadow: 0 24px 60px rgba(20, 50, 100, .14); }
.tabs.gold { padding: 5px; border-radius: 14px; }
.tabs.gold .tab { padding: 10px; border-radius: 10px; font-family: var(--font-display); font-size: 1rem; }
.tabs.gold .tab.on { background: linear-gradient(135deg, #d6b468, #b48a35); color: #fff; box-shadow: 0 6px 16px rgba(180, 138, 53, .35); }
.req { color: var(--low); margin-inline-start: 3px; }
.in-icon { position: relative; display: block; }
.in-icon .input { min-height: 46px; border-radius: 12px; padding-left: 44px; }
.in-ico, .in-icon .pw-toggle { position: absolute; top: 50%; left: 8px; transform: translateY(-50%); width: 32px; height: 32px; display: grid; place-items: center; color: var(--ink-3); }
.in-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.in-icon .input:focus ~ .in-ico { color: var(--primary); }
.in-icon .pw-toggle { left: 8px; right: auto; inset-inline-end: auto; inset-inline-start: auto; }
.in-icon .pw-toggle { left: 8px; }
.input.invalid { border-color: var(--low); box-shadow: 0 0 0 3px var(--low-soft); }
.auth-submit { border: 0; color: #fff; border-radius: 12px; min-height: 50px; font: 700 1.05rem var(--font-display);
  background: linear-gradient(135deg, #2d6fc4, #174f93 55%, #0f3466); box-shadow: 0 10px 24px rgba(23, 79, 147, .32); }
.auth-submit:hover { filter: brightness(1.08); transform: translateY(-1px); }
.auth-side-brand { position: relative; overflow: hidden; color: #fff; display: flex; align-items: center; justify-content: center; padding: 40px 24px;
  background: radial-gradient(80% 60% at 50% 35%, #1f63b5 0%, #13488c 45%, #0b2f5e 100%); }
.auth-side-brand::before, .auth-side-brand::after { content: ""; position: absolute; width: 260px; height: 260px; background: url(../img/logo.png) center/contain no-repeat; filter: brightness(0) invert(1); opacity: .05; pointer-events: none; }
.auth-side-brand::before { top: -40px; left: -60px; transform: rotate(-12deg); }
.auth-side-brand::after { bottom: -60px; right: -50px; transform: rotate(10deg); }
.asb-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; max-width: 520px; }
.asb-logo { width: 92px; height: 92px; border-radius: 50%; background: #fff; padding: 10px; box-shadow: 0 0 0 5px rgba(255,255,255,.18), 0 12px 30px rgba(0,0,0,.25); }
.asb-hero { width: min(100%, 420px); height: auto; -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent); mask-image: radial-gradient(closest-side, #000 72%, transparent); animation: floaty 6s ease-in-out infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.auth-side-brand h1 { font: 800 clamp(1.6rem, 2.6vw, 2.2rem) var(--font-display); color: #fff; line-height: 1.4; }
.auth-side-brand h1 span { color: #e2c27a; }
.asb-name { font: 700 clamp(1.2rem, 2vw, 1.6rem) var(--font-display); color: #e2c27a; }
.asb-tag { color: rgba(255,255,255,.85); font-size: .98rem; max-width: 46ch; }
.asb-social { display: flex; gap: 14px; margin-top: 10px; }
.asb-social a { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.1); transition: background .15s, transform .15s; }
.asb-social a:hover { background: #e2c27a; transform: translateY(-2px); }
.asb-social svg { width: 20px; height: 20px; fill: #fff; }
.asb-social a:hover svg { fill: #0f3466; }

/* ================= الرئيسية: البوابات ================= */
.portals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.portal { position: relative; overflow: hidden; border-radius: 18px; padding: 22px; display: flex; flex-direction: column; gap: 18px; color: #fff; box-shadow: 0 14px 30px rgba(20, 50, 100, .16); }
.portal::after { content: ""; position: absolute; inset-inline-end: -40px; top: -50px; width: 170px; height: 170px; border-radius: 50%; border: 22px solid rgba(255,255,255,.07); }
.p-courses { background: linear-gradient(145deg, #2468b8, #123f7a); }
.p-tests { background: linear-gradient(145deg, #c49a45, #8f6a22); }
.p-mock { background: linear-gradient(145deg, #1f8a6a, #0d4f3c); }
.portal-top { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.portal-top h2 { font: 800 1.4rem var(--font-display); color: #fff; }
.portal-top p { color: rgba(255,255,255,.85); font-size: .9rem; }
.portal-icon { width: 56px; height: 56px; flex: none; border-radius: 16px; display: grid; place-items: center; background: rgba(255,255,255,.18); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.portal-icon svg { width: 28px; height: 28px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.portal-icon svg .fill, .btn svg .fill, .m-icon svg .fill { fill: currentColor; stroke: none; }
.portal-icon.big { width: 64px; height: 64px; background: linear-gradient(135deg, #34d399, #0f9d6b); box-shadow: 0 10px 22px rgba(15, 157, 107, .3); }
.portal-links { display: flex; flex-direction: column; gap: 8px; position: relative; z-index: 1; margin-top: auto; }
.portal-links a { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.12); color: #fff; text-decoration: none; font-weight: 700; transition: background .15s, transform .15s; }
.portal-links a:hover { background: rgba(255,255,255,.22); transform: translateX(-3px); }
.portal-links a span { flex: 1; }
.portal-links a b { font-size: .78rem; font-weight: 600; background: rgba(255,255,255,.2); padding: 1px 9px; border-radius: 999px; }
.portal-links svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* تبويبات مقسمة */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; align-self: flex-start; }
.seg-btn { border: 0; background: transparent; color: var(--ink-2); padding: 9px 18px; border-radius: 10px; font: 700 .98rem var(--font-display); cursor: pointer; }
.seg-btn b { font-family: var(--font-body); font-size: .78rem; background: var(--surface-2); color: var(--ink-2); padding: 1px 8px; border-radius: 999px; margin-inline-start: 4px; }
.seg-btn:hover { color: var(--primary); }
.seg-btn.on { background: linear-gradient(135deg, #2468b8, var(--primary)); color: #fff; box-shadow: 0 6px 14px rgba(23, 79, 147, .25); }
.seg-btn.on b { background: rgba(255,255,255,.22); color: #fff; }

/* الدورات */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.course-card { display: flex; flex-direction: column; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; transition: transform .22s, box-shadow .22s; animation: rise .45s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 45ms); }
.course-card:hover { transform: translateY(-5px); box-shadow: 0 16px 34px rgba(20, 50, 100, .14); }
.cc-band { position: relative; height: 110px; display: flex; align-items: center; justify-content: center; color: #fff; overflow: hidden; }
.cc-band.cat-foundation { background: linear-gradient(135deg, #2468b8, #103a70); }
.cc-band.cat-computer { background: linear-gradient(135deg, #7c5cd6, #3f2a8c); }
.cc-band.cat-paper { background: linear-gradient(135deg, #c49a45, #7f5c1c); }
.cc-band > svg { width: 54px; height: 54px; fill: none; stroke: rgba(255,255,255,.9); stroke-width: 1.6; }
.cc-band::after { content: ""; position: absolute; inset: auto 0 0 0; height: 3px; background: linear-gradient(90deg, #b48a35, #e2c27a, #b48a35); }
.cc-cat { position: absolute; top: 12px; inset-inline-start: 12px; background: rgba(255,255,255,.18); padding: 2px 12px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.cc-band .tc-badge { position: absolute; top: 12px; inset-inline-end: 12px; }
.cc-body { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px 18px; flex: 1; }
.cc-body p { color: var(--ink-2); font-size: .9rem; }
.cc-body .btn { margin-top: auto; gap: 8px; }
.course-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.lesson-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.player { position: relative; aspect-ratio: 16 / 9; max-width: 100%; border-radius: 12px; overflow: hidden; background: #000; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lesson-info h2 { font-size: 1.35rem; }
.lesson-note { color: var(--ink-2); margin-top: 6px; }
.files { display: flex; flex-direction: column; gap: 8px; }
.file-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.file-row-view { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.file-row-view b { flex: 1; min-width: 0; }
.file-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--low-soft); color: var(--low); flex: none; }
.file-icon svg, .file-actions svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.file-actions { display: flex; gap: 6px; }
.file-frame { margin-top: 10px; height: 70vh; max-height: 640px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.file-frame iframe { width: 100%; height: 100%; border: 0; }
.lesson-nav { display: flex; justify-content: space-between; gap: 10px; }
.lesson-list { position: sticky; top: calc(80px + env(safe-area-inset-top, 0px)); padding: 14px; max-height: calc(100vh - 110px); overflow: auto; }
.lesson-list ol { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.lesson-btn { width: 100%; display: flex; align-items: center; gap: 10px; text-align: start; border: 0; background: transparent; color: var(--ink); padding: 9px 10px; border-radius: 10px; cursor: pointer; font: 500 .92rem var(--font-body); }
.lesson-btn:hover { background: var(--surface-2); }
.lesson-btn.on { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.ln { width: 28px; height: 28px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); font-weight: 700; font-size: .82rem; }
.lesson-btn.on .ln { background: var(--primary); color: var(--primary-ink); }
.lt { flex: 1; min-width: 0; }
.lm { display: flex; gap: 3px; color: var(--ink-3); }
.lm svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }

/* المحاكي */
.mock-setup { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 24px; position: relative; overflow: hidden; }
.mock-setup::before { content: ""; position: absolute; inset-inline-end: -60px; top: -80px; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(circle, rgba(52, 211, 153, .14), transparent 70%); }
.ms-text { display: flex; gap: 16px; align-items: flex-start; position: relative; }
.ms-text h2 { font-size: 1.35rem; margin-bottom: 6px; }
.ms-text p { color: var(--ink-2); line-height: 1.9; }
.ms-controls { display: flex; flex-direction: column; gap: 10px; position: relative; }
.ms-controls .seg { align-self: stretch; justify-content: space-between; }
.ms-controls .seg-btn { flex: 1; font-size: 1.1rem; }
.ms-sum { text-align: center; color: var(--ink-2); }
.ms-sum b { color: var(--primary); font-size: 1.15rem; }
.field-label { font-size: .88rem; font-weight: 600; color: var(--ink-2); }
.metrics.three { grid-template-columns: repeat(3, 1fr); }
.history { display: flex; flex-direction: column; }
.h-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.h-row:last-child { border-bottom: 0; }
.h-row .mini-ring { width: 48px; height: 48px; }
.h-row .mr-bg { fill: var(--surface-2); stroke: var(--line); }
.h-row .mr-fg { stroke: var(--mid); }
.h-row .mini-ring.good .mr-fg { stroke: var(--good); }
.h-row .mini-ring.low .mr-fg { stroke: var(--low); }
.h-row .mini-ring text { fill: var(--ink); }
.h-info { flex: 1; min-width: 200px; display: flex; flex-direction: column; }
.btn .spinner { width: 16px; height: 16px; border-color: rgba(255,255,255,.4); border-top-color: #fff; }

/* ================= شاشة حل السؤال ================= */
.q-text { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; color: #c0262d; line-height: 1.7; }
.q-text .q-n { font-family: var(--font-body); }
.option { font: 700 1.2rem var(--font-body); color: var(--primary); min-height: 62px; padding: 14px 16px; border-radius: 12px; transition: border-color .12s, background .12s, transform .12s; }
.option:hover { transform: translateY(-1px); }
.option .letter { width: 32px; height: 32px; font-size: 1.05rem; }
.option.picked { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.passage { font-size: 1.12rem; line-height: 2; }
.q-actions { align-items: center; }
.q-actions .btn svg { width: 18px; height: 18px; }
.later-btn { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); color: #8f6a22; background: color-mix(in srgb, var(--gold) 10%, var(--surface)); font-weight: 700; }
.later-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--gold) 20%, var(--surface)); border-color: var(--gold); }
.all-done { background: var(--good-soft); color: var(--good); border-radius: 10px; padding: 10px 14px; font-weight: 600; font-size: .92rem; }
.pulse-strong { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 45%, transparent); } 50% { box-shadow: 0 0 0 8px transparent; } }
.dot.later { background: color-mix(in srgb, var(--gold) 22%, var(--surface)); color: #8f6a22; border-color: var(--gold); }
.dot-legend-row { display: flex; flex-wrap: wrap; gap: 10px; font-size: .75rem; color: var(--ink-3); }
.dot-legend-row span { display: inline-flex; align-items: center; gap: 4px; }
.lgd { width: 11px; height: 11px; border-radius: 3px; border: 1px solid var(--line); background: var(--surface); display: inline-block; }
.lgd.answered { background: var(--primary-soft); border-color: transparent; }
.lgd.later { background: color-mix(in srgb, var(--gold) 22%, var(--surface)); border-color: var(--gold); }
.group-pill { background: linear-gradient(135deg, #2468b8, var(--primary)); color: #fff; padding: 3px 12px; border-radius: 999px; font-weight: 700; font-size: .85rem; }

/* متفرقات */
.student-view { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .88rem; white-space: nowrap; }
.student-view svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.student-view:hover, .student-view.on { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.info-note { background: var(--primary-soft); color: var(--ink); border-radius: 12px; padding: 12px 16px; font-size: .92rem; line-height: 1.8; }
.pill.cat-foundation { background: var(--primary-soft); color: var(--primary); }
.pill.cat-sections { background: color-mix(in srgb, var(--gold) 18%, var(--surface)); color: #8f6a22; }
.pill.cat-computer { background: #ece7fb; color: #5b3fbf; }
.pill.cat-paper { background: color-mix(in srgb, var(--gold) 18%, var(--surface)); color: #8f6a22; }
.files-edit { display: flex; flex-direction: column; gap: 8px; }
.file-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: 8px; align-items: center; }
.grow-input { flex: 1; min-width: 0; }
.fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.fieldset legend { font-weight: 700; padding: 0 6px; color: var(--primary); }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }


/* ================= لوحة الإدارة بقائمة جانبية ================= */
.admin-shell { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 18px 14px;
  background: linear-gradient(180deg, #113d75 0%, #0c2c56 100%); color: #dbe6f5; z-index: 40; }
.side-brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 18px; margin-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,.1); text-decoration: none; color: #fff; }
.side-brand .logo { width: 48px; height: 48px; border-radius: 14px; padding: 4px; }
.side-brand b { display: block; font-size: 1.05rem; font-weight: 800; }
.side-brand small { display: block; color: #e2c27a; font-size: .8rem; font-weight: 600; }
.side-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.side-sec { margin: 14px 10px 4px; font-size: .74rem; font-weight: 700; color: rgba(219,230,245,.5); letter-spacing: .02em; }
.side-link { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border-radius: 12px; color: #dbe6f5; text-decoration: none; border: 0; background: transparent; font: 600 .95rem var(--font-body); cursor: pointer; text-align: start; transition: background .15s, color .15s; }
.side-link svg { width: 21px; height: 21px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.side-link span { flex: 1; }
.side-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-link.on { background: #fff; color: #113d75; box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.side-link.on svg { color: #b48a35; }
.side-toggle.on { background: rgba(255,255,255,.1); color: #fff; }
.side-caret { display: grid; transition: transform .2s; }
.side-caret svg { width: 16px; height: 16px; }
.side-toggle[aria-expanded="true"] .side-caret { transform: rotate(180deg); }
.side-sub { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 6px; padding-inline-start: 22px; border-inline-start: 2px solid rgba(255,255,255,.12); margin-inline-start: 22px; }
.side-link.sub { padding: 9px 12px; font-size: .9rem; font-weight: 500; }
.side-link.hl:not(.on) { background: linear-gradient(135deg, rgba(226,194,122,.22), rgba(180,138,53,.12)); color: #f3dfaf; box-shadow: inset 0 0 0 1px rgba(226,194,122,.35); }
.side-foot { display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; border-top: 1px solid rgba(255,255,255,.1); margin-top: 10px; }
.side-foot .avatar { background: #e2c27a; color: #0c2c56; }
.sf-name { flex: 1; min-width: 0; }
.sf-name b { display: block; color: #fff; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-name small { color: rgba(219,230,245,.65); font-size: .78rem; }
.side-foot .icon-btn { color: #dbe6f5; }
.side-foot .icon-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.side-foot .icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.admin-main { min-width: 0; display: flex; flex-direction: column; }
.admin-top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; gap: 12px; min-height: 66px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }
.admin-top-title { flex: 1; font: 800 1.1rem var(--font-display); color: var(--ink); margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-btn { display: none; width: 42px; height: 42px; border: 1px solid var(--line); background: var(--surface); }
.menu-btn svg, .bell svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.admin-main .page { max-width: 1280px; width: 100%; }
.side-scrim { position: fixed; inset: 0; background: rgba(8, 20, 40, .45); z-index: 35; }
.back-admin { margin-inline-start: auto; }

/* لوحة التحكم */
.metrics.five { grid-template-columns: repeat(5, 1fr); }
.m-violet { --m-grad: linear-gradient(135deg, #a78bfa, #6d28d9); --m-shadow: rgba(109, 40, 217, .25); --m-soft: rgba(167, 139, 250, .14); --m-ink: #6d28d9; }
.m-sub { color: var(--ink-3); font-size: .78rem; line-height: 1.4; }
.live-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #22c55e; margin-inline-start: 8px; vertical-align: middle; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: livep 1.8s infinite; }
@keyframes livep { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.55); } 70% { box-shadow: 0 0 0 8px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
.online-name { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.online-name .live-dot { margin: 0; }
.panel-title svg { width: 20px; height: 20px; fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.panel-title svg .fill, .m-icon svg .fill { fill: currentColor; stroke: none; }
.day-chart { display: flex; align-items: flex-end; gap: 6px; height: 200px; padding-top: 18px; border-bottom: 1px solid var(--line); }
.dc-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; }
.dc-bar { width: 100%; max-width: 30px; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, #3b82f6, var(--primary)); }
.dc-val { font-size: .72rem; font-weight: 700; color: var(--ink-2); }
.dc-lbl { font-size: .66rem; color: var(--ink-3); white-space: nowrap; transform: translateY(18px); height: 0; }
.day-chart + .hint { margin-top: 26px; }
.kv { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.kv li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.kv li:last-child { border-bottom: 0; }
.kv li span { color: var(--ink-2); }
.kv li.sub span { padding-inline-start: 16px; color: var(--ink-3); font-size: .92rem; }
.kv.cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 20px; }
.heat { display: grid; grid-template-columns: repeat(30, 1fr); gap: 4px; margin-top: 14px; }
.heat span { aspect-ratio: 1; border-radius: 4px; background: color-mix(in srgb, var(--primary) calc(var(--a) * 100%), var(--surface-2)); }
.search-wrap.big .input.search { min-height: 52px; font-size: 1.05rem; border-radius: 14px; }
.search-wrap.big { max-width: 560px; }
.btn.wa { background: #e8f8ee; color: #128c47; border-color: transparent; font-weight: 700; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sub-quick { margin-top: 6px; }
.sub-quick .chip { font-size: .8rem; padding: 3px 10px; }

/* أفضل الطلاب */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: end; max-width: 860px; margin: 6px auto 4px; width: 100%; }
.pod { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 22px 14px 0; border-radius: 18px 18px 0 0; text-decoration: none; color: #fff; overflow: hidden; }
.pod-1 { background: linear-gradient(180deg, #e2c27a, #b48a35); min-height: 300px; box-shadow: 0 18px 40px rgba(180,138,53,.35); }
.pod-2 { background: linear-gradient(180deg, #9fb3cf, #5f7696); min-height: 255px; }
.pod-3 { background: linear-gradient(180deg, #d9a06b, #9a5f2d); min-height: 225px; }
.medal { font-size: 2rem; line-height: 1; }
.pod-avatar { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.95); color: #113d75; font: 800 1.6rem var(--font-display); box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.pod-name { font-size: 1.05rem; margin-top: 4px; }
.pod-val { font: 800 1.5rem var(--font-display); }
.pod-meta { font-size: .78rem; opacity: .9; }
.pod-step { margin-top: auto; width: calc(100% + 28px); padding: 8px 0; background: rgba(0,0,0,.14); font: 800 1.6rem var(--font-display); }
.rank { display: inline-grid; place-items: center; min-width: 32px; height: 32px; border-radius: 10px; background: var(--surface-2); font-weight: 800; }
.rank.r1 { background: #f6e7bf; color: #8f6a22; } .rank.r2 { background: #e3e9f2; color: #4b5d78; } .rank.r3 { background: #f3dcc6; color: #8a5426; }

/* تعديل الموقع المباشر */
.site-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.se-form { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.se-preview { position: sticky; top: calc(150px + env(safe-area-inset-top, 0px)); display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 170px); overflow: auto; background: var(--surface-2); }
.se-pv-label { font-size: .8rem; font-weight: 700; color: var(--ink-3); }
.se-preview .brand-hero { height: 150px; }
.se-preview .bh-photo { width: 170px; }
.se-preview .bh-logo { width: 64px; height: 64px; }
.se-preview .bh-copy h2 { font-size: 1.1rem; }
.portals.mini { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.portals.mini .portal { padding: 12px; border-radius: 12px; }
.portals.mini .portal-top { flex-direction: column; align-items: flex-start; gap: 6px; }
.portals.mini .portal-top h2 { font-size: .95rem; }
.portals.mini .portal-top p { font-size: .72rem; }
.portals.mini .portal-icon { width: 40px; height: 40px; border-radius: 12px; }
.portal-icon img { width: 70%; height: 70%; object-fit: contain; }
.auth-side-brand.pv { border-radius: 14px; padding: 20px 14px; }
.auth-side-brand.pv h1 { font-size: 1.2rem; }
.auth-side-brand.pv .asb-logo { width: 64px; height: 64px; }
.auth-side-brand.pv .asb-hero { width: 220px; animation: none; }
.auth-side-brand.pv .asb-name { font-size: 1rem; }
.auth-side-brand.pv .asb-tag { display: block; font-size: .8rem; }
.se-imgs { display: grid; grid-template-columns: 1fr; gap: 10px; }
.se-img { display: flex; gap: 14px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 14px; }
.se-thumb { width: 92px; height: 72px; flex: none; border-radius: 10px; background: var(--surface-2) repeating-conic-gradient(var(--line) 0 25%, transparent 0 50%) 0 0 / 14px 14px; display: grid; place-items: center; overflow: hidden; text-align: center; }
.se-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.se-thumb.icon { background-color: #174f93; }
.se-thumb.icon .muted { color: rgba(255,255,255,.75); font-size: .7rem; padding: 4px; }
.se-img-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.se-img-info .row-actions { margin-top: 4px; }

/* الطباعة */
@media print {
  .sidebar, .admin-top, .demo-strip, .no-print, .toolbar, .topbar, #ph-count { display: none !important; }
  .admin-shell { display: block; }
  body { background: #fff; }
  .page { padding: 0 !important; }
  .panel { border: 0; box-shadow: none; }
  .table th, .table td { padding: 6px 8px; font-size: 11pt; }
}

@media (max-width: 1280px) { .metrics.five { grid-template-columns: repeat(3, 1fr); } .kv.cols { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 1024px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: 0; bottom: 0; right: 0; width: min(300px, 86vw); transform: translateX(105%); transition: transform .25s ease; box-shadow: -10px 0 40px rgba(0,0,0,.25); padding-top: max(18px, env(safe-area-inset-top, 0px)); }
  .sidebar.open { transform: none; }
  .menu-btn { display: grid; place-items: center; }
  .site-editor { grid-template-columns: 1fr; }
  .se-preview { position: static; max-height: none; order: -1; }
}

.admin-main .sticky-head, .admin-main .take-head { top: calc(66px + env(safe-area-inset-top, 0px)) !important; }
.admin-main .sticky-head { background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.se-preview { top: calc(200px + env(safe-area-inset-top, 0px)); }
.se-thumb.icon { background: #174f93; }
.se-preview .brand-hero { height: auto; min-height: 130px; }
.se-preview .bh-text { padding: 14px 16px; }
.day-chart + .hint { margin-top: 30px; }
.sidebar { height: 100dvh; }
.search-wrap .input.search { width: 100%; max-width: none; padding-inline-start: 40px; }
.toolbar > .search-wrap { flex: 1; max-width: 460px; }

/* ================= التفاعل البرتقالي عند المرور ================= */
/* شريط القوائم العلوي */
.nav a:hover, .nav a:focus-visible { color: var(--orange-ink); border-bottom-color: var(--orange); }
.nav a.on:hover { color: var(--orange-ink); }
.brand-line:hover span { color: var(--orange-ink); }
.student-view:hover, .student-view:focus-visible, .bell:hover, .bell:focus-visible, .profile-btn:hover, .profile-btn:focus-visible {
  color: var(--orange-ink); border-color: var(--orange); background: color-mix(in srgb, var(--orange) 10%, var(--surface)); }
.profile-btn:hover .avatar { background: var(--orange-strong); color: #fff; }
.profile-menu a:hover, .profile-menu button:not(.pm-out):hover { background: color-mix(in srgb, var(--orange) 12%, var(--surface)); color: var(--orange-ink); }
/* القائمة الجانبية: خلفية برتقالية ونص أبيض واضح */
.side-link:hover, .side-link:focus-visible, .side-link.hl:not(.on):hover { background: var(--orange-strong); color: #fff; box-shadow: 0 6px 16px rgba(234, 88, 12, .35); }
.side-link.on:hover svg { color: #fff; }
.side-link.on:hover { background: var(--orange-strong); color: #fff; }
.side-brand:hover b { color: #fdba74; }
.side-foot .icon-btn:hover { background: var(--orange-strong); color: #fff; }
/* أيقونات التواصل */
.bh-social a:hover, .bh-social a:focus-visible, .asb-social a:hover, .asb-social a:focus-visible { background: var(--orange); transform: translateY(-2px); }
.bh-social a:hover svg, .asb-social a:hover svg, .bh-social a:focus-visible svg, .asb-social a:focus-visible svg { fill: #fff; }
/* أيقونات البطاقات والإحصائيات */
.m-icon, .portal-icon, .file-icon { transition: background .2s, transform .2s, box-shadow .2s; }
.metric:hover .m-icon { background: linear-gradient(135deg, #fb923c, #ea580c); box-shadow: 0 8px 18px rgba(234, 88, 12, .35); transform: scale(1.06) rotate(-4deg); }
.portal:hover .portal-icon { background: var(--orange); box-shadow: 0 8px 18px rgba(234, 88, 12, .4); transform: scale(1.06); }
.portal-links a:hover, .portal-links a:focus-visible { background: #fff; color: var(--orange-ink); }
.portal-links a:hover svg { stroke: var(--orange-ink); }
.portal-links a:hover b { background: var(--orange-strong); color: #fff; }
.file-item:hover .file-icon { background: var(--orange); color: #fff; }
.lesson-btn:hover { background: color-mix(in srgb, var(--orange) 10%, var(--surface)); color: var(--orange-ink); }
.lesson-btn:hover .ln { background: var(--orange-strong); color: #fff; }
.tc-meta svg { transition: stroke .15s; }
.test-card:hover .tc-meta svg, .course-card:hover .tc-meta svg { stroke: var(--orange-strong); }
.seg-btn:not(.on):hover { color: var(--orange-ink); background: color-mix(in srgb, var(--orange) 10%, var(--surface)); }
.chip:not(.on):hover { border-color: var(--orange); color: var(--orange-ink); }
.icon-btn:hover:not(:disabled) { color: var(--orange-ink); background: color-mix(in srgb, var(--orange) 12%, var(--surface)); }
.btn:not(.primary):not(.danger):not(.auth-submit):not(.wa):hover svg { stroke: var(--orange-ink); }
.link:hover { color: var(--orange-ink); }
.panel-title svg { transition: stroke .15s; }
.panel:hover .panel-title svg { stroke: var(--orange-strong); }

/* زر واتساب العائم */
.wa-float { position: fixed; z-index: 90; left: calc(20px + env(safe-area-inset-left, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: #25d366; color: #fff; text-decoration: none;
  box-shadow: 0 10px 26px rgba(18, 140, 71, .4); transition: background .2s, transform .2s, box-shadow .2s; }
.wa-float::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid #25d366; animation: waRing 2.2s ease-out infinite; }
@keyframes waRing { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(1.6); opacity: 0; } }
.wa-float svg { width: 32px; height: 32px; fill: #fff; position: relative; }
.wa-float:hover, .wa-float:focus-visible { background: var(--orange-strong); transform: scale(1.08); box-shadow: 0 12px 30px rgba(234, 88, 12, .45); }
.wa-float:hover::before { border-color: var(--orange); }
.wa-tip { position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%); white-space: nowrap; background: var(--ink); color: var(--bg);
  font: 700 .85rem var(--font-body); padding: 6px 12px; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.wa-float:hover .wa-tip, .wa-float:focus-visible .wa-tip { opacity: 1; }
body.in-exam .wa-float { display: none; }
@media (max-width: 760px) { .auth-side-form { padding-bottom: 96px; } .page { padding-bottom: 96px; } .wa-float { width: 54px; height: 54px; left: calc(14px + env(safe-area-inset-left, 0px)); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); } .wa-tip { display: none; } }
@media (prefers-reduced-motion: reduce) { .wa-float::before { animation: none; display: none; } }
@media print { .wa-float { display: none; } }
.pill.role-manager { background: color-mix(in srgb, var(--gold) 22%, var(--surface)); color: #8f6a22; }
.roles-help.four { grid-template-columns: repeat(4, 1fr); }
.perm-mini { font-size: .75rem; color: #8f6a22; font-weight: 700; }
.perms-box { gap: 8px; }
.perm-actions { display: flex; gap: 6px; }
.perm-group { display: flex; flex-direction: column; gap: 4px; padding-top: 6px; border-top: 1px dashed var(--line); }
.perm-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: .92rem; }
.perm-item:hover { background: color-mix(in srgb, var(--orange) 8%, var(--surface)); }
.perm-item input { width: 18px; height: 18px; accent-color: var(--primary); flex: none; }
.toggle:disabled { cursor: default; opacity: .8; }
@media (max-width: 960px) { .roles-help.four { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .roles-help.four { grid-template-columns: 1fr; } }

/* ================= شكل السؤال: أحمر سميك والاختيارات زرقاء (الحل والمراجعة) ================= */
:root { --q-red: #c0262d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --q-red: #f87171; } }
:root[data-theme="dark"] { --q-red: #f87171; }
.q-text { font-size: 1.85rem; font-weight: 800; color: var(--q-red); }
.option { font-size: 1.38rem; font-weight: 700; color: var(--primary); min-height: 68px; }
.option .letter { width: 36px; height: 36px; font-size: 1.15rem; }
.passage { font-size: 1.22rem; }
.wq-text { font-size: 1.4rem; font-weight: 800; color: var(--q-red); line-height: 1.7; }
.opt-review li { font-size: 1.18rem; font-weight: 700; color: var(--primary); padding: 10px 12px; border-radius: 10px; }
.opt-review li .letter { width: 32px; height: 32px; }
.opt-review li.is-correct { color: var(--hl-ink); }
.opt-review li.is-wrong { color: var(--low); }
.opt-review li em { font-size: .8rem; }
.explain { display: flex; flex-direction: column; gap: 8px; font-size: 1.02rem; color: var(--ink); border-inline-start: 4px solid var(--gold); padding: 10px 14px; }
.explain p { margin: 0; }
.xv-btn { align-self: flex-start; color: var(--low); border-color: color-mix(in srgb, var(--low) 35%, var(--line)); font-weight: 700; }
.xv-btn svg { width: 16px; height: 16px; }
.xv-btn:hover { background: var(--orange-strong) !important; border-color: var(--orange-strong) !important; color: #fff !important; }
.xv-btn:hover svg { stroke: none !important; }
.xv-box .player { max-width: 720px; }
.explain-row { align-items: start; }

/* ================= أزرار النقل ================= */
.move-btn svg, .move-ic svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.move-btn { color: var(--primary); }
.move-ic { color: var(--primary); }
.sel-col { width: 40px; text-align: center !important; }
.sel-col input { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.bulk-bar { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-radius: 12px; background: color-mix(in srgb, var(--orange) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--orange) 40%, var(--line)); }
.bulk-bar b { color: var(--orange-ink); }
.pick-list { display: flex; flex-direction: column; gap: 8px; }
.pick-item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 700; }
.pick-item:hover { border-color: var(--orange); }
.pick-item input { width: 18px; height: 18px; accent-color: var(--primary); }
.pick-item:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }

/* ================= الصفحة الدعائية ================= */
.lp { min-height: 100vh; background: var(--bg); }
.lp-wrap { max-width: 1240px; margin: 0 auto; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }
.lp-head { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s; }
.lp-head.scrolled { border-color: var(--line); box-shadow: 0 6px 20px rgba(20, 50, 100, .08); }
.lp-head-in { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 20px; min-height: 76px; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }
.lp-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.lp-brand img { width: 46px; height: 46px; border-radius: 12px; background: #fff; padding: 3px; box-shadow: 0 4px 12px rgba(20, 50, 100, .12); transition: transform .2s; }
.lp-brand:hover img { transform: rotate(-6deg) scale(1.05); }
.lp-brand b { display: block; font: 800 1.15rem var(--font-display); line-height: 1.2; }
.lp-brand small { display: block; color: var(--gold); font-weight: 700; font-size: .82rem; }
.lp-brand.light { color: #fff; }
.lp-nav { flex: 1; display: flex; align-items: center; gap: 4px; }
.lp-nav > a { padding: 10px 14px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 700; font-size: .98rem; transition: color .15s, background .15s; }
.lp-nav > a:hover, .lp-nav > a:focus-visible, .lp-nav > a:active { color: var(--orange-ink); background: color-mix(in srgb, var(--orange) 10%, transparent); }
.lp-auth { margin-inline-start: auto; display: flex; gap: 10px; }
.lp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 12px; font: 800 .98rem var(--font-body); text-decoration: none; cursor: pointer; border: 2px solid transparent; transition: transform .15s, box-shadow .2s, background .2s, color .2s; white-space: nowrap; }
.lp-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lp-btn svg .fill { fill: currentColor; stroke: none; }
.lp-btn.solid { background: linear-gradient(135deg, #fb923c, #ea580c); color: #fff; box-shadow: 0 8px 20px rgba(234, 88, 12, .32); }
.lp-btn.solid:hover, .lp-btn.solid:focus-visible { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(234, 88, 12, .42); background: linear-gradient(135deg, #f97316, #c2410c); }
.lp-btn.ghost { color: var(--orange-ink); border-color: var(--orange); background: transparent; }
.lp-btn.ghost:hover, .lp-btn.ghost:focus-visible { background: var(--orange-strong); color: #fff; border-color: var(--orange-strong); transform: translateY(-2px); }
.lp-btn.light { background: var(--surface); color: var(--primary); border-color: var(--line); }
.lp-btn.light:hover, .lp-btn.light:focus-visible { border-color: var(--orange); color: var(--orange-ink); transform: translateY(-2px); }
.lp-btn:active { transform: scale(.97) !important; }
.lp-btn.lg { min-height: 54px; padding: 0 26px; font-size: 1.05rem; border-radius: 14px; }
.lp-btn.block { width: 100%; }
.lp-menu { display: none; margin-inline-start: auto; width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; place-items: center; }
.lp-menu svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.lp-menu:hover { color: var(--orange-ink); border-color: var(--orange); }

.lp-hero { position: relative; overflow: hidden; background: radial-gradient(900px 500px at 15% 10%, rgba(249,115,22,.10), transparent 60%), radial-gradient(800px 600px at 85% 30%, rgba(23,79,147,.14), transparent 60%), var(--bg); }
.lp-hero-in { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; padding-block: 56px 72px; }
.lp-kicker { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: color-mix(in srgb, var(--gold) 16%, var(--surface)); color: #8f6a22; font-weight: 800; font-size: .92rem; }
.lp-kicker svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.lp-hero h1 { font: 800 clamp(2rem, 4.4vw, 3.3rem) var(--font-display); line-height: 1.35; margin: 16px 0 12px; color: var(--primary); }
.lp-hero h1 span { color: var(--gold); display: inline-block; position: relative; }
.lp-hero h1 span::after { content: ""; position: absolute; inset: auto 0 .12em 0; height: .22em; background: color-mix(in srgb, var(--orange) 30%, transparent); z-index: -1; border-radius: 4px; }
.lp-lead { font-size: 1.18rem; color: var(--ink-2); line-height: 1.9; max-width: 34em; }
.lp-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.lp-points { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--ink-2); font-weight: 600; font-size: .95rem; }
.lp-points li { display: flex; align-items: center; gap: 6px; }
.lp-points svg { width: 18px; height: 18px; fill: none; stroke: var(--good); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.lp-hero-art { position: relative; display: grid; place-items: center; min-height: 380px; }
.lp-blob { position: absolute; width: min(460px, 92%); aspect-ratio: 1; border-radius: 42% 58% 55% 45% / 48% 42% 58% 52%; background: linear-gradient(145deg, #2468b8, #0b2f5e); box-shadow: 0 30px 60px rgba(15, 52, 102, .3); animation: blob 12s ease-in-out infinite; }
@keyframes blob { 0%, 100% { border-radius: 42% 58% 55% 45% / 48% 42% 58% 52%; } 50% { border-radius: 55% 45% 42% 58% / 55% 58% 42% 45%; } }
.lp-hero-img { position: relative; width: min(420px, 86%); height: auto; -webkit-mask-image: radial-gradient(closest-side, #000 74%, transparent); mask-image: radial-gradient(closest-side, #000 74%, transparent); animation: floaty 6s ease-in-out infinite; }
.lp-float { position: absolute; background: var(--surface); color: var(--ink); border-radius: 14px; padding: 10px 14px; font-weight: 800; font-size: .9rem; box-shadow: 0 12px 30px rgba(20, 50, 100, .16); display: flex; align-items: center; gap: 6px; animation: floaty 5s ease-in-out infinite; }
.lp-float b { color: var(--orange-ink); font-size: 1.1rem; }
.lp-float svg { width: 18px; height: 18px; fill: none; stroke: var(--orange-strong); stroke-width: 2.2; }
.lp-float.f1 { top: 12%; right: 0; }
.lp-float.f2 { bottom: 14%; left: 0; animation-delay: -2s; }
.lp-float.f3 { bottom: 2%; right: 12%; animation-delay: -3.5s; }

.lp-sec { padding-block: 72px; }
.lp-sec.alt { background: var(--surface-2); }
.lp-eyebrow { color: var(--orange-ink); font-weight: 800; font-size: .92rem; margin-bottom: 4px; }
.lp-sec h2 { font: 800 clamp(1.6rem, 3vw, 2.2rem) var(--font-display); color: var(--primary); }
.lp-sec-head { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.lp-sec-head p:not(.lp-eyebrow) { color: var(--ink-2); margin-top: 4px; }
.lp-about { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: center; margin-bottom: 40px; }
.lp-about-text p:not(.lp-eyebrow) { font-size: 1.12rem; line-height: 2; color: var(--ink-2); margin-top: 12px; }
.lp-teacher { position: relative; border-radius: 22px; overflow: hidden; box-shadow: 0 20px 44px rgba(15, 52, 102, .2); }
.lp-teacher img { display: block; width: 100%; height: 300px; object-fit: cover; object-position: 50% 15%; }
.lp-teacher div { position: absolute; inset: auto 0 0 0; padding: 40px 18px 14px; background: linear-gradient(transparent, rgba(11, 47, 94, .95)); color: #fff; display: flex; flex-direction: column; }
.lp-teacher b { font: 800 1.25rem var(--font-display); }
.lp-teacher span { color: #e2c27a; font-weight: 700; }

.lp-ic { width: 56px; height: 56px; flex: none; border-radius: 16px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #2468b8, #123f7a); box-shadow: 0 10px 22px rgba(23, 79, 147, .25); transition: transform .25s cubic-bezier(.2,.8,.2,1), background .25s, box-shadow .25s; }
.lp-ic svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lp-ic svg .fill { fill: currentColor; stroke: none; }
.lp-ic.big { width: 66px; height: 66px; border-radius: 20px; }
.lp-ic.big svg { width: 32px; height: 32px; }
.lp-ic.sm { width: 44px; height: 44px; border-radius: 12px; }
.lp-ic.sm svg { width: 22px; height: 22px; }
.lp-ic.c-gold { background: linear-gradient(135deg, #e2c27a, #b48a35); box-shadow: 0 10px 22px rgba(180, 138, 53, .3); }
.lp-ic.c-green { background: linear-gradient(135deg, #34d399, #0f9d6b); box-shadow: 0 10px 22px rgba(15, 157, 107, .28); }
.lp-ic.c-orange { background: linear-gradient(135deg, #fb923c, #ea580c); box-shadow: 0 10px 22px rgba(234, 88, 12, .3); }
.lp-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.lp-feat, .lp-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; display: flex; flex-direction: column; gap: 10px; transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s, border-color .25s; outline: none; }
.lp-feat h3, .lp-card h3 { font-size: 1.2rem; color: var(--ink); }
.lp-feat p, .lp-card p { color: var(--ink-2); line-height: 1.8; }
.lp-feat:hover, .lp-feat:focus-visible, .lp-feat:active, .lp-card:hover, .lp-card:focus-visible, .lp-card:active { transform: translateY(-6px); border-color: color-mix(in srgb, var(--orange) 55%, var(--line)); box-shadow: 0 18px 36px rgba(20, 50, 100, .14); }
.lp-feat:hover .lp-ic, .lp-feat:focus-visible .lp-ic, .lp-feat:active .lp-ic, .lp-card:hover .lp-ic, .lp-card:focus-visible .lp-ic, .lp-card:active .lp-ic, .lp-sec-head:hover .lp-ic, .lp-trial:hover .lp-ic, .lp-contact-item:hover .lp-ic {
  background: linear-gradient(135deg, #fb923c, #ea580c); box-shadow: 0 12px 26px rgba(234, 88, 12, .4); transform: rotate(-8deg) scale(1.1); }
.lp-cards { display: grid; gap: 18px; }
.lp-cards.three { grid-template-columns: repeat(3, 1fr); }
.lp-cards.two { grid-template-columns: repeat(2, 1fr); }
.lp-card { text-decoration: none; color: inherit; }
.lp-more { margin-top: auto; color: var(--primary); font-weight: 800; transition: color .2s, transform .2s; }
.lp-card:hover .lp-more, .lp-card:active .lp-more { color: var(--orange-ink); transform: translateX(-6px); }
.lp-trial { margin-top: 26px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 24px; border-radius: 20px; background: linear-gradient(135deg, color-mix(in srgb, var(--orange) 14%, var(--surface)), var(--surface)); border: 2px dashed color-mix(in srgb, var(--orange) 50%, var(--line)); }
.lp-trial-text { display: flex; align-items: center; gap: 16px; min-width: 0; flex: 1; }
.lp-trial h3 { font-size: 1.3rem; color: var(--primary); }
.lp-trial p { color: var(--ink-2); margin-top: 4px; }
.lp-mock { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.lp-steps { list-style: none; padding: 0; margin: 0 0 26px; display: flex; flex-direction: column; gap: 12px; }
.lp-steps li { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; font-weight: 600; font-size: 1.02rem; transition: transform .2s, border-color .2s; }
.lp-steps li:hover, .lp-steps li:active { transform: translateX(-6px); border-color: var(--orange); }
.lp-steps b { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #34d399, #0f9d6b); color: #fff; font-size: 1.1rem; }
.lp-steps li:hover b { background: linear-gradient(135deg, #fb923c, #ea580c); }
.mk-card { background: var(--surface); border-radius: 20px; padding: 20px; box-shadow: 0 24px 50px rgba(15, 52, 102, .18); border: 1px solid var(--line); transform: rotate(-2deg); transition: transform .3s; }
.lp-mock-art:hover .mk-card { transform: rotate(0) scale(1.02); }
.mk-top { display: flex; justify-content: space-between; font-weight: 800; font-size: .88rem; color: var(--primary); }
.mk-timer { background: var(--low-soft); color: var(--low); padding: 2px 10px; border-radius: 999px; }
.mk-q { font: 800 1.5rem var(--font-display); color: var(--q-red, #c0262d); margin: 14px 0; }
.mk-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mk-opts span { border: 1.5px solid var(--line); border-radius: 10px; padding: 10px; font-weight: 700; color: var(--primary); }
.mk-opts .on { border-color: var(--primary); background: var(--primary-soft); }
.mk-dots { display: flex; gap: 5px; margin-top: 14px; flex-wrap: wrap; }
.mk-dots i { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line); }
.mk-dots i.a { background: var(--primary-soft); border-color: transparent; }
.mk-dots i.l { background: color-mix(in srgb, var(--gold) 25%, var(--surface)); border-color: var(--gold); }

.lp-contact { display: grid; grid-template-columns: 1fr 1.3fr; gap: 40px; align-items: start; }
.lp-contact-info p:not(.lp-eyebrow) { color: var(--ink-2); margin: 10px 0 18px; font-size: 1.05rem; }
.lp-contact-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); margin-bottom: 10px; transition: border-color .2s, transform .2s; }
.lp-contact-item:hover { border-color: var(--orange); transform: translateX(-4px); }
.lp-contact-item small { display: block; color: var(--ink-3); font-size: .8rem; }
.lp-contact-item b { font-size: 1.05rem; }
.lp-social { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.lp-social a { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); transition: background .2s, transform .2s; }
.lp-social a svg { width: 20px; height: 20px; fill: #fff; }
.lp-social a:hover, .lp-social a:focus-visible, .lp-social a:active { background: var(--orange-strong); transform: translateY(-3px) rotate(-6deg); }
.lp-form { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 26px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 18px 40px rgba(20, 50, 100, .08); }
.lp-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.lp-field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; color: var(--ink-2); font-size: .95rem; min-width: 0; }
.lp-in { position: relative; display: block; }
.lp-in svg { position: absolute; top: 14px; right: 14px; width: 20px; height: 20px; fill: none; stroke: var(--ink-3); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: stroke .2s; pointer-events: none; }
.lp-in input, .lp-in textarea { width: 100%; border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); font: 500 1rem var(--font-body); padding: 12px 46px 12px 14px; min-height: 48px; transition: border-color .2s, box-shadow .2s; }
.lp-in input[dir="ltr"] { text-align: right; }
.lp-in textarea { resize: vertical; line-height: 1.8; }
.lp-in input:focus, .lp-in textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 4px color-mix(in srgb, var(--orange) 18%, transparent); background: var(--surface); }
.lp-in:focus-within svg { stroke: var(--orange-strong); }
.lp-sent { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 30px 10px; }
.lp-sent h3 { color: var(--primary); font-size: 1.3rem; }
.lp-sent p { color: var(--ink-2); }
.lp-foot { background: linear-gradient(180deg, #113d75, #0b2f5e); color: #dbe6f5; padding-block: 34px; }
.lp-foot-in { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.lp-foot .lp-social { margin: 0; }
.lp-foot .lp-social a { background: rgba(255,255,255,.12); }
.lp-foot p { font-size: .88rem; color: rgba(219,230,245,.75); width: 100%; text-align: center; margin-top: 6px; }
.lp-foot .lp-brand small { color: #e2c27a; }
.trial-page { padding-top: 24px; }
.cta-signup { margin: 0; }
.trial-again { display: flex; justify-content: center; padding: 10px 0 30px; }
.auth-home { position: absolute; top: calc(18px + env(safe-area-inset-top, 0px)); right: max(24px, env(safe-area-inset-right, 0px)); font-weight: 800; color: var(--primary); text-decoration: none; padding: 8px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); z-index: 5; }
.auth-home:hover { color: #fff; background: var(--orange-strong); border-color: var(--orange-strong); }
.auth-side-form { position: relative; }
.msg-list { display: flex; flex-direction: column; gap: 12px; }
.msg { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.msg.new { border-inline-start: 4px solid var(--orange); }
.msg header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.msg-body { white-space: pre-wrap; line-height: 1.9; font-size: 1.02rem; }
.msg-contact { display: flex; gap: 16px; flex-wrap: wrap; color: var(--ink-2); font-weight: 700; }
.msg-alert { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; text-decoration: none; color: var(--ink); }
.msg-alert .link { margin-inline-start: auto; }

@media (max-width: 1024px) {
  .lp-menu { display: grid; }
  .lp-nav { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 2px; padding: 12px max(16px, env(safe-area-inset-right, 0px)) 18px max(16px, env(safe-area-inset-left, 0px)); background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 18px 30px rgba(20, 50, 100, .14); display: none; }
  .lp-nav.open { display: flex; }
  .lp-nav > a { padding: 14px; font-size: 1.05rem; }
  .lp-auth { margin: 10px 0 0; flex-direction: column; }
  .lp-auth .lp-btn { min-height: 50px; }
  .lp-hero-in { grid-template-columns: 1fr; padding-block: 36px 48px; text-align: center; }
  .lp-cta, .lp-points { justify-content: center; }
  .lp-lead { margin-inline: auto; }
  .lp-hero-art { min-height: 320px; }
  .lp-about, .lp-mock, .lp-contact { grid-template-columns: 1fr; }
  .lp-features, .lp-cards.three { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .lp-wrap, .lp-head-in { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .lp-head-in { min-height: 66px; }
  .lp-brand b { font-size: 1rem; } .lp-brand small { font-size: .74rem; }
  .lp-sec { padding-block: 48px; }
  .lp-features, .lp-cards.three, .lp-cards.two, .lp-form-row { grid-template-columns: 1fr; }
  .lp-cta .lp-btn { width: 100%; }
  .lp-float { font-size: .78rem; padding: 7px 10px; }
  .lp-hero-art { min-height: 280px; }
  .lp-trial { padding: 18px; }
  .lp-trial .lp-btn { width: 100%; }
  .lp-trial-text { flex-direction: column; text-align: center; }
  .lp-sec-head { flex-direction: column; text-align: center; }
  .lp-teacher img { height: 240px; }
  .lp-form { padding: 18px; }
  .auth-home { position: static; display: inline-block; margin-bottom: 12px; align-self: flex-start; }
  .auth-side-form { flex-direction: column; align-items: stretch; }
  .auth-side-form .auth-card { margin-inline: auto; }
}
@media (prefers-reduced-motion: reduce) { .lp-blob, .lp-hero-img, .lp-float { animation: none; } }

/* محرر الموقع: تبويبات ومعاينة الصفحة الرئيسية */
.se-tabs { margin-bottom: 4px; }
.se-tabs .seg-btn { padding: 11px 22px; font-size: 1rem; }
.pv-lp { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--bg); }
.pv-lp-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
.pv-lp-head img { width: 30px; height: 30px; border-radius: 8px; background: #fff; }
.pv-lp-head b { flex: 1; font-size: .9rem; }
.pv-btn { display: inline-block; background: linear-gradient(135deg, #fb923c, #ea580c); color: #fff; font-weight: 800; font-size: .72rem; padding: 5px 10px; border-radius: 8px; }
.pv-lp-hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 10px; align-items: center; padding: 14px; }
.pv-lp-hero h1 { font: 800 1.15rem var(--font-display); color: var(--primary); line-height: 1.4; }
.pv-lp-hero h1 span { color: var(--gold); }
.pv-lp-hero p { font-size: .78rem; color: var(--ink-2); margin: 6px 0 8px; }
.pv-lp-hero img { width: 100%; border-radius: 50%; aspect-ratio: 1; object-fit: cover; background: #174f93; }
.pv-about { display: grid; grid-template-columns: 1.5fr 1fr; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.pv-about h3 { font-size: .95rem; color: var(--primary); }
.pv-about p { font-size: .74rem; color: var(--ink-2); line-height: 1.7; margin-top: 4px; }
.pv-about img { width: 100%; height: 110px; object-fit: cover; object-position: 50% 15%; border-radius: 10px; }
.pv-feats, .pv-secs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pv-feats div, .pv-secs div { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.pv-feats b, .pv-secs b { font-size: .8rem; color: var(--ink); }
.pv-feats span, .pv-secs span { font-size: .7rem; color: var(--ink-3); line-height: 1.5; }
.panel-title small { font-weight: 500; font-size: .8rem; }
.signed-note { background: color-mix(in srgb, var(--orange) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--orange) 35%, var(--line)); border-radius: 12px; padding: 10px 12px; font-size: .9rem; line-height: 1.8; }
.signed-note .link { display: block; font-weight: 800; }

/* واجهة الصفحة الرئيسية بالصورة الجديدة: نص في المنتصف */
.lp-hero { background: radial-gradient(900px 520px at 70% 20%, rgba(226,194,122,.16), transparent 60%), radial-gradient(700px 500px at 10% 80%, rgba(23,79,147,.10), transparent 60%), linear-gradient(180deg, #f7f9fc, var(--bg)); }
.lp-hero-in { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; padding-block: 40px 56px; }
.lp-hero-text { display: flex; flex-direction: column; align-items: center; text-align: center; }
.lp-hero-logo { width: 96px; height: 96px; object-fit: contain; margin-bottom: 4px; filter: drop-shadow(0 8px 16px rgba(23,79,147,.18)); transition: transform .3s; }
.lp-hero-logo:hover { transform: rotate(-6deg) scale(1.06); }
.lp-hero h1 { margin: 14px 0 12px; font-size: clamp(1.9rem, 3.6vw, 3rem); line-height: 1.45; text-wrap: balance; }
.lp-hero h1 .h-gold { color: var(--gold); }
.lp-hero h1 .h-sep { display: none; }
.lp-hero h1 .h-gold { display: block; font-size: .82em; }
.lp-hero h1 .h-blue { display: block; }
.lp-hero h1 .h-blue { color: var(--primary); }
.lp-hero h1 span::after { display: none; }
.lp-lead { margin-inline: auto; text-align: center; }
.lp-cta { justify-content: center; }
.lp-points { justify-content: center; }
.lp-btn.gold { background: linear-gradient(90deg, #d6b468, #b48a35 45%, #174f93); color: #fff; box-shadow: 0 10px 24px rgba(23, 79, 147, .28); }
.lp-btn.gold svg { stroke-width: 3; }
.lp-btn.gold:hover, .lp-btn.gold:focus-visible { transform: translateY(-2px); background: linear-gradient(90deg, #fb923c, #ea580c 55%, #174f93); box-shadow: 0 14px 28px rgba(234, 88, 12, .35); }
.lp-hero-art { min-height: 0; }
.lp-photo { position: relative; width: min(100%, 520px); aspect-ratio: 476 / 572; border-radius: 28px; overflow: hidden; box-shadow: 0 28px 60px rgba(15, 52, 102, .22); transform: rotate(1.5deg); transition: transform .4s cubic-bezier(.2,.8,.2,1); }
.lp-photo::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255,255,255,.5); pointer-events: none; }
.lp-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lp-hero-art:hover .lp-photo { transform: rotate(0) scale(1.01); }
.lp-float { z-index: 2; }
.lp-float.f1 { top: 8%; right: -6px; }
.lp-float.f2 { bottom: 18%; left: -6px; }
.lp-float.f3 { bottom: -10px; right: 18%; }
.pv-center { text-align: center; }
.pv-center h1 span { color: var(--gold); }
.pv-btn.gold { background: linear-gradient(90deg, #d6b468, #b48a35 45%, #174f93); }
.pv-photo { border-radius: 12px !important; aspect-ratio: 476 / 572 !important; object-fit: cover; background: none !important; }
@media (max-width: 1024px) {
  .lp-hero-in { grid-template-columns: 1fr; gap: 26px; padding-block: 28px 44px; }
  .lp-hero-art { order: 2; }
  .lp-photo { width: min(100%, 460px); aspect-ratio: 4 / 3.4; transform: none; }
  .lp-photo img { object-position: 50% 0%; }
}
@media (max-width: 640px) {
  .lp-hero-logo { width: 76px; height: 76px; }
  .lp-hero h1 { font-size: 1.75rem; }
  .lp-lead { font-size: 1.05rem; }
  .lp-photo { aspect-ratio: 476 / 520; border-radius: 22px; }
  .lp-float.f1 { right: 4px; } .lp-float.f2 { left: 4px; } .lp-float.f3 { bottom: -12px; right: 10%; }
}

/* بطاقات الإحصائيات القابلة للضغط */
a.metric, a.tile { text-decoration: none; color: inherit; cursor: pointer; }
.metric-link, .tile-link { position: relative; transition: transform .2s, box-shadow .2s, border-color .2s; }
.metric-link:hover, .metric-link:focus-visible, .metric-link:active, .tile-link:hover, .tile-link:focus-visible, .tile-link:active { transform: translateY(-4px); border-color: var(--orange); box-shadow: 0 14px 30px rgba(234, 88, 12, .14); }
.m-go { position: absolute; top: 10px; left: 12px; color: var(--ink-3); font-weight: 800; transition: transform .2s, color .2s; z-index: 1; }
.metric-link:hover .m-go { color: var(--orange-ink); transform: translateX(-4px); }
.tile-link::after { content: "←"; position: absolute; top: 12px; left: 14px; color: var(--ink-3); font-weight: 800; transition: transform .2s, color .2s; }
.tile-link:hover::after { color: var(--orange-ink); transform: translateX(-4px); }
/* أزرار الدخول في الصفحة الدعائية: أصغر */
.lp-btn.sm { min-height: 38px; padding: 0 14px; font-size: .86rem; border-radius: 10px; gap: 6px; }
.lp-btn.sm svg { width: 16px; height: 16px; }
.lp-auth { gap: 8px; }
/* ---------- الجوال ---------- */
@media (max-width: 1100px) {
  .topbar-inner { flex-wrap: wrap; gap: 6px 12px; padding-block: 8px; }
  .nav { order: 3; flex-basis: 100%; }
  .brand-line { margin-inline-end: auto; }
  .student-view, .bell, .profile { margin-inline-start: 0 !important; }
  .sticky-head, .take-head { top: calc(118px + env(safe-area-inset-top, 0px)); }
  .q-nav { top: calc(200px + env(safe-area-inset-top, 0px)); }
  .lesson-list { top: calc(130px + env(safe-area-inset-top, 0px)); }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .portals { grid-template-columns: repeat(2, 1fr); }
  .portals .p-mock { grid-column: 1 / -1; }
}
@media (max-width: 960px) {
  .portals { grid-template-columns: 1fr; }
  .course-layout, .mock-setup { grid-template-columns: 1fr; }
  .lesson-list { position: static; max-height: none; }
  .auth2 { grid-template-columns: 1fr; }
  .auth-side-brand { order: -1; padding: 24px 16px 20px; }
  .asb-hero { width: 220px; }
  .asb-tag { display: none; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .bh-photo { width: 200px; }
  .grid-2, .take-body, .result-hero { grid-template-columns: 1fr; }
  .result-hero { justify-items: center; text-align: center; }
  .result-sections { width: 100%; text-align: start; }
  .q-nav { position: static; }
  .q-dots { grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); }
  .meta-grid { grid-template-columns: 1fr 1fr; }
  .meta-grid .grow { grid-column: 1 / -1; }
  .roles-help { grid-template-columns: 1fr; }
  .format-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .auth-body { grid-template-columns: 1fr; gap: 20px; padding-block: 20px 40px; }
  .auth-main { order: -1; }
  .page, .auth-top, .auth-body { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .auth-top { padding-top: 16px; }
  .brand-hero { height: 150px; }
  .bh-copy h2 { font-size: 1.1rem; }
  .bh-name { font-size: .9rem; }
  .bh-text { padding: 16px; gap: 12px; }
  .bh-logo { width: 56px; height: 56px; border-radius: 14px; padding: 5px; }
  .bh-photo { width: 110px; }
  .bh-tag, .bh-social span { display: none; }
  .bh-social a { width: 28px; height: 28px; }
  .metric strong { font-size: 1.3rem; }
  .toolbar.split .input.search { max-width: none; flex-basis: 100%; }
  .search-wrap { max-width: none; flex-basis: 100%; }
  .welcome h1 { font-size: 1.35rem; }
  .cta { width: 100%; }
  .m-icon { width: 42px; height: 42px; border-radius: 12px; }
  .metric { gap: 8px; padding: 14px; flex-direction: column; align-items: flex-start; }
  .metrics.five { grid-template-columns: repeat(2, 1fr); }
  .metrics.five .metric:first-child { grid-column: 1 / -1; }
  .admin-top { padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); gap: 8px; }
  .admin-top .student-view span { display: none; }
  .admin-top-title { font-size: .98rem; }
  .kv.cols { grid-template-columns: 1fr; }
  .heat { gap: 2px; }
  .podium { gap: 8px; }
  .pod-1 { min-height: 250px; } .pod-2 { min-height: 215px; } .pod-3 { min-height: 190px; }
  .pod-avatar { width: 46px; height: 46px; font-size: 1.2rem; } .pod-val { font-size: 1.1rem; } .pod-name { font-size: .85rem; } .pod-meta { display: none; }
  .day-chart { gap: 3px; } .dc-lbl { font-size: .55rem; } .dc-val { font-size: .6rem; }
  .se-img { flex-direction: column; align-items: flex-start; }
  .portals.mini { grid-template-columns: 1fr; }
  .m-body { width: 100%; }
  .ms-text { flex-direction: column; gap: 10px; }
  .mock-setup { padding: 18px; }
  .welcome .cta { order: 2; }
  .nav a { padding: 8px 10px; border-top: 0; }
  .profile-btn { padding: 3px; }
  .caret { display: none; }
  .sample-q { display: none; }
  .hero-banner { border-radius: 10px; }
  .topbar-inner { flex-wrap: wrap; gap: 6px 12px; padding-block: 8px; }
  .nav { order: 3; flex-basis: 100%; }
  .bell { margin-inline-start: auto; width: 36px; height: 36px; }
  .bell ~ .profile { margin-inline-start: 0; }
  .profile { margin-inline-start: auto; }
  .user-name { display: none; }
  .sticky-head, .take-head { top: calc(104px + env(safe-area-inset-top, 0px)); }
  .options, .opt-review, .opt-edit, .field-row { grid-template-columns: 1fr; }
  .q-area { padding: 18px; }
  .q-text { font-size: 1.45rem; }
  .option { font-size: 1.18rem; min-height: 60px; }
  .wq-text { font-size: 1.2rem; }
  .opt-review li { font-size: 1.05rem; }
  .q-actions .btn { padding: 0 10px; }
  .metrics.three { grid-template-columns: 1fr; }
  .student-view span { display: none; }
  .tabs.gold .tab { font-size: .9rem; white-space: nowrap; padding: 10px 6px; }
  .student-view { width: 36px; height: 36px; padding: 0; justify-content: center; margin-inline-start: auto; }
  .student-view ~ .bell { margin-inline-start: 0; }
  .file-row { grid-template-columns: 1fr auto; }
  .file-row .input[data-ff="url"] { grid-column: 1 / -1; grid-row: 2; }
  .asb-hero { width: 180px; }
  .seg { align-self: stretch; }
  .seg-btn { flex: 1; padding: 9px 10px; }
  h1 { font-size: 1.4rem; }
  .bar-row { grid-template-columns: 96px 1fr 84px; font-size: .84rem; }
  .take-head { grid-template-columns: 1fr; }
  .input.search { max-width: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* question text: fill each line fully before wrapping */
.q-text { text-wrap: wrap; }
.q-text > span:last-child { flex: 1; min-width: 0; text-wrap: wrap; }

/* ---------- مساعد البحث ---------- */
.search-fab { position: fixed; z-index: 91; left: calc(20px + env(safe-area-inset-left, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  width: 58px; height: 58px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--primary); color: var(--primary-ink); box-shadow: 0 10px 26px color-mix(in srgb, var(--primary) 40%, transparent); transition: background .2s, transform .2s; }
.search-fab svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.search-fab:hover, .search-fab:focus-visible { background: var(--orange-strong); color: #fff; transform: scale(1.06); }
.search-fab[hidden] { display: none; }
body:has(.wa-float) .search-fab { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
body.in-exam .search-fab, body.sr-open .search-fab { display: none; }
.sf-tip { position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%); white-space: nowrap; background: var(--ink); color: var(--bg);
  font: 700 .85rem var(--font-body); padding: 6px 12px; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.sf-tip kbd { font: 600 .72rem var(--font-body); background: color-mix(in srgb, var(--bg) 20%, transparent); border-radius: 5px; padding: 1px 5px; margin-inline-start: 4px; }
.search-fab:hover .sf-tip, .search-fab:focus-visible .sf-tip { opacity: 1; }
@media (max-width: 760px) { .search-fab { width: 52px; height: 52px; left: calc(14px + env(safe-area-inset-left, 0px)); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  body:has(.wa-float) .search-fab { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); } .sf-tip { display: none; } }
@media print { .search-fab { display: none; } }

.sr-wrap { position: fixed; inset: 0; z-index: 95; background: rgba(10, 20, 35, .45); display: flex; justify-content: center; align-items: flex-start;
  padding: max(6vh, 16px) 16px 16px; }
.sr-panel { width: 100%; max-width: 760px; max-height: calc(100vh - max(6vh, 16px) - 16px); display: flex; flex-direction: column;
  background: var(--surface); border-radius: 16px; box-shadow: 0 30px 60px rgba(0,0,0,.28); overflow: hidden; }
.sr-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.sr-head > svg { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--ink-3); stroke-width: 2.2; stroke-linecap: round; }
.sr-input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: 600 1.15rem var(--font-body); padding: 8px 0; }
.sr-kbd { font: 600 .72rem var(--font-body); color: var(--ink-3); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }
.sr-chips { padding: 10px 16px 0; flex-wrap: wrap; }
.sr-chips:empty { display: none; }
.sr-results { overflow: auto; padding: 8px 10px 14px; overscroll-behavior: contain; }
.sr-group h4 { margin: 12px 8px 6px; font-size: .82rem; color: var(--ink-3); font-weight: 700; display: flex; gap: 6px; align-items: center; }
.sr-group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.sr-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; }
.sr-item:hover, .sr-item.active { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 25%, transparent); }
.sr-ic { flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--primary); }
.sr-ic svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sr-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sr-title { font-weight: 700; color: var(--ink); line-height: 1.6; }
.sr-q .sr-title { color: var(--q-red, var(--low)); font-size: 1.05rem; }
.sr-meta { color: var(--ink-3); font-size: .8rem; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sr-meta .sec-tag { font-size: .72rem; }
.sr-passage { font-size: .85rem; color: var(--primary); font-weight: 600; }
.sr-opts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .88rem; color: var(--ink-2); }
.sr-opts i { font-style: normal; color: var(--letter); font-weight: 800; margin-inline-end: 4px; }
.sr-go { flex: none; align-self: center; color: var(--primary); font-weight: 700; font-size: .85rem; white-space: nowrap; }
.sr-acts { flex: none; align-self: center; display: flex; gap: 6px; }
.sr-item .pill { align-self: center; }
.sr-results mark { background: var(--hl); color: var(--hl-ink); border-radius: 3px; padding: 0 2px; }
.sr-more { margin: 4px 8px 0; font-size: .85rem; }
.sr-empty { text-align: center; padding: 30px 20px; color: var(--ink-2); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.sr-empty > svg { width: 40px; height: 40px; fill: none; stroke: var(--ink-3); stroke-width: 1.6; stroke-linecap: round; }
.sr-empty p { margin: 0; max-width: 520px; line-height: 1.8; }
.sr-warn { background: var(--mid-soft); color: var(--mid); border-radius: 10px; padding: 8px 12px; font-weight: 600; font-size: .88rem; }
@media (max-width: 640px) {
  .sr-wrap { padding: 0; }
  .sr-panel { max-width: none; max-height: 100vh; height: 100%; border-radius: 0; }
  .sr-acts { flex-direction: column; }
  .sr-kbd { display: none; }
}
/* حل سؤال من البحث */
.sq-sec { align-self: flex-start; margin: 0; }
.sq-passage { max-height: 38vh; overflow: auto; }
.sq-text { font-size: 1.3rem; margin: 4px 0; }
.sq-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 640px) { .sq-opts { grid-template-columns: 1fr; } }
.sq-verdict { margin: 0 0 6px; font-weight: 800; font-size: 1.05rem; padding: 8px 12px; border-radius: 10px; }
.sq-verdict.good { background: var(--good-soft); color: var(--good); }
.sq-verdict.low { background: var(--low-soft); color: var(--low); }
/* السؤال المفتوح من البحث في محرر الاختبار */
.q-edit.flash { outline: 3px solid var(--hl); outline-offset: 3px; animation: qflash 1.2s ease-in-out 2; }
@keyframes qflash { 50% { background: color-mix(in srgb, var(--hl) 25%, var(--surface)); } }
.q-edit { scroll-margin-top: 150px; }
@media (max-width: 640px) {
  .sr-q { flex-wrap: wrap; }
  .sr-q .sr-go { display: none; }
  .sr-q .sr-acts { flex-direction: row; width: 100%; justify-content: flex-end; }
}

/* خط المنصة: كاليبري بولد في كل مكان */
body, body *, input, select, textarea, button { font-weight: 700 !important; }

/* ---------- نتائج طلابنا ---------- */
.between-head .gal-manage { margin-inline-start: auto; }
.gal { position: relative; }
.gal-track { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding: 6px 4px 18px;
  scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--primary) 40%, transparent) transparent; overscroll-behavior-x: contain; }
.gal-track:focus-visible { outline: 2px solid var(--orange); outline-offset: 4px; border-radius: 12px; }
.gal-item { flex: 0 0 auto; height: clamp(260px, 42vh, 420px); aspect-ratio: auto; scroll-snap-align: start; padding: 0; border: 0; cursor: zoom-in;
  border-radius: 14px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.gal-item img { height: 100%; width: auto; max-width: min(78vw, 640px); object-fit: cover; display: block; }
.gal-item:hover, .gal-item:focus-visible { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(16, 40, 70, .18); outline: none; }
.gal-item.skel { width: 280px; background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: galSkel 1.2s linear infinite; cursor: default; }
@keyframes galSkel { to { background-position: -200% 0; } }
.gal-empty { padding: 30px; color: var(--ink-2); font-weight: 700; }
.gal-arrow { position: absolute; top: calc(50% - 32px); z-index: 2; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--primary); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); }
.gal-arrow svg, .gal-lb-nav svg, .gal-lb-x svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.gal-arrow:hover { background: var(--orange-strong); color: #fff; border-color: var(--orange-strong); }
.gal-arrow.prev { right: -14px; } .gal-arrow.next { left: -14px; }
.gal-arrow[hidden] { display: none; }
@media (max-width: 760px) { .gal-arrow { display: none; } .gal-item { height: 300px; } }
@media (prefers-reduced-motion: reduce) { .gal-track { scroll-behavior: auto; } .gal-item.skel { animation: none; } }

.gal-lb { position: fixed; inset: 0; z-index: 120; background: rgba(6, 12, 22, .92); display: flex; align-items: center; justify-content: center; padding: 56px 70px; }
.gal-lb figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.gal-lb img { max-width: 100%; max-height: calc(100vh - 140px); object-fit: contain; border-radius: 10px; box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.gal-lb figcaption { color: #e5ecf5; font-size: .95rem; }
.gal-lb-x, .gal-lb-nav { position: absolute; border: 0; width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; cursor: pointer; }
.gal-lb-x:hover, .gal-lb-nav:hover { background: var(--orange-strong); }
.gal-lb-x { top: 14px; left: 14px; }
.gal-lb-nav.prev { right: 14px; top: 50%; transform: translateY(-50%); }
.gal-lb-nav.next { left: 14px; top: 50%; transform: translateY(-50%); }
@media (max-width: 640px) { .gal-lb { padding: 56px 8px; } .gal-lb-nav { top: auto; bottom: 14px; transform: none; } }

/* صفحة إدارة الصور */
.gal-up { cursor: pointer; }
.gal-up svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.gal-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 26px 16px; border: 2px dashed var(--line);
  border-radius: 14px; background: var(--surface); cursor: pointer; color: var(--ink-2); margin-bottom: 8px; transition: border-color .15s, background .15s; }
.gal-drop b { color: var(--primary); font-size: 1.05rem; }
.gal-drop:hover, .gal-drop.over { border-color: var(--orange); background: color-mix(in srgb, var(--orange) 6%, var(--surface)); }
.gal-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.gal-card { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.gal-card img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: var(--surface-2); display: block; }
.gal-card figcaption { display: flex; align-items: center; gap: 8px; padding: 8px 10px; }
.gal-card small { color: var(--ink-3); }
.gal-n { background: var(--primary-soft); color: var(--primary); border-radius: 6px; padding: 0 8px; }
.gal-tools { margin-inline-start: auto; display: flex; gap: 2px; }
.gal-tools svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* استيراد من Google / Microsoft Forms */
.form-link-row { display: flex; gap: 8px; flex-wrap: wrap; }
.form-link-row .input { flex: 1 1 320px; min-width: 0; }
.form-import-note { background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent); border-radius: 12px; padding: 12px 16px; margin-bottom: 10px; }
.form-import-note p { margin: 4px 0; line-height: 1.8; }
.ed-missing { background: var(--mid-soft); color: var(--mid); border-radius: 10px; padding: 8px 14px; margin: 0 0 10px; }
.need-answer { display: none; color: var(--orange-ink); margin-inline-start: 6px; }
.q-edit.no-answer { border-color: var(--orange); box-shadow: 0 0 0 2px color-mix(in srgb, var(--orange) 25%, transparent); }
.q-edit.no-answer .need-answer { display: inline; }
/* لوحة التحكم: صفوف المحتوى قابلة للضغط */
.kv-links li { padding: 0; }
.kv-links li > a, .kv-links li.split { display: flex; justify-content: space-between; gap: 12px; padding: 9px 8px; border-radius: 8px; color: inherit; text-decoration: none; flex: 1; }
.kv-links li > a:hover, .kv-links li > a:focus-visible { background: var(--primary-soft); }
.kv-links li > a:hover span, .kv-links li > a:hover b { color: var(--primary); }
.kv-links li > a::after { content: "←"; color: var(--ink-3); margin-inline-start: 4px; }
.kv-links li > a b { margin-inline-start: auto; }
.kv-links li.split a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.kv-links li.sub > a span { padding-inline-start: 16px; }
.pill.cat-paper { background: color-mix(in srgb, #2e9e6b 16%, var(--surface)); color: #1f7a50; }
/* الاختبارات المحاكية */
.mock-types { margin-bottom: 14px; }
.mock-types a.seg-btn { text-decoration: none; }
.mk-grid { display: grid; gap: 16px; }
.mk-admin.off { opacity: .75; }
.mk-admin .panel-head { margin-bottom: 6px; }
.mk-stats { margin-bottom: 10px; }
.field-row.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 700px) { .field-row.three { grid-template-columns: 1fr; } }
