/* ==========================================================
   أكاديمية عابر — نظام التصميم
   غيّر ألوان الهوية من هنا لتطابق منصة عابر الأم
   ========================================================== */
:root {
  --brand: #d9442b;          /* اللون الرئيسي (أحمر تحريري) */
  --brand-ink: #ffffff;
  --accent: #138a7e;         /* لون البيانات */
  --gold: #e0a526;

  --bg: #f5f2ea;
  --surface: #ffffff;
  --surface-2: #ece7db;
  --ink: #111a26;
  --ink-2: #4a5462;
  --line: #d8d1c2;
  --hero-bg: #0f1823;
  --hero-ink: #f5f2ea;
  --hero-dim: #9aa6b4;

  --radius: 14px;
  --shadow: 0 1px 2px rgb(17 26 38 / .06), 0 8px 24px rgb(17 26 38 / .06);
  --font-head: "Readex Pro", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --font-body: "IBM Plex Sans Arabic", system-ui, sans-serif;
  --wrap: 1180px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c131c; --surface: #131d29; --surface-2: #1a2633;
    --ink: #edf0f3; --ink-2: #a3aebb; --line: #263445;
    --hero-bg: #070c12; --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25);
  }
}
:root[data-theme="dark"] {
  --bg: #0c131c; --surface: #131d29; --surface-2: #1a2633;
  --ink: #edf0f3; --ink-2: #a3aebb; --line: #263445;
  --hero-bg: #070c12; --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 17px; line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.3; margin: 0 0 .5em; font-weight: 600; }
a { color: inherit; }
img { max-width: 100%; display: block; }
.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- الهيدر ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 24px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-head); }
.logo-mark {
  width: 38px; height: 38px; border-radius: 10px; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 20px;
}
.logo b { display: block; font-size: 18px; line-height: 1.1; }
.logo small { display: block; font-size: 11px; color: var(--ink-2); letter-spacing: .5px; }
.nav { display: flex; gap: 22px; margin-inline-start: auto; }
.nav a { text-decoration: none; color: var(--ink-2); font-size: 15px; }
.nav a:hover { color: var(--ink); }
.theme-btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer; display: grid; place-items: center;
}


/* ---------- أزرار ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer;
  padding: 12px 22px; border-radius: 999px; font: 600 15px var(--font-head);
  text-decoration: none; white-space: nowrap; transition: transform .15s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 85%, #000); }
.btn-ghost { background: transparent; color: inherit; border: 1px solid currentColor; }
.btn-sm { padding: 8px 16px; font-size: 14px; }

/* ---------- الواجهة الرئيسية ---------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--hero-bg); color: var(--hero-ink);
  padding: 96px 0 88px;
}
.hero::before { /* شبكة بيانية خفيفة */
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgb(255 255 255 / .05) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / .05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 30% 40%, #000 30%, transparent 75%);
}
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--hero-dim);
  border: 1px solid rgb(255 255 255 / .15); border-radius: 999px; padding: 4px 14px; margin-bottom: 22px;
}
.eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px rgb(217 68 43 / .25); }
.hero h1 { font-size: clamp(36px, 5.4vw, 64px); font-weight: 700; letter-spacing: -.5px; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero p.lead { font-size: 19px; color: var(--hero-dim); max-width: 34em; margin: 0 0 32px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .btn-ghost { color: var(--hero-ink); border-color: rgb(255 255 255 / .3); }
.hero-viz { position: relative; }
.hero-viz svg { width: 100%; height: auto; }
@media (max-width: 900px) {
  .hero { padding: 64px 0; }
  .hero .wrap { grid-template-columns: 1fr; gap: 40px; }
}

/* شريط الأرقام */
.stats { border-bottom: 1px solid var(--line); background: var(--surface); }
.stats .wrap { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 28px 20px; border-inline-start: 1px solid var(--line); }
.stat:first-child { border-inline-start: 0; }
.stat b { display: block; font: 700 32px var(--font-head); color: var(--ink); }
.stat span { color: var(--ink-2); font-size: 14px; }
@media (max-width: 700px) {
  .stats .wrap { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-inline-start: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* ---------- الأقسام ---------- */
section.block { padding: 88px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 40px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(28px, 3.4vw, 40px); margin: 0; }
.section-head p { color: var(--ink-2); margin: 6px 0 0; max-width: 36em; }
.kicker { font: 600 13px var(--font-head); color: var(--brand); letter-spacing: 1px; margin-bottom: 8px; display: block; }

/* الدورة المميزة */
.feature {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px);
  overflow: hidden; box-shadow: var(--shadow);
}
.feature-cover { background: #0f1823; min-height: 380px; position: relative; }
.feature-cover svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.feature-body { padding: 44px; display: flex; flex-direction: column; }
.feature-body h3 { font-size: 30px; }
.feature-body p { color: var(--ink-2); }
.badge {
  display: inline-block; font: 600 12px var(--font-head); padding: 4px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent);
}
.badge.brand { background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); }
.badge.muted { background: var(--surface-2); color: var(--ink-2); }
.meta-row { display: flex; flex-wrap: wrap; gap: 18px; margin: 18px 0 28px; color: var(--ink-2); font-size: 14px; }
.meta-row span { display: inline-flex; align-items: center; gap: 6px; }
.meta-row svg { width: 16px; height: 16px; }
.feature-body .btn { align-self: flex-start; margin-top: auto; }
@media (max-width: 900px) {
  .feature { grid-template-columns: 1fr; }
  .feature-cover { min-height: 240px; }
  .feature-body { padding: 28px; }
}

/* المسارات */
.tracks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.track {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 24px; transition: border-color .2s, transform .2s;
}
.track:hover { border-color: var(--brand); transform: translateY(-3px); }
.track .ic {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 18px;
  background: var(--surface-2); color: var(--brand);
}
.track .ic svg { width: 24px; height: 24px; }
.track h3 { font-size: 19px; }
.track p { color: var(--ink-2); font-size: 15px; margin: 0; }
.track .count { display: block; margin-top: 14px; font-size: 13px; color: var(--accent); font-weight: 600; }
@media (max-width: 960px) { .tracks { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .tracks { grid-template-columns: 1fr; } }

/* بطاقات الدورات */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; text-decoration: none; transition: transform .2s, box-shadow .2s;
}
a.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-cover { aspect-ratio: 16 / 9; background: #0f1823; position: relative; }
.card-cover svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.card-body { padding: 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body h3 { font-size: 19px; margin: 4px 0 0; }
.card-body p { color: var(--ink-2); font-size: 15px; margin: 0; }
.card-foot { margin-top: auto; padding-top: 14px; display: flex; justify-content: space-between; color: var(--ink-2); font-size: 13px; border-top: 1px dashed var(--line); }
.card.soon { opacity: .78; }
@media (max-width: 960px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .cards { grid-template-columns: 1fr; } }

/* كيف تعمل */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; counter-reset: s; border-top: 2px solid var(--ink); }
.step { padding: 26px 22px 0 22px; border-inline-start: 1px solid var(--line); }
.step:first-child { border-inline-start: 0; padding-inline-start: 0; }
.step::before { counter-increment: s; content: "0" counter(s); font: 700 15px var(--font-head); color: var(--brand); display: block; margin-bottom: 12px; }
.step h3 { font-size: 19px; }
.step p { color: var(--ink-2); font-size: 15px; margin: 0; }
@media (max-width: 860px) {
  .steps { grid-template-columns: 1fr 1fr; row-gap: 28px; }
  .step:nth-child(3) { border-inline-start: 0; padding-inline-start: 0; }
}
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } .step { border-inline-start: 0; padding-inline-start: 0; } }

/* شريط الدعوة */
.cta {
  background: var(--brand); color: #fff; border-radius: calc(var(--radius) + 6px);
  padding: 56px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center;
  position: relative; overflow: hidden;
}
.cta h2 { font-size: clamp(26px, 3vw, 36px); margin: 0 0 8px; }
.cta p { margin: 0; opacity: .9; }
.cta form { display: flex; gap: 8px; background: #fff; border-radius: 999px; padding: 6px; }
.cta input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 0 16px;
  font: 15px var(--font-body); color: #111a26;
}
.cta .btn { background: #111a26; color: #fff; }
.cta .note { font-size: 13px; margin-top: 10px; opacity: .85; min-height: 1.4em; }
@media (max-width: 820px) { .cta { grid-template-columns: 1fr; padding: 32px 24px; } }

/* الأسئلة */
.faq { max-width: 820px; }
.faq details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq summary { cursor: pointer; font: 600 18px var(--font-head); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand); font-size: 24px; line-height: 1; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--ink-2); margin: 12px 0 0; }

/* الفوتر */
footer.site { border-top: 1px solid var(--line); padding: 48px 0 32px; margin-top: 40px; color: var(--ink-2); font-size: 15px; }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: center; }
footer.site a { color: var(--ink-2); text-decoration: none; }
footer.site a:hover { color: var(--brand); }
footer.site .links { display: flex; gap: 20px; flex-wrap: wrap; }

/* ==========================================================
   صفحة الدورة
   ========================================================== */
.course-hero { background: var(--hero-bg); color: var(--hero-ink); padding: 56px 0 48px; position: relative; overflow: hidden; }
.course-hero .wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: center; position: relative; }
.crumbs { font-size: 14px; color: var(--hero-dim); margin-bottom: 14px; }
.crumbs a { color: var(--hero-dim); text-decoration: none; }
.crumbs a:hover { color: #fff; }
.course-hero h1 { font-size: clamp(30px, 4vw, 46px); }
.course-hero p { color: var(--hero-dim); font-size: 18px; }
.course-hero .meta-row { color: var(--hero-dim); margin-bottom: 0; }
.course-hero .cover-box { border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/10; position: relative; border: 1px solid rgb(255 255 255 / .1); }
.course-hero .cover-box svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.progress-line { margin-top: 22px; max-width: 420px; }
.progress-line .bar { height: 6px; background: rgb(255 255 255 / .12); border-radius: 99px; overflow: hidden; }
.progress-line .bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .4s; }
.progress-line small { color: var(--hero-dim); font-size: 13px; }
@media (max-width: 900px) { .course-hero .wrap { grid-template-columns: 1fr; } .course-hero .cover-box { display: none; } }

.tabs { position: sticky; top: 68px; z-index: 40; background: var(--bg); border-bottom: 1px solid var(--line); }
.tabs .wrap { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.tabs button {
  border: 0; background: none; padding: 16px 14px; font: 600 15px var(--font-head); color: var(--ink-2);
  cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--brand); }

/* المشغّل والقائمة */
.player-layout { display: grid; grid-template-columns: 1fr 360px; gap: 28px; padding: 32px 0 64px; align-items: start; }
@media (max-width: 1000px) { .player-layout { grid-template-columns: 1fr; } }
.player {
  aspect-ratio: 16 / 9; background: #070c12; border-radius: var(--radius); overflow: hidden; position: relative;
}
.player iframe, .player video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #c9d1da; padding: 24px; }
.player-empty svg { width: 54px; height: 54px; margin: 0 auto 14px; color: var(--gold); }
.player-empty b { font: 600 20px var(--font-head); color: #fff; display: block; }
.lesson-head { display: flex; justify-content: space-between; gap: 16px; align-items: start; margin-top: 22px; flex-wrap: wrap; }
.lesson-head h2 { font-size: 24px; margin: 0; }
.lesson-head .mod { color: var(--ink-2); font-size: 14px; }
.lesson-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-line { background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.btn-line:hover { border-color: var(--ink-2); }
.btn-done[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }

.syllabus { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; position: sticky; top: 140px; max-height: calc(100vh - 160px); overflow-y: auto; }
@media (max-width: 1000px) { .syllabus { position: static; max-height: none; } }
.syllabus h3 { font-size: 16px; padding: 18px 20px; margin: 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; }
.syllabus h3 small { font: 500 13px var(--font-body); color: var(--ink-2); }
.mod-group > button {
  width: 100%; text-align: start; background: var(--surface-2); border: 0; border-bottom: 1px solid var(--line);
  padding: 14px 20px; font: 600 14px var(--font-head); color: var(--ink); cursor: pointer; display: flex; justify-content: space-between; gap: 10px;
}
.mod-group > button small { color: var(--ink-2); font-weight: 400; white-space: nowrap; }
.mod-group ol { list-style: none; margin: 0; padding: 0; }
.mod-group[data-collapsed="true"] ol { display: none; }
.lesson-btn {
  width: 100%; display: flex; gap: 12px; align-items: start; text-align: start; padding: 12px 20px; border: 0;
  background: none; border-bottom: 1px solid var(--line); cursor: pointer; color: var(--ink); font: 14px/1.6 var(--font-body);
}
.lesson-btn:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.lesson-btn[aria-current="true"] { background: color-mix(in srgb, var(--brand) 9%, transparent); box-shadow: inset -3px 0 0 var(--brand); }
.lesson-btn .dot {
  flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line);
  display: grid; place-items: center; margin-top: 1px; font-size: 11px; color: var(--ink-2);
}
.lesson-btn.done .dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.lesson-btn .t { flex: 1; }
.lesson-btn .d { color: var(--ink-2); font-size: 12px; display: block; }
.lesson-btn .pending { color: var(--gold); }

/* لوحات المعلومات */
.panel { display: none; padding: 40px 0 72px; }
.panel.active { display: block; }
.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.checklist li { display: flex; gap: 12px; align-items: start; }
.checklist li::before {
  content: "✓"; flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); font-weight: 700; font-size: 13px; margin-top: 3px;
}
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.box + .box { margin-top: 16px; }
.box h3 { font-size: 17px; }
.resource { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.resource:last-child { border-bottom: 0; }
.resource .kind { font: 700 11px var(--font-head); background: var(--surface-2); padding: 6px 8px; border-radius: 6px; color: var(--brand); }
.empty-note { color: var(--ink-2); font-size: 15px; }

/* الشهادة */
.cert {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  padding: 40px; text-align: center; max-width: 760px; margin-inline: auto;
}
.cert-preview {
  border: 2px solid var(--ink); outline: 1px solid var(--ink); outline-offset: 6px; padding: 40px 24px; margin: 24px auto; max-width: 560px;
  background: var(--bg);
}
.cert-preview h3 { font-size: 28px; margin: 6px 0; }
.cert-preview .name { font: 700 24px var(--font-head); color: var(--brand); border-bottom: 1px dashed var(--line); display: inline-block; padding: 4px 24px; margin: 10px 0; min-width: 60%; }
.cert input { border: 1px solid var(--line); border-radius: 999px; padding: 10px 18px; font: 15px var(--font-body); background: var(--bg); color: var(--ink); width: min(320px, 100%); }


/* حركة */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s, transform .6s; }
  .reveal.in { opacity: 1; transform: none; }
  .bar-grow { transform-origin: bottom; animation: grow 1.2s cubic-bezier(.2,.8,.2,1) both; }
  @keyframes grow { from { transform: scaleY(0); } }
}

/* ==========================================================
   النظام: نماذج، تنبيهات، لوحة التحكم
   ========================================================== */
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.page { padding: 48px 0 72px; }
.narrow { max-width: 820px; }
.center-page { padding: 120px 0; text-align: center; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge.ok { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.badge.gold { background: color-mix(in srgb, var(--gold) 18%, transparent); color: #a26f00; }
.badge.bad { background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); }
:root[data-theme="dark"] .badge.gold { color: var(--gold); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge.gold { color: var(--gold); } }
.pill { background: var(--brand); color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 7px; font-weight: 700; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-2); cursor: pointer; display: inline-flex; gap: 4px; align-items: center; font-size: 15px; }
.linklike:hover { color: var(--ink); }
.nav a, .nav .linklike { display: inline-flex; align-items: center; gap: 5px; }
.nav { align-items: center; }
.nav .btn { color: var(--brand-ink); }
.menu-btn { display: none; }
.btn-block { width: 100%; justify-content: center; }
.btn-ok { background: var(--accent); color: #fff; }
.btn-danger { background: transparent; border: 1px solid var(--brand); color: var(--brand); }
.btn-danger:hover { background: var(--brand); color: #fff; }
.btn-dark { background: #111a26; color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-stack { display: grid; gap: 8px; }
.btn-stack .btn { width: 100%; justify-content: center; }
.btn-stack form { display: block; }

@media (max-width: 860px) {
  .menu-btn { display: grid; }
  .theme-btn#themeBtn { margin-inline-start: auto; }
  .nav { display: none; position: absolute; top: 68px; inset-inline: 0; background: var(--surface); border-bottom: 1px solid var(--line);
         flex-direction: column; align-items: stretch; padding: 12px 16px; gap: 4px; margin: 0; box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav a, .nav .linklike { padding: 10px 4px; }
  .nav .btn { justify-content: center; }
}

.flash-wrap { padding-top: 16px; }
.alert { padding: 12px 16px; border-radius: 10px; margin: 0 0 12px; border: 1px solid; font-size: 15px; }
.alert-ok { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.alert-bad { background: color-mix(in srgb, var(--brand) 9%, var(--surface)); border-color: color-mix(in srgb, var(--brand) 35%, transparent); }
.alert-info { background: var(--surface); border-color: var(--line); }

/* نماذج */
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font: 600 14px var(--font-head); }
.form label small { font-weight: 400; color: var(--ink-2); font-family: var(--font-body); }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 10px;
  padding: 10px 14px; font: 400 15px var(--font-body);
}
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 45%, transparent); border-color: var(--brand); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--brand); }
input[type="file"] { padding: 8px; }
.form label.check, label.check { display: flex; gap: 10px; align-items: flex-start; font: 400 15px var(--font-body); }
.form label.check input { margin-top: 5px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 700px) { .row2, .row3 { grid-template-columns: 1fr; } }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 0; display: grid; gap: 12px; }
legend { font: 600 15px var(--font-head); padding: 0 8px; }
.radio-row { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.form-actions { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* صفحات الدخول */
.auth-wrap { padding: 56px 0 80px; display: grid; place-items: center; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); padding: 36px; width: min(460px, 100%); box-shadow: var(--shadow); }
.auth-card h1 { font-size: 28px; }
.auth-card.center { text-align: center; }
.auth-wrap.wide .auth-card { width: 100%; }
.auth-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 48px; align-items: start; width: 100%; }
.auth-aside { padding-top: 24px; }
.auth-aside h1 { font-size: clamp(28px, 3.4vw, 40px); }
.auth-aside p { color: var(--ink-2); }
.mini-steps { list-style: none; padding: 0; margin: 28px 0 0; counter-reset: s; display: grid; gap: 18px; }
.mini-steps li { display: grid; grid-template-columns: 36px 1fr; column-gap: 12px; }
.mini-steps li::before { counter-increment: s; content: counter(s); grid-row: span 2; width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font: 700 14px var(--font-head); }
.mini-steps span { color: var(--ink-2); font-size: 14px; }
@media (max-width: 860px) { .auth-grid { grid-template-columns: 1fr; gap: 24px; } .auth-card { padding: 24px; } }
.big-icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 18px; }
.big-icon.ok { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }

/* شريط التقدم */
.progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 6px 0; }
.progress i { display: block; height: 100%; background: var(--accent); }
.progress.sm { width: 120px; display: inline-block; vertical-align: middle; margin-inline-end: 8px; }

/* التبويبات كروابط */
.tabs a { display: inline-block; padding: 16px 14px; font: 600 15px var(--font-head); color: var(--ink-2); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--ink); border-color: var(--brand); }

/* المشغّل */
.watermark {
  position: absolute; z-index: 2; pointer-events: none; color: rgb(255 255 255 / .28); font: 600 14px var(--font-body);
  direction: ltr; text-shadow: 0 1px 2px rgb(0 0 0 / .4); transition: top 1.5s, left 1.5s; user-select: none;
}
.mod-group summary {
  list-style: none; cursor: pointer; background: var(--surface-2); border-bottom: 1px solid var(--line);
  padding: 14px 20px; font: 600 14px var(--font-head); display: flex; justify-content: space-between; gap: 10px;
}
.mod-group summary::-webkit-details-marker { display: none; }
.mod-group summary small { color: var(--ink-2); font-weight: 400; white-space: nowrap; }
a.lesson-btn { text-decoration: none; }
.lesson-desc { margin-top: 18px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.player video { background: #000; }

/* محتوى مقفل */
.locked-box { display: flex; gap: 18px; padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px dashed var(--brand); margin-bottom: 36px; }
.locked-box .ic { flex: none; width: 52px; height: 52px; border-radius: 14px; background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); display: grid; place-items: center; }
.locked-box h3 { margin-bottom: 4px; }
.locked-box p { color: var(--ink-2); margin: 0 0 16px; }
.locked-box .btn-line { color: var(--ink); }
.outline-public details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.outline-public summary { cursor: pointer; font: 600 16px var(--font-head); display: flex; justify-content: space-between; gap: 12px; }
.outline-public summary small { color: var(--ink-2); font-weight: 400; }
.outline-public ol { color: var(--ink-2); margin: 10px 0 0; padding-inline-start: 20px; }
.outline-public li { padding: 3px 0; }
.outline-public li svg { vertical-align: -2px; opacity: .6; }

/* الجداول */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: start; font: 600 13px var(--font-head); color: var(--ink-2); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table a { text-decoration: none; }
.table .actions { white-space: nowrap; text-align: end; }
code { font-size: 13px; background: var(--surface-2); padding: 2px 6px; border-radius: 5px; }

/* لوحة التحكم */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; gap: 32px; padding: 32px 0 64px; align-items: start; }
.admin-side { position: sticky; top: 92px; }
.admin-side nav { display: grid; gap: 2px; margin: 8px 0 16px; }
.admin-side nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font: 600 15px var(--font-head); }
.admin-side nav a:hover { background: var(--surface); color: var(--ink); }
.admin-side nav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: inset -3px 0 0 var(--brand); }
.admin-side .pill { margin-inline-start: auto; }
.admin-title { font-size: 28px; margin-bottom: 20px; }
.admin-main { min-width: 0; }
@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; gap: 16px; }
  .admin-side { position: static; }
  .admin-side nav { display: flex; overflow-x: auto; }
  .admin-side nav a { white-space: nowrap; }
  .admin-side p { display: none; }
}
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; text-decoration: none; display: block; }
.kpi b { display: block; font: 700 30px var(--font-head); }
.kpi span { color: var(--ink-2); font-size: 14px; }
.kpi.gold { border-color: var(--gold); }
a.kpi:hover { border-color: var(--ink-2); }
@media (max-width: 760px) { .kpis { grid-template-columns: 1fr 1fr; } }
.box-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.box-head h3 { margin: 0; }
.box-head a { font-size: 14px; color: var(--brand); text-decoration: none; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; margin-bottom: 16px; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.seg a { padding: 7px 12px; border-radius: 9px; text-decoration: none; font: 600 14px var(--font-head); color: var(--ink-2); }
.seg a small { font-weight: 400; opacity: .8; }
.seg a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.search input { min-width: 260px; }
.bulkbar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.dl { display: grid; grid-template-columns: 120px 1fr; gap: 10px 16px; margin: 0; font-size: 15px; }
.dl dt { color: var(--ink-2); }
.dl dd { margin: 0; }
.role-help { padding-inline-start: 18px; margin: 14px 0 0; }
.module-edit { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 14px; background: var(--bg); }
.module-row { display: flex; gap: 8px; align-items: center; }
.module-row form.grow { flex: 1; }
.sort-in { width: 70px !important; }
.lesson-list { margin: 12px 0; padding-inline-start: 24px; display: grid; gap: 6px; }
.lesson-list li { padding: 6px 0; }
.lesson-list li > * { vertical-align: middle; }
.lesson-list li { display: list-item; }
.lesson-list li span { margin-inline-end: 8px; }
.add-row { display: flex; width: 100%; gap: 8px; margin-top: 6px; }
.danger-zone { border-color: color-mix(in srgb, var(--brand) 40%, transparent); }
.resource .grow { flex: 1; }

/* الشهادة */
.certificate {
  max-width: 900px; margin: 0 auto; background: #fffdf8; color: #111a26; text-align: center;
  padding: 56px 48px; border: 2px solid #111a26; outline: 1px solid #111a26; outline-offset: -12px; position: relative;
}
.certificate .kicker { font-size: 15px; letter-spacing: 2px; }
.cert-top { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 28px; font-family: var(--font-head); text-align: start; }
.cert-top small { display: block; color: #4a5462; font-size: 12px; }
.cert-name { font-size: clamp(30px, 5vw, 48px); color: #d9442b; margin: 8px 0 12px; }
.certificate h2 { font-size: clamp(20px, 3vw, 28px); }
.cert-foot { display: flex; justify-content: space-around; gap: 24px; margin-top: 40px; padding-top: 24px; border-top: 1px dashed #d8d1c2; }
.cert-foot small { display: block; color: #4a5462; }
.cert-verify { font-size: 12px; color: #4a5462; margin: 24px 0 0; }
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body * { visibility: hidden; }
  .certificate, .certificate * { visibility: visible; }
  .certificate { position: fixed; inset: 0; max-width: none; margin: 0; }
}
