/* ================== برمجاوي — نظام التصميم (الاتجاه ج) ================== */
/* لغة التصميم: أسطح هادية فاتحة، بنفسجي أساسي وبرتقالي دافئ كلمسات،
   كروت كبيرة الزوايا، أيقونات ودّية — إحساس تطبيق استهلاكي مش موقع مدرسة */

@font-face {
  font-family: 'Cairo';
  src: url('fonts/cairo-arabic.woff2') format('woff2');
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+0660-0669;
}
@font-face {
  font-family: 'Cairo';
  src: url('fonts/cairo-latin.woff2') format('woff2');
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F;
}

:root {
  --violet: #6c5ce7;
  --violet-deep: #5848c9;
  --violet-2: #a55eea;
  --grad: linear-gradient(135deg, #6c5ce7, #8e6bf0);
  --accent: #ff9f2e;
  --accent-deep: #f08c0a;
  --grad-accent: linear-gradient(135deg, #ffb347, #ff9f2e);
  --green: #12b76a;
  --green-soft: #e4f8ee;
  --coral: #f04438;
  --coral-soft: #feeceb;
  --wa: #25d366;

  --bg: #f5f5fa;
  --raised: #ffffff;
  --sunken: #efeff7;
  --field: #f4f4fa;
  --line: #e4e4f0;
  --line-soft: #ececf4;
  --ink: #26234a;
  --ink-soft: #55517a;
  --muted: #8a87ab;

  --violet-soft: #efedfd;
  --accent-soft: #fff3e2;

  --header-bg: rgba(245, 245, 250, .88);
  --shadow: 0 1px 2px rgba(38, 35, 74, .04), 0 12px 32px -16px rgba(38, 35, 74, .12);
  --shadow-lift: 0 2px 6px rgba(38, 35, 74, .05), 0 22px 44px -18px rgba(108, 92, 231, .28);
  --shadow-accent: 0 10px 24px -10px rgba(255, 159, 46, .5);
  --shadow-primary: 0 10px 24px -10px rgba(108, 92, 231, .5);
  --radius-lg: 30px;
  --radius: 24px;
  --radius-sm: 16px;
}

[data-theme="dark"] {
  --bg: #15132b;
  --raised: #211e42;
  --sunken: #1a1736;
  --field: #262249;
  --line: #35315e;
  --line-soft: #2d2952;
  --ink: #f4f2ff;
  --ink-soft: #c3bfe6;
  --muted: #918cc0;
  --violet: #8f7bff;
  --violet-soft: #2c2760;
  --accent-soft: #3a2c14;
  --green-soft: #12382a;
  --coral-soft: #402020;
  --header-bg: rgba(21, 19, 43, .88);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -16px rgba(0, 0, 0, .55);
  --shadow-lift: 0 2px 6px rgba(0, 0, 0, .35), 0 22px 44px -18px rgba(108, 92, 231, .45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Cairo', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}
img, video, svg { max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3, h4 { line-height: 1.4; }
.ltr { direction: ltr; unicode-bidi: embed; }

.container { width: min(1120px, 100% - 40px); margin-inline: auto; }
.container-narrow { width: min(760px, 100% - 40px); }

.display { font-weight: 900; letter-spacing: -.5px; }
.hl { color: var(--accent); }

/* ---------- الهيدر ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.2rem; color: var(--ink); }
.brand-mark {
  width: 38px; height: 38px; border-radius: 13px;
  background: var(--grad); color: #fff;
  display: grid; place-items: center;
  font-size: .8rem; font-weight: 900;
  box-shadow: var(--shadow-primary);
}
.main-nav { display: flex; align-items: center; gap: 6px; }
.nav-link {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 15px; border-radius: 999px;
  color: var(--ink-soft); font-weight: 700; font-size: .92rem;
  transition: background .15s ease, color .15s ease;
}
.nav-link svg { width: 17px; height: 17px; }
.nav-link:hover { background: var(--violet-soft); color: var(--violet); }
.nav-link.active { background: var(--grad); color: #fff; box-shadow: var(--shadow-primary); }
.header-actions { display: flex; align-items: center; gap: 8px; }

.theme-toggle {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1.5px solid var(--line); background: var(--raised);
  color: var(--ink-soft); font-size: 1.05rem; cursor: pointer;
  display: grid; place-items: center;
  transition: border-color .15s ease, color .15s ease;
}
.theme-toggle:hover { border-color: var(--violet); color: var(--violet); }

.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--violet-soft); color: var(--violet);
  height: 42px; padding: 0 16px; border-radius: 999px;
  font-weight: 800; font-size: .88rem;
  transition: background .15s ease;
}
.user-chip:hover { background: var(--grad); color: #fff; }
.user-chip svg { width: 16px; height: 16px; }

/* ---------- شريط التبويبات السفلي (موبايل) ---------- */
.tabbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 70;
  display: none;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line-soft);
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 0px));
}
.tab-link {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 4px; border-radius: 14px;
  color: var(--muted); font-weight: 800; font-size: .68rem;
  transition: color .15s ease, background .15s ease;
}
.tab-link svg { width: 21px; height: 21px; }
.tab-link.active { color: var(--violet); background: var(--violet-soft); }
body.has-tabbar .site-footer { padding-bottom: 74px; }

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 26px;
  border-radius: 999px;
  font-weight: 800; font-size: .97rem;
  border: 1.5px solid transparent; cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: var(--shadow-primary); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.btn-accent { background: var(--grad-accent); color: #4a2d05; box-shadow: var(--shadow-accent); }
.btn-accent:hover { transform: translateY(-2px); }
.btn-secondary { background: var(--violet-soft); color: var(--violet); }
.btn-secondary:hover { background: var(--violet); color: #fff; }
.btn-outline { border-color: var(--line); color: var(--ink); background: var(--raised); }
.btn-outline:hover { border-color: var(--violet); color: var(--violet); }
.btn-outline-light { border-color: rgba(255,255,255,.45); color: #fff; background: rgba(255,255,255,.1); }
.btn-outline-light:hover { background: rgba(255,255,255,.22); }
.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn-ghost:hover { color: var(--ink); }
.btn-wa { background: var(--wa); color: #fff; box-shadow: 0 10px 24px -10px rgba(37, 211, 102, .55); }
.btn-wa:hover { transform: translateY(-2px); }
.btn-wa svg { width: 20px; height: 20px; }
.btn-block { width: 100%; }
.btn-sm { height: 42px; padding: 0 18px; font-size: .87rem; }

/* ---------- الهيرو ---------- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(120deg, #6c5ce7, #8e6bf0 55%, #a55eea);
  border-radius: var(--radius-lg);
  padding: 58px 46px;
  margin-top: 26px;
  color: #fff;
  box-shadow: var(--shadow-lift);
}
.hero::before {
  content: ""; position: absolute;
  width: 340px; height: 340px; border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  inset-inline-end: -90px; top: -120px;
}
.hero::after {
  content: ""; position: absolute;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255, 179, 71, .28);
  inset-inline-end: 130px; bottom: -110px;
}
.hero-emoji {
  position: absolute; inset-inline-end: 56px; top: 40%;
  font-size: 5.2rem;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, .25));
  animation: floaty 4.5s ease-in-out infinite;
}
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
.hero-inner { position: relative; max-width: 600px; z-index: 1; }
.hero-eyebrow { color: rgba(255, 255, 255, .82); font-weight: 700; font-size: .95rem; margin-bottom: 12px; }
.hero-title { font-size: 2.7rem; font-weight: 900; letter-spacing: -1px; line-height: 1.35; margin-bottom: 14px; }
.hero-sub { color: rgba(255, 255, 255, .85); font-size: 1.03rem; margin-bottom: 26px; max-width: 470px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------- كارت «كمّل من حيث وقفت» ---------- */
.continue-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--raised); border: 1.5px solid var(--line-soft);
  border-radius: var(--radius); padding: 18px 22px;
  margin-top: 22px;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.continue-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--violet); }
.cc-emoji { font-size: 2.1rem; flex-shrink: 0; }
.cc-text { flex: 1; min-width: 0; }
.cc-text b { display: block; font-weight: 900; font-size: 1.05rem; color: var(--ink); }
.cc-text span { color: var(--muted); font-size: .87rem; font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- شريط المزايا ---------- */
.features {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  margin-block: 22px 6px;
}
.feature {
  display: flex; align-items: center; gap: 14px;
  background: var(--raised); border: 1.5px solid var(--line-soft);
  border-radius: var(--radius); padding: 20px 22px;
  box-shadow: var(--shadow);
}
.feature-icon {
  width: 54px; height: 54px; border-radius: 18px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 1.6rem;
}
.feature-icon.fi-a { background: var(--violet-soft); }
.feature-icon.fi-b { background: var(--green-soft); }
.feature-icon.fi-c { background: var(--accent-soft); }
.feature b { display: block; font-weight: 900; font-size: 1.02rem; color: var(--ink); }
.feature span { color: var(--muted); font-size: .85rem; font-weight: 600; }

/* ---------- عناوين الأقسام ---------- */
.section-head { margin: 42px 0 20px; }
.section-head h2 { font-size: 1.65rem; font-weight: 900; color: var(--ink); letter-spacing: -.5px; }
.section-head p { color: var(--muted); font-size: .94rem; font-weight: 600; margin-top: 4px; }

/* ---------- بانر التقدم في الرئيسية ---------- */
.progress-banner {
  display: flex; align-items: center; gap: 18px;
  background: var(--raised); border: 1.5px solid var(--line-soft);
  border-radius: var(--radius); padding: 18px 22px;
  margin-top: 16px;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.progress-banner:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--violet); }
.pb-text { flex: 1; min-width: 0; }
.pb-text b { display: block; font-weight: 900; font-size: 1.08rem; color: var(--ink); }
.pb-text span { color: var(--muted); font-size: .86rem; font-weight: 600; }
.pb-go { width: 34px; height: 34px; border-radius: 50%; background: var(--violet-soft); color: var(--violet); display: grid; place-items: center; flex-shrink: 0; }
.pb-go svg { width: 15px; height: 15px; }

/* ---------- حلقة النسبة ---------- */
.ring { position: relative; display: inline-grid; place-items: center; flex-shrink: 0; }
.ring svg { transform: rotate(-90deg); }
.ring circle { fill: none; stroke-linecap: round; }
.ring-bg { stroke: var(--line); }
.ring-fill { stroke: var(--violet); transition: stroke-dashoffset 1s ease; }
.ring-text { position: absolute; font-weight: 900; font-size: 1.25rem; color: var(--ink); }

/* ---------- صناديق الفصول ---------- */
.chapter-box {
  background: var(--raised); border: 1.5px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 26px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.chapter-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 18px; padding-bottom: 14px;
  border-bottom: 1.5px dashed var(--line);
}
.chapter-head h3 { font-size: 1.2rem; font-weight: 900; color: var(--ink); display: flex; align-items: center; gap: 12px; }
.chapter-head h3 > svg { width: 20px; height: 20px; color: var(--violet); }
.chapter-num {
  min-width: 38px; height: 38px; padding: 0 10px; border-radius: 13px;
  background: var(--grad); color: #fff;
  display: inline-grid; place-items: center;
  font-size: .95rem; font-weight: 900;
  box-shadow: var(--shadow-primary);
}
.chapter-count { color: var(--violet); background: var(--violet-soft); font-size: .8rem; font-weight: 800; padding: 5px 14px; border-radius: 999px; white-space: nowrap; }

/* ---------- كروت الدروس ---------- */
.lessons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.lesson-card {
  display: flex; flex-direction: column;
  background: var(--field); border: 1.5px solid var(--line-soft);
  border-radius: var(--radius); padding: 18px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.lesson-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: var(--violet); background: var(--raised); }
.lesson-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.lesson-card-tags { display: inline-flex; gap: 6px; }
.lesson-num {
  min-width: 42px; height: 42px; padding: 0 10px; border-radius: 14px;
  background: var(--violet-soft); color: var(--violet);
  display: inline-grid; place-items: center;
  font-weight: 900; font-size: .92rem;
}
.tag-video, .tag-done {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .72rem; font-weight: 900;
  padding: 4px 11px; border-radius: 999px;
}
.tag-video { background: var(--accent-soft); color: var(--accent-deep); }
.tag-done { background: var(--green-soft); color: var(--green); }
.tag-video svg, .tag-done svg { width: 11px; height: 11px; }
.lesson-card h4 { font-size: 1.02rem; font-weight: 800; color: var(--ink); margin-bottom: 8px; line-height: 1.55; }
.lesson-card .brief {
  color: var(--muted); font-size: .85rem; line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 14px; min-height: 2.9em;
}
.lesson-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.meta-pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--raised); color: var(--ink-soft);
  border: 1px solid var(--line-soft);
  font-size: .73rem; font-weight: 800;
  padding: 4px 11px; border-radius: 999px;
}
.meta-pill svg { width: 12px; height: 12px; }
.meta-pill.score { background: var(--accent-soft); border-color: transparent; color: var(--accent-deep); }
.lesson-card .btn { margin-top: auto; }

/* ---------- تسجيل الدخول / إنشاء الحساب ---------- */
.auth-split {
  display: grid; grid-template-columns: 1fr 1.15fr;
  min-height: calc(100vh - 62px);
}
.auth-panel {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, #5848c9, #6c5ce7 45%, #a55eea);
  color: #fff;
  padding: 40px 48px;
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 480px;
}
.auth-panel .brand { color: #fff; }
.auth-panel .brand-mark { background: rgba(255, 255, 255, .16); box-shadow: none; }
.auth-panel-mid { position: relative; }
.auth-panel-mid .tag { color: rgba(255, 255, 255, .72); font-weight: 700; font-size: .92rem; display: block; margin-bottom: 14px; }
.auth-panel-mid h2 { font-size: 3rem; font-weight: 900; letter-spacing: -1px; line-height: 1.3; }
.auth-panel-mid h2 .hl { display: block; color: #ffc069; }
.auth-panel-watermark {
  position: absolute; inset-inline-end: -20px; bottom: -40px;
  font-size: 12rem; font-weight: 900; line-height: 1;
  color: rgba(255, 255, 255, .05);
  pointer-events: none; user-select: none; white-space: nowrap;
}
.auth-panel-points { position: relative; display: grid; gap: 12px; }
.auth-panel-points .pt { display: flex; align-items: center; gap: 10px; color: rgba(255, 255, 255, .88); font-weight: 700; font-size: .95rem; }
.auth-panel-points .pt svg { width: 18px; height: 18px; color: #ffc069; flex-shrink: 0; }

.auth-form-side {
  display: flex; flex-direction: column;
  padding: 30px clamp(22px, 5vw, 80px);
}
.auth-back {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-weight: 700; font-size: .88rem;
  margin-bottom: 26px;
}
.auth-back:hover { color: var(--violet); }
.auth-back svg { width: 15px; height: 15px; }
.auth-form-box { max-width: 470px; width: 100%; margin-inline: auto; }
.auth-eyebrow { color: var(--violet); font-weight: 800; font-size: .88rem; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.auth-eyebrow::before { content: ""; width: 26px; height: 3px; border-radius: 3px; background: var(--grad); }
.auth-form-box h1 { font-size: 1.85rem; font-weight: 900; letter-spacing: -.5px; margin-bottom: 20px; }

.steps-bar { margin-bottom: 24px; }
.steps-bar .steps-label { display: block; color: var(--muted); font-size: .8rem; font-weight: 700; margin-bottom: 8px; }
.steps-segs { display: flex; gap: 6px; }
.steps-segs i { flex: 1; height: 5px; border-radius: 5px; background: var(--line); }
.steps-segs i.done { background: var(--grad); }

.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 800; font-size: .88rem; margin-bottom: 7px; color: var(--ink); }
.input, select.input {
  width: 100%; height: 52px;
  background: var(--raised); border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 16px;
  font-family: inherit; font-size: .95rem; font-weight: 600; color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
  appearance: none; -webkit-appearance: none;
}
select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a87ab' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 16px center;
  padding-inline-end: 16px;
}
.input:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px rgba(108, 92, 231, .16); }
.input::placeholder { color: var(--muted); font-weight: 500; }
.input.code-input {
  direction: ltr; text-align: center;
  font-size: 1.3rem; font-weight: 900; letter-spacing: 5px;
}
.field-hint { color: var(--muted); font-size: .8rem; font-weight: 600; margin-top: 6px; }
.auth-error { color: var(--coral); font-size: .85rem; font-weight: 700; min-height: 1.4em; margin: 4px 0 10px; }
.auth-switch { text-align: center; color: var(--muted); font-size: .9rem; font-weight: 600; margin-top: 20px; }
.auth-switch a, .auth-switch button.linklike {
  color: var(--violet); font-weight: 800; cursor: pointer;
  background: none; border: none; font-size: inherit; font-family: inherit;
  border-bottom: 2px solid var(--accent);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.otp-box {
  background: var(--violet-soft);
  border: 1.5px dashed var(--violet);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
  display: grid; gap: 12px;
}
.otp-note { color: var(--ink-soft); font-size: .88rem; font-weight: 600; line-height: 1.9; }

/* ---------- مودال الكود ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(21, 19, 43, .55);
  backdrop-filter: blur(5px);
  display: grid; place-items: center;
  padding: 20px;
}
.modal-card {
  background: var(--raised); border-radius: 28px;
  padding: 38px 32px 28px;
  max-width: 440px; width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lift);
}
.modal-check {
  width: 78px; height: 78px; border-radius: 50%;
  background: var(--green-soft); color: var(--green);
  display: grid; place-items: center;
  margin: 0 auto 18px;
}
.modal-check svg { width: 38px; height: 38px; }
.modal-card h2 { font-size: 1.45rem; font-weight: 900; margin-bottom: 8px; }
.modal-card .modal-sub { color: var(--ink-soft); font-size: .95rem; font-weight: 600; margin-bottom: 16px; }
.code-display {
  direction: ltr;
  background: var(--grad); color: #fff;
  border-radius: var(--radius-sm);
  font-size: 1.55rem; font-weight: 900; letter-spacing: 3px;
  padding: 18px 12px;
  margin-bottom: 12px;
  user-select: all;
  box-shadow: var(--shadow-primary);
}
.code-copy-btn {
  background: none; border: none; cursor: pointer;
  color: var(--violet); font-weight: 800; font-size: .85rem;
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 16px; font-family: inherit;
}
.code-copy-btn svg { width: 14px; height: 14px; }
.code-warning {
  background: var(--accent-soft);
  color: #8a5a10;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: .83rem; font-weight: 700; line-height: 1.85;
  margin-bottom: 20px;
  text-align: right;
}
[data-theme="dark"] .code-warning { color: #ffc069; }

/* ---------- صفحة الدرس ---------- */
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: .85rem; font-weight: 700;
  margin: 22px 0 14px;
}
.breadcrumb a:hover { color: var(--violet); }
.breadcrumb svg { width: 13px; height: 13px; }

.lesson-hero {
  position: relative; overflow: hidden;
  background: linear-gradient(120deg, #6c5ce7, #8e6bf0 60%, #a55eea);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 40px 40px;
  box-shadow: var(--shadow-lift);
}
.lesson-hero::before {
  content: ""; position: absolute;
  width: 260px; height: 260px; border-radius: 50%;
  background: rgba(255, 255, 255, .09);
  inset-inline-end: -70px; top: -90px;
}
.lesson-hero .hero-eyebrow { margin-bottom: 10px; position: relative; }
.lesson-hero h1 { position: relative; font-size: 2rem; font-weight: 900; letter-spacing: -.5px; margin-bottom: 12px; max-width: 660px; }
.lesson-hero .hero-sub { position: relative; margin-bottom: 20px; max-width: 580px; font-size: .97rem; color: rgba(255, 255, 255, .88); }
.lesson-meta-hero { position: relative; display: flex; flex-wrap: wrap; gap: 8px; }
.hero-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, .16); color: #fff;
  font-size: .78rem; font-weight: 800;
  padding: 6px 14px; border-radius: 999px;
}
.hero-pill svg { width: 13px; height: 13px; }
.hero-pill.accent { background: var(--grad-accent); color: #4a2d05; }

.lesson-intro {
  display: grid; grid-template-columns: 1fr 1.4fr; gap: 18px;
  margin-top: 24px;
}
.objectives-card, .video-card {
  background: var(--raised); border: 1.5px solid var(--line-soft);
  border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow);
}
.objectives-card h3, .video-card h3 { font-size: 1.12rem; font-weight: 900; margin-bottom: 14px; }
.objectives-list { list-style: none; display: grid; gap: 12px; }
.objectives-list li { display: flex; gap: 10px; align-items: flex-start; font-size: .93rem; font-weight: 600; color: var(--ink-soft); }
.objectives-list li svg { width: 19px; height: 19px; color: var(--green); flex-shrink: 0; margin-top: 3px; }
.video-frame { border-radius: var(--radius-sm); overflow: hidden; background: #000; }
.video-frame video { display: block; width: 100%; aspect-ratio: 16/9; }
.video-note { color: var(--muted); font-size: .8rem; font-weight: 600; margin-top: 10px; }

.lesson-body { margin-top: 24px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.lesson-body > * { min-width: 0; }
.content-card {
  background: var(--raised); border: 1.5px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
.content-card > h2 {
  font-size: 1.25rem; font-weight: 900; letter-spacing: -.3px;
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
}
.h2-num {
  min-width: 38px; height: 38px; padding: 0 9px; border-radius: 13px;
  background: var(--violet-soft); color: var(--violet);
  display: inline-grid; place-items: center;
  font-size: .95rem; font-weight: 900; flex-shrink: 0;
}
.def-note { color: var(--muted); font-size: .88rem; font-weight: 600; margin-bottom: 4px; }
.content-card h3 { font-size: 1.05rem; font-weight: 800; margin: 18px 0 10px; }
.content-card p { color: var(--ink-soft); margin-bottom: 12px; font-size: .96rem; }
.content-card p.lead { font-size: 1.05rem; color: var(--ink); font-weight: 700; }
.content-card ul, .content-card ol { padding-inline-start: 22px; color: var(--ink-soft); margin-bottom: 12px; font-size: .95rem; }
.content-card li { margin-bottom: 7px; }
.content-card li::marker { color: var(--accent); font-weight: 900; }
.content-card b, .content-card strong { color: var(--ink); }

/* الرسومات التوضيحية داخل كروت الشرح */
.fig {
  margin: 18px 0 6px;
  background: var(--field);
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 18px 16px 12px;
  text-align: center;
}
.fig svg { max-width: 100%; height: auto; }
.fig .fig-box { fill: var(--raised); stroke: var(--violet); stroke-width: 2; }
.fig .fig-box-accent { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2; }
.fig .fig-box-green { fill: var(--green-soft); stroke: var(--green); stroke-width: 2; }
.fig .fig-line { stroke: var(--muted); stroke-width: 2; fill: none; }
.fig .fig-arrow { stroke: var(--violet); stroke-width: 2.4; fill: none; marker-end: url(#figArrow); }
.fig .fig-label { fill: var(--ink); font-family: inherit; font-weight: 800; font-size: 13px; }
.fig .fig-label-soft { fill: var(--muted); font-family: inherit; font-weight: 700; font-size: 11.5px; }
.fig .fig-label-accent { fill: var(--accent-deep); font-family: inherit; font-weight: 900; font-size: 13px; }
.fig .fig-label-violet { fill: var(--violet); font-family: inherit; font-weight: 900; font-size: 13px; }
.fig .fig-fill-violet { fill: var(--violet); }
.fig .fig-fill-accent { fill: var(--accent); }
.fig .fig-fill-soft { fill: var(--violet-soft); }
.fig figcaption { color: var(--muted); font-size: .82rem; font-weight: 700; margin-top: 10px; }

/* جداول */
.table-wrap { overflow-x: auto; margin: 16px 0; border-radius: var(--radius-sm); border: 1.5px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 540px; }
thead th {
  background: var(--violet-soft); color: var(--violet);
  font-weight: 900; padding: 12px 16px; text-align: right;
  white-space: nowrap; font-size: .88rem;
}
tbody td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); color: var(--ink-soft); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) td { background: var(--field); }
td b, td strong { color: var(--ink); }
@media (max-width: 720px) {
  table { min-width: 0; font-size: .8rem; }
  thead th { padding: 10px; font-size: .78rem; white-space: normal; }
  tbody td { padding: 10px; }
}

/* مصطلحات */
.terms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-top: 14px; }
.term-card {
  background: var(--field); border: 1.5px solid var(--line-soft);
  border-radius: var(--radius-sm); padding: 14px 16px;
  transition: border-color .15s ease, background .15s ease;
}
.term-card:hover { border-color: var(--violet); background: var(--raised); }
.term-card b { display: block; font-weight: 900; color: var(--violet); margin-bottom: 4px; font-size: .93rem; }
.term-card span { color: var(--ink-soft); font-size: .83rem; font-weight: 600; line-height: 1.75; }

/* نقاط قوة وقيود */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 14px 0; }
.duo-box { border-radius: var(--radius-sm); padding: 18px; border: 1.5px solid; }
.duo-box h4 { font-size: 1rem; font-weight: 900; margin-bottom: 10px; }
.duo-box ul { padding-inline-start: 18px; font-size: .88rem; }
.duo-box li { margin-bottom: 6px; }
.duo-box.pros { background: var(--green-soft); border-color: transparent; }
.duo-box.pros h4 { color: var(--green); }
.duo-box.cons { background: var(--coral-soft); border-color: transparent; }
.duo-box.cons h4 { color: var(--coral); }

/* ملاحظات */
.callout {
  display: flex; gap: 14px; align-items: flex-start;
  border-radius: var(--radius-sm); padding: 18px 20px;
  margin: 16px 0;
}
.callout-icon { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; font-size: 1.15rem; }
.callout h4 { font-size: .98rem; font-weight: 900; margin-bottom: 4px; }
.callout p { font-size: .88rem; margin: 0; }
.callout.note { background: var(--accent-soft); }
.callout.note .callout-icon { background: var(--grad-accent); color: #4a2d05; }
.callout.note h4 { color: var(--accent-deep); }
.callout.note p { color: var(--ink-soft); }
.callout.key { background: var(--grad); color: #fff; box-shadow: var(--shadow-primary); }
.callout.key .callout-icon { background: rgba(255, 255, 255, .18); color: #ffc069; }
.callout.key h4 { color: #ffc069; }
.callout.key p { color: rgba(255, 255, 255, .92); }

/* خطوات */
.steps { display: grid; gap: 12px; margin: 14px 0; counter-reset: step; }
.step-item { display: flex; gap: 14px; align-items: flex-start; }
.step-n {
  min-width: 34px; height: 34px; border-radius: 50%;
  background: var(--grad); color: #fff;
  display: inline-grid; place-items: center;
  font-weight: 900; font-size: .9rem; flex-shrink: 0;
  counter-increment: step;
}
.step-n::before { content: counter(step); }
.step-item b { display: block; font-weight: 800; color: var(--ink); }
.step-item p { margin: 0; font-size: .9rem; }

/* PDCA */
.pdca { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0; }
.pdca-step {
  color: #fff;
  border-radius: var(--radius-sm); padding: 16px 14px; text-align: center;
}
.pdca-step.pdca-1 { background: linear-gradient(135deg, #6c5ce7, #8e6bf0); }
.pdca-step.pdca-2 { background: linear-gradient(135deg, #a55eea, #c07cf5); }
.pdca-step.pdca-3 { background: linear-gradient(135deg, #ffb347, #ff9f2e); }
.pdca-step.pdca-4 { background: linear-gradient(135deg, #2fce85, #12b76a); }
.pdca-step b { display: block; font-size: 1.05rem; font-weight: 900; margin-bottom: 4px; }
.pdca-step span { font-size: .8rem; color: rgba(255, 255, 255, .9); font-weight: 600; }
.pdca-caption { text-align: center; color: var(--muted); font-size: .85rem; font-weight: 700; }

/* كود */
.code-block {
  direction: ltr; text-align: left;
  background: #211e42; color: #e9e6ff;
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  font-family: 'Cairo', monospace; font-size: .88rem;
  overflow-x: auto; white-space: pre;
  margin: 14px 0;
}

/* ---------- الاختبار ---------- */
.quiz-section { margin-top: 28px; }
.quiz-head-card {
  background: linear-gradient(120deg, #6c5ce7, #a55eea);
  color: #fff;
  border-radius: var(--radius); padding: 24px 26px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-primary);
}
.quiz-head-card h2 { font-size: 1.35rem; font-weight: 900; }
.quiz-head-card p { color: rgba(255, 255, 255, .82); font-size: .88rem; font-weight: 600; }
.quiz-progress-pill {
  background: rgba(255, 255, 255, .18); color: #fff;
  font-weight: 900; font-size: .92rem;
  padding: 8px 20px; border-radius: 999px;
}
.quiz-list { display: grid; gap: 14px; margin-top: 18px; }
.quiz-q {
  background: var(--raised); border: 1.5px solid var(--line-soft);
  border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow);
}
.q-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.q-num {
  min-width: 32px; height: 32px; padding: 0 8px; border-radius: 11px;
  background: var(--violet-soft); color: var(--violet);
  display: inline-grid; place-items: center;
  font-weight: 900; font-size: .85rem;
}
.q-type { color: var(--muted); font-size: .76rem; font-weight: 800; }
.q-text { font-weight: 800; font-size: 1rem; margin-bottom: 14px; line-height: 1.85; }
.q-options { display: grid; gap: 8px; }
.q-opt {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: right;
  background: var(--field); border: 1.5px solid var(--line);
  border-radius: 16px; padding: 12px 16px;
  font-family: inherit; font-size: .92rem; font-weight: 700; color: var(--ink);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.q-opt:hover:not(:disabled) { border-color: var(--violet); transform: translateY(-1px); }
.q-opt:disabled { cursor: default; opacity: .85; }
.opt-letter {
  min-width: 30px; height: 30px; border-radius: 10px;
  background: var(--raised); border: 1.5px solid var(--line); color: var(--ink-soft);
  display: inline-grid; place-items: center;
  font-weight: 900; font-size: .82rem; flex-shrink: 0;
}
.q-opt.correct { border-color: var(--green); background: var(--green-soft); }
.q-opt.correct .opt-letter { background: var(--green); border-color: var(--green); color: #fff; }
.q-opt.wrong { border-color: var(--coral); background: var(--coral-soft); }
.q-opt.wrong .opt-letter { background: var(--coral); border-color: var(--coral); color: #fff; }
.q-explain { display: none; margin-top: 12px; }
.q-explain.show {
  display: block;
  background: var(--field); border-radius: 12px;
  padding: 12px 16px; font-size: .86rem; font-weight: 600; color: var(--ink-soft);
}
.q-explain.show b { color: var(--green); }
.q-explain.show b.bad { color: var(--coral); }

.quiz-result {
  display: none;
  margin-top: 20px;
  background: linear-gradient(120deg, #6c5ce7, #a55eea);
  color: #fff;
  border-radius: var(--radius); padding: 32px 26px;
  text-align: center;
  box-shadow: var(--shadow-primary);
}
.quiz-result.show { display: block; }
.score-big { font-size: 3rem; font-weight: 900; color: #ffc069; line-height: 1.15; }
.quiz-result h3 { font-size: 1.2rem; font-weight: 900; margin: 8px 0 6px; }
.quiz-result p { color: rgba(255, 255, 255, .85); font-size: .9rem; font-weight: 600; margin-bottom: 20px; }

/* زر إنهاء الدرس */
.complete-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 56px;
  border-radius: 999px;
  border: 1.5px dashed var(--violet);
  background: var(--violet-soft); color: var(--violet);
  font-family: inherit; font-weight: 900; font-size: 1rem;
  cursor: pointer;
  transition: all .18s ease;
}
.complete-btn svg { width: 20px; height: 20px; }
.complete-btn:hover { background: var(--violet); color: #fff; }
.complete-btn.is-done {
  border-style: solid; border-color: var(--green);
  background: var(--green-soft); color: var(--green);
}

/* ---------- تنقل الدروس ---------- */
.lesson-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 26px 0 10px; }
.lesson-nav a {
  display: flex; flex-direction: column; gap: 4px;
  border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 16px 20px; background: var(--raised);
  transition: border-color .15s ease, transform .15s ease;
}
.lesson-nav a:hover { border-color: var(--violet); transform: translateY(-2px); }
.lesson-nav a span { color: var(--muted); font-size: .78rem; font-weight: 800; }
.lesson-nav a b { font-weight: 800; font-size: .95rem; color: var(--ink); }
.lesson-nav a.next { text-align: left; align-items: flex-end; }
.lesson-nav a.prev { text-align: right; align-items: flex-start; }

/* ---------- تبويب التقدم ---------- */
.progress-hero {
  display: flex; align-items: center; gap: 26px; flex-wrap: wrap;
  background: var(--raised); border: 1.5px solid var(--line-soft);
  border-radius: var(--radius-lg); padding: 26px;
  box-shadow: var(--shadow);
}
.progress-hero .ring-text { font-size: 1.7rem; }
.ph-stats { flex: 1; min-width: 240px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.ph-stat {
  background: var(--field); border-radius: var(--radius-sm);
  padding: 14px 18px;
}
.ph-stat b { display: block; font-size: 1.3rem; font-weight: 900; color: var(--ink); line-height: 1.25; }
.ph-stat span { color: var(--muted); font-size: .8rem; font-weight: 700; }

.prog-list { display: grid; gap: 8px; }
.prog-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--field); border: 1.5px solid var(--line-soft);
  border-radius: var(--radius-sm); padding: 12px 16px;
  transition: border-color .15s ease, background .15s ease;
}
.prog-row:hover { border-color: var(--violet); background: var(--raised); }
.prog-lesson { display: flex; align-items: center; gap: 12px; min-width: 0; }
.prog-status {
  min-width: 34px; height: 34px; border-radius: 12px; flex-shrink: 0;
  background: var(--raised); border: 1.5px solid var(--line);
  color: var(--muted);
  display: inline-grid; place-items: center;
  font-weight: 900; font-size: .75rem; font-style: normal;
}
.prog-status i { font-style: normal; }
.prog-status svg { width: 16px; height: 16px; }
.prog-status.done { background: var(--green-soft); border-color: transparent; color: var(--green); }
.prog-title { font-weight: 800; font-size: .92rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prog-scores { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.badge-best {
  background: var(--accent-soft); color: var(--accent-deep);
  font-size: .74rem; font-weight: 900;
  padding: 4px 12px; border-radius: 999px; white-space: nowrap;
}
.prog-last { color: var(--muted); font-size: .74rem; font-weight: 700; white-space: nowrap; }
.prog-none { color: var(--muted); font-size: .76rem; font-weight: 700; white-space: nowrap; }

/* سجل الدرجات */
.history-list { display: grid; gap: 8px; }
.history-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--field); border-radius: var(--radius-sm);
  padding: 12px 16px;
}
.history-lesson { min-width: 0; }
.history-lesson b { display: block; font-weight: 900; font-size: .9rem; color: var(--ink); }
.history-lesson span { color: var(--muted); font-size: .78rem; font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-meta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.history-date { color: var(--muted); font-size: .76rem; font-weight: 700; white-space: nowrap; }
.history-score { color: var(--ink-soft); font-size: .82rem; font-weight: 800; white-space: nowrap; }
.history-pct {
  min-width: 52px; text-align: center;
  font-weight: 900; font-size: .82rem;
  padding: 4px 10px; border-radius: 999px;
}
.history-pct.good { background: var(--green-soft); color: var(--green); }
.history-pct.mid { background: var(--accent-soft); color: var(--accent-deep); }
.history-pct.low { background: var(--coral-soft); color: var(--coral); }
.history-empty { color: var(--muted); font-weight: 700; font-size: .92rem; text-align: center; padding: 18px 8px; }

/* ---------- تبويب الحساب ---------- */
.profile-card {
  text-align: center;
  background: var(--raised); border: 1.5px solid var(--line-soft);
  border-radius: var(--radius-lg); padding: 30px 24px;
  margin-top: 26px; margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.profile-avatar {
  width: 84px; height: 84px; border-radius: 28px;
  background: var(--grad); color: #fff;
  display: inline-grid; place-items: center;
  font-size: 2.1rem; font-weight: 900;
  box-shadow: var(--shadow-primary);
  margin-bottom: 12px;
}
.profile-card h2 { font-size: 1.4rem; font-weight: 900; }
.profile-card p { color: var(--muted); font-weight: 700; font-size: .9rem; }

.info-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 4px;
  border-bottom: 1.5px dashed var(--line-soft);
}
.info-row:last-child { border-bottom: 0; }
.info-icon {
  width: 42px; height: 42px; border-radius: 14px; flex-shrink: 0;
  background: var(--violet-soft); color: var(--violet);
  display: grid; place-items: center;
}
.info-icon svg { width: 19px; height: 19px; }
.info-main { flex: 1; min-width: 0; }
.info-label { display: block; color: var(--muted); font-size: .78rem; font-weight: 700; }
.info-value { font-weight: 800; font-size: .97rem; color: var(--ink); }

.done-list { display: grid; gap: 8px; }
.done-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--field); border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-weight: 700; font-size: .88rem; color: var(--ink-soft);
}
.done-row svg { width: 18px; height: 18px; color: var(--green); flex-shrink: 0; }
.done-row:hover { color: var(--violet); }

/* صف واتساب */
.wa-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--raised); border: 1.5px solid var(--line-soft);
  border-radius: var(--radius); padding: 16px 20px;
  margin-top: 22px;
  box-shadow: var(--shadow);
  transition: transform .18s ease, border-color .18s ease;
}
.wa-row:hover { transform: translateY(-2px); border-color: var(--wa); }
.wa-icon {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  background: var(--wa); color: #fff;
  display: grid; place-items: center;
}
.wa-icon svg { width: 24px; height: 24px; }
.wa-row .info-main b { font-weight: 900; color: var(--ink); }

/* ---------- الإعدادات ---------- */
.theme-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.theme-choice {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 20px 12px;
  background: var(--field); border: 2px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit; font-size: 1.7rem;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.theme-choice b { font-size: .95rem; font-weight: 900; color: var(--ink); }
.theme-choice.active { border-color: var(--violet); background: var(--violet-soft); }
.settings-note { color: var(--ink-soft); font-size: .9rem; font-weight: 600; line-height: 1.9; }

/* ---------- الفوتر ---------- */
.site-footer { margin-top: 54px; padding-bottom: 26px; }
.footer-card {
  background: linear-gradient(140deg, #2c2760, #5848c9 60%, #6c5ce7);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 38px 42px;
  display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 30px;
}
.footer-card .brand { color: #fff; margin-bottom: 12px; }
.footer-card .brand-mark { background: rgba(255, 255, 255, .16); box-shadow: none; }
.footer-card p { color: rgba(255, 255, 255, .68); font-size: .87rem; font-weight: 600; }
.footer-card h5 { font-size: .95rem; font-weight: 900; margin-bottom: 12px; color: #ffc069; }
.footer-links { display: grid; gap: 8px; }
.footer-links a { color: rgba(255, 255, 255, .78); font-size: .88rem; font-weight: 700; }
.footer-links a:hover { color: #fff; }
.footer-wa {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 14px;
  background: var(--wa); color: #fff;
  font-weight: 800; font-size: .86rem;
  padding: 9px 18px; border-radius: 999px;
}
.footer-wa svg { width: 17px; height: 17px; }
.footer-note { margin-top: 18px; text-align: center; color: var(--muted); font-size: .8rem; font-weight: 600; }

/* ---------- حالات خاصة ---------- */
.empty-state { text-align: center; padding: 70px 20px; }
.empty-state .empty-icon {
  width: 84px; height: 84px; margin: 0 auto 18px;
  border: 3px solid var(--line); border-radius: 24px;
  display: grid; place-items: center; color: var(--violet);
}
.empty-state .empty-icon svg { width: 38px; height: 38px; }
.empty-state h2 { font-size: 1.4rem; font-weight: 900; margin-bottom: 8px; }
.empty-state p { color: var(--muted); font-weight: 600; margin-bottom: 20px; }

/* ---------- الظهور ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  .hero-emoji { animation: none; }
}

/* ---------- موبايل ---------- */
.auth-mobile-brand { display: none; }
@media (max-width: 900px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-panel { display: none; }
  .auth-mobile-brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.25rem; color: var(--ink); margin-bottom: 22px; }
  .auth-mobile-brand .brand-mark { width: 34px; height: 34px; border-radius: 11px; font-size: .85rem; }
  .lesson-intro { grid-template-columns: 1fr; }
  .footer-card { grid-template-columns: 1fr; gap: 22px; padding: 30px 26px; }
}
@media (max-width: 720px) {
  body { font-size: 15.5px; }
  .container { width: min(1120px, 100% - 26px); }
  .container-narrow { width: min(760px, 100% - 26px); }
  .main-nav { display: none; }
  .tabbar { display: flex; }
  .hero { padding: 36px 24px 40px; border-radius: 24px; margin-top: 16px; }
  .hero-title { font-size: 1.85rem; }
  .hero-emoji { display: none; }
  .features { grid-template-columns: 1fr; gap: 10px; }
  .feature { padding: 16px 18px; }
  .chapter-box { padding: 18px 14px; border-radius: 24px; }
  .chapter-head { flex-wrap: wrap; }
  .lesson-hero { padding: 26px 20px; border-radius: 24px; }
  .lesson-hero h1 { font-size: 1.5rem; }
  .content-card { padding: 20px 16px; }
  .duo { grid-template-columns: 1fr; }
  .pdca { grid-template-columns: repeat(2, 1fr); }
  .lesson-nav { grid-template-columns: 1fr; }
  .quiz-head-card { padding: 20px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .code-display { font-size: 1.2rem; }
  .auth-form-side { padding: 22px 18px 40px; }
  .brand { font-size: 1.05rem; }
  .progress-hero { justify-content: center; text-align: center; }
  .ph-stats { grid-template-columns: repeat(2, 1fr); }
  .ph-stat { padding: 12px; }
  .history-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .history-meta { width: 100%; justify-content: space-between; }
  .prog-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .prog-scores { justify-content: flex-start; }
  .continue-card .btn { display: none; }
}

/* وضع صفحات الحساب */
.auth-mode .site-header,
.auth-mode .site-footer { display: none; }
.auth-mode.has-tabbar .tabbar { display: none; }
.callout-main h4 { margin-bottom: 4px; }
.callout-main p { margin: 0; }

/* ===== تحديث: فيديو الشرح الرأسي (9:16) يحل مكان النظرية ===== */
.video-card { padding: 18px; }
.video-frame {
  display: flex; justify-content: center; align-items: center;
  background: #0a0d14; border-radius: var(--radius-sm);
  padding: 8px;
}
.video-frame video {
  display: block; width: auto; max-width: 100%;
  aspect-ratio: 9 / 16; max-height: 78vh; border-radius: 10px;
  background: #000;
}
@media (max-width: 760px) {
  .video-frame { padding: 4px; }
  .video-frame video { max-height: 66vh; }
}
/* شارة "تفكير وتطبيق" في الاختبار */
.q-type.think {
  color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent);
  padding: 3px 9px; border-radius: 999px;
}

/* الدرس ذو الفيديو: الفيديو أولًا بعرض كامل، ثم الأهداف */
.lesson-intro.has-video { grid-template-columns: minmax(0, 1fr); }
.lesson-intro.has-video .video-card { padding: 16px 16px 10px; }
.lesson-intro.has-video .video-frame { background: #0a0d14; }
.lesson-intro.has-video .video-frame video { max-height: 74vh; }
.lesson-intro.has-video .objectives-card { padding: 18px 22px; }

/* كارت "الفيديو بيتجهّز" للدروس اللي فيديوها لسه ما نزلش */
.video-soon {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 40px 20px; border: 1.5px dashed var(--line-soft);
  border-radius: var(--radius-sm); text-align: center; background: var(--bg-soft, #f6f7fb);
}
.video-soon svg { width: 36px; height: 36px; color: var(--muted); }
.video-soon b { font-size: 1.02rem; font-weight: 900; color: var(--ink); }
.video-soon span { font-size: .86rem; font-weight: 600; color: var(--muted); max-width: 34ch; }

/* ===== ثبات أفقي على الموبايل: ممنوع أي تمرير أو إزاحة أفقية ===== */
html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
@supports (overflow: clip) { html, body { overflow-x: clip; } }
body { position: relative; }
img, video, svg, canvas, iframe { max-width: 100%; height: auto; }
.table-wrap, pre, .code, .code-wrap { max-width: 100%; }
.container, .container-narrow { max-width: 100%; }
.lesson-body > *, .card, .quiz, .q, .option, .quiz-card, .video-card { min-width: 0; }
/* صفوف التقدم: لازم تنضغط جوه عرض الشاشة بدل ما تطلع بره */
.prog-list { display: grid; grid-template-columns: minmax(0, 1fr); }
.prog-row { min-width: 0; }
.prog-lesson { flex: 1 1 auto; overflow: hidden; }
.prog-title { min-width: 0; }
.prog-scores { min-width: 0; }
.prog-lesson, .prog-scores { max-width: 100%; }
