/* =====================================================================
   MadaAcademy — نظام التصميم
   ألوان: كحلي (هوية) + أزرق للأزرار والروابط + ذهبي للتمييز + تركواز للنجاح.
   كل لون له قيمة للوضع الفاتح والداكن، والتباين متحقق منه (WCAG AA).
   ===================================================================== */
:root {
  color-scheme: light;
  --bg: #F3F6FB;  --bg-2: #E8EEF8;  --surface: #FFFFFF;  --surface-2: #EDF2FA;
  --ink: #0E1A2F;  --muted: #4F6079;  --line: #D3DDEC;
  --primary: #1D4ED8;  --primary-strong: #1B3FB4;  --on-primary: #FFFFFF;  --primary-soft: rgba(29, 78, 216, .11);
  --gold: #F2B23A;  --gold-strong: #E39F1E;  --gold-ink: #2E2100;  --gold-soft: rgba(242, 178, 58, .22);
  --teal: #0B7F72;  --teal-soft: rgba(11, 127, 114, .12);
  --ok: #0B6B45;  --ok-soft: rgba(11, 107, 69, .14);
  --danger: #B83227;  --danger-soft: rgba(184, 50, 39, .13);  --on-danger: #FFFFFF;
  --hero-a: #0B1F3A;  --hero-b: #12356B;  --hero-c: #0E5E73;  --hero-ink: #F2F7FF;
  --shadow-1: 0 1px 2px rgba(14, 26, 47, .05), 0 6px 18px rgba(14, 26, 47, .06);
  --shadow-2: 0 2px 4px rgba(14, 26, 47, .06), 0 18px 40px rgba(14, 26, 47, .13);
  --r: 14px;  --r-lg: 20px;  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
}
:root[data-theme=dark] {
  color-scheme: dark;
  --bg: #08111F;  --bg-2: #0B1829;  --surface: #0F1D31;  --surface-2: #152842;
  --ink: #E7EEF9;  --muted: #9DB0CA;  --line: #2A4064;
  --primary: #7AA8FF;  --primary-strong: #A3C2FF;  --on-primary: #06122A;  --primary-soft: rgba(122, 168, 255, .15);
  --gold: #F4C461;  --gold-strong: #FFD580;  --gold-ink: #2E2100;  --gold-soft: rgba(244, 196, 97, .18);
  --teal: #4FD1BC;  --teal-soft: rgba(79, 209, 188, .14);
  --ok: #52D6A0;  --ok-soft: rgba(82, 214, 160, .15);
  --danger: #FF8F99;  --danger-soft: rgba(255, 143, 153, .15);  --on-danger: #2A0B0F;
  --hero-a: #08182E;  --hero-b: #0F2D57;  --hero-c: #0C5266;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
  --shadow-2: 0 2px 4px rgba(0, 0, 0, .35), 0 18px 40px rgba(0, 0, 0, .4);
}

/* ---------- أساسيات ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.8 var(--font); transition: background-color .3s, color .3s; }
h1, h2, h3, h4 { font-family: var(--font); font-weight: 800; line-height: 1.3; margin: 0; }
h1, h2 { text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.6vw, 3.5rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.45rem, 2.8vw, 2.05rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .8rem; }
a { color: var(--primary); text-underline-offset: .2em; }
img { max-width: 100%; }
code { font: .85em ui-monospace, Consolas, monospace; background: var(--surface-2); padding: .12em .45em; border-radius: 8px; direction: ltr; unicode-bidi: embed; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--gold-soft); }
.container { width: 100%; max-width: 1680px; margin-inline: auto; padding-inline: clamp(1rem, 4vw, 3.5rem); }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }
.ltr { direction: ltr; text-align: left; unicode-bidi: embed; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; } .grow { flex: 1; }
.stack > * + * { margin-top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 1rem; top: -4rem; background: var(--gold); color: var(--gold-ink); padding: .5rem 1rem; border-radius: var(--r); z-index: 200; font-weight: 700; }
.skip:focus { top: .75rem; }

/* ---------- أيقونات ---------- */
.ic { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -.22em; }
.ic-sun { display: none; }
:root[data-theme=dark] .ic-sun { display: inline; }
:root[data-theme=dark] .ic-moon { display: none; }

/* ---------- أزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.3rem; border-radius: var(--r); border: 1.5px solid transparent;
  background: var(--primary); color: var(--on-primary);
  font: 700 .95rem/1.4 var(--font); cursor: pointer; text-decoration: none;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s var(--ease), box-shadow .2s;
}
.btn:hover { background: var(--primary-strong); transform: translateY(-1px); box-shadow: var(--shadow-1); }
.btn:active { transform: none; box-shadow: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); box-shadow: none; }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); color: var(--danger); box-shadow: none; }
.btn.gold { background: var(--gold); color: var(--gold-ink); }
.btn.gold:hover { background: var(--gold-strong); }
.btn.sm { padding: .35rem .85rem; font-size: .85rem; border-radius: 10px; }
.btn.lg { padding: .9rem 1.7rem; font-size: 1.05rem; }
.btn.block { width: 100%; }
.btn[aria-busy=true] { pointer-events: none; opacity: .8; }
.btn[aria-busy=true]::after { content: ""; width: 1em; height: 1em; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.icon-btn {
  width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink); cursor: pointer; display: inline-grid; place-items: center;
  font-size: 1.1rem; transition: border-color .2s, background-color .2s, transform .2s var(--ease);
}
.icon-btn:hover { border-color: var(--primary); background: var(--primary-soft); transform: rotate(-8deg); }

/* ---------- نماذج ---------- */
.field { display: block; margin-bottom: 1rem; }
.field > span { display: block; font-size: .9rem; font-weight: 700; margin-bottom: .35rem; }
.field small { display: block; color: var(--muted); margin-top: .25rem; }
input, select, textarea {
  width: 100%; padding: .72rem .9rem; border: 1.5px solid var(--line); border-radius: var(--r);
  background: var(--surface); color: var(--ink); font: 400 1rem var(--font);
  transition: border-color .2s, box-shadow .2s;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
input[type=checkbox] { width: 1.1rem; height: 1.1rem; accent-color: var(--primary); }
textarea { min-height: 5.5rem; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 4px var(--primary-soft); }
input:user-invalid { border-color: var(--danger); }
.check { display: flex; align-items: center; gap: .55rem; cursor: pointer; padding: .25rem 0; }
.checks { border: 1.5px solid var(--line); border-radius: var(--r); padding: .55rem .8rem; max-height: 13rem; overflow: auto; background: var(--surface); }
.pw { position: relative; }
.pw button { position: absolute; inset-inline-end: .35rem; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); cursor: pointer; padding: .4rem; border-radius: 8px; display: grid; place-items: center; }
.pw button:hover { color: var(--primary); background: var(--primary-soft); }
.pw input { padding-inline-end: 2.9rem; }
.form-error { color: var(--danger); font-size: .92rem; min-height: 1.4em; margin: .3rem 0 .5rem; }
.meter { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: .5rem; }
.meter > i { display: block; height: 100%; width: 0; border-radius: 99px; transition: width .3s var(--ease), background-color .3s; }
.meter[data-level="1"] > i { width: 25%; background: var(--danger); }
.meter[data-level="2"] > i { width: 50%; background: var(--gold); }
.meter[data-level="3"] > i { width: 75%; background: var(--teal); }
.meter[data-level="4"] > i { width: 100%; background: var(--ok); }

/* ---------- بطاقات وشارات ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.35rem; box-shadow: var(--shadow-1); }
.lift { transition: transform .3s var(--ease), box-shadow .3s, border-color .3s; }
.lift:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); border-color: color-mix(in srgb, var(--primary) 40%, var(--line)); }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .08rem .7rem; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.off { background: var(--danger-soft); color: var(--danger); }
.badge.gold { background: var(--gold-soft); color: var(--ink); }
.badge.blue { background: var(--primary-soft); color: var(--primary); }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .32rem .9rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: 600 .85rem var(--font); cursor: pointer; transition: all .2s var(--ease); }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip[aria-pressed=true] { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.empty { padding: 2.5rem 1rem; text-align: center; color: var(--muted); border: 1.5px dashed var(--line); border-radius: var(--r-lg); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.empty .ic { width: 2.2rem; height: 2.2rem; display: block; margin: 0 auto .6rem; opacity: .7; }

/* ---------- الهيدر العام ---------- */
.topbar { position: sticky; top: 0; z-index: 60; background: var(--surface); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); transition: box-shadow .3s; }
.topbar.scrolled { box-shadow: var(--shadow-1); }
.topbar-in { display: flex; align-items: center; gap: 1rem; min-height: 4rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font: 800 1.35rem var(--font); color: var(--ink); text-decoration: none; }
.brand-mark { width: 2.1rem; height: 2.1rem; display: inline-block; object-fit: contain; background: transparent; border: 0; border-radius: 0; box-shadow: none; padding: 0; }
.links { display: flex; gap: .25rem; margin-inline-start: 1.25rem; }
.links > a { padding: .45rem .85rem; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 700; font-size: .95rem; transition: color .2s, background-color .2s; }
.links > a:hover, .links > a[aria-current=true] { color: var(--primary); background: var(--primary-soft); }
.actions { display: flex; align-items: center; gap: .5rem; margin-inline-start: auto; }
.nav-toggle { display: none; }
.links .nav-clone { display: none; }

/* ---------- الهيرو ---------- */
.hero { position: relative; overflow: hidden; color: var(--hero-ink); padding: clamp(2.8rem, 7vw, 5.5rem) 0 clamp(2.5rem, 6vw, 4.5rem); background: linear-gradient(135deg, var(--hero-a) 0%, var(--hero-b) 55%, var(--hero-c) 100%); isolation: isolate; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(520px circle at var(--mx, 25%) var(--my, 20%), rgba(255, 255, 255, .13), transparent 62%); transition: background-position .2s; }
.hero::after { content: ""; position: absolute; width: 26rem; height: 26rem; inset-inline-start: -8rem; bottom: -12rem; border-radius: 50%; background: rgba(242, 178, 58, .16); filter: blur(60px); z-index: -1; animation: drift 14s ease-in-out infinite alternate; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 2.5rem; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .9rem; border-radius: 999px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); font-size: .85rem; font-weight: 700; margin-bottom: 1rem; }
.hero h1 { margin-bottom: 1rem; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero p.lead { font-size: 1.12rem; max-width: 46ch; color: rgba(242, 247, 255, .9); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.4rem; }
.hero .btn:not(.ghost) { background: var(--gold); color: var(--gold-ink); }
.hero .btn:not(.ghost):hover { background: var(--gold-strong); }
.hero .btn.ghost { color: var(--hero-ink); border-color: rgba(255, 255, 255, .4); }
.hero .btn.ghost:hover { background: rgba(255, 255, 255, .12); border-color: #fff; color: #fff; }
.hero-points { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: 1.5rem 0 0; padding: 0; list-style: none; font-size: .92rem; color: rgba(242, 247, 255, .88); }
.hero-points li { display: inline-flex; align-items: center; gap: .4rem; }
.hero-points .ic { color: var(--gold); }
.hero-art { position: relative; min-height: 20rem; }
.float-card { position: absolute; display: flex; align-items: center; gap: .8rem; padding: .85rem 1.1rem; border-radius: 16px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22); backdrop-filter: blur(10px); box-shadow: 0 16px 40px rgba(0, 0, 0, .25); animation: bob 6s ease-in-out infinite; }
.float-card .ico { width: 2.6rem; height: 2.6rem; border-radius: 12px; display: grid; place-items: center; background: var(--gold); color: var(--gold-ink); font-size: 1.25rem; }
.float-card b { display: block; font-size: .98rem; line-height: 1.4; }
.float-card span { font-size: .8rem; color: rgba(242, 247, 255, .8); }
.float-card:nth-child(1) { top: 2%; inset-inline-end: 4%; }
.float-card:nth-child(2) { top: 38%; inset-inline-start: 0; animation-delay: -2s; }
.float-card:nth-child(3) { bottom: 4%; inset-inline-end: 12%; animation-delay: -4s; }
.float-card:nth-child(2) .ico { background: #fff; color: var(--hero-b); }
.float-card:nth-child(3) .ico { background: var(--teal); color: #fff; }

/* شريط الأرقام الحقيقية */
.stats-strip { margin-top: -2.4rem; position: relative; z-index: 2; }
.stats-strip .card { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; padding: 1.2rem 1.4rem; box-shadow: var(--shadow-2); }
.metric { text-align: center; }
.metric b { display: block; font: 800 2.1rem/1.2 var(--font); color: var(--primary); font-variant-numeric: tabular-nums; }
.metric span { color: var(--muted); font-size: .9rem; font-weight: 600; }

/* ---------- الأقسام ---------- */
.section { padding: clamp(2.2rem, 5vw, 3.6rem) 0; }
.section.alt { background: var(--bg-2); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.section-head p { margin: 0; color: var(--muted); max-width: 46ch; }
.section-title { position: relative; padding-bottom: .6rem; }
.section-title::after { content: ""; position: absolute; inset-inline-start: 0; bottom: 0; width: 3rem; height: 4px; border-radius: 4px; background: var(--gold); }
.feature-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.feature-card { position: relative; overflow: hidden; }
.feature-card .ico { width: 3.2rem; height: 3.2rem; border-radius: 14px; display: grid; place-items: center; font-size: 1.5rem; background: var(--primary-soft); color: var(--primary); margin-bottom: .9rem; transition: transform .35s var(--ease), background-color .3s, color .3s; }
.feature-card:hover .ico { transform: rotate(-8deg) scale(1.08); background: var(--primary); color: var(--on-primary); }
.feature-card p { color: var(--muted); margin: 0; }
.feature-card .soon { position: absolute; inset-inline-end: 1rem; top: 1rem; }

/* خطوات تفاعلية */
.steps { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: stretch; }
.step-list { display: grid; gap: .6rem; align-content: start; }
.step { display: flex; align-items: center; gap: .9rem; text-align: start; width: 100%; padding: .9rem 1rem; border-radius: var(--r); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: 700 1rem var(--font); cursor: pointer; transition: all .25s var(--ease); }
.step:hover { border-color: var(--primary); }
.step .n { width: 2.1rem; height: 2.1rem; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font-weight: 800; transition: all .25s; }
.step[aria-selected=true] { border-color: var(--primary); background: var(--primary-soft); transform: translateX(-6px); }
.step[aria-selected=true] .n { background: var(--primary); color: var(--on-primary); }
.step-panel { position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 1.8rem; color: var(--hero-ink); background: linear-gradient(135deg, var(--hero-a), var(--hero-b) 60%, var(--hero-c)); display: flex; flex-direction: column; justify-content: space-between; gap: 1.2rem; min-height: 15rem; }
.step-panel .ico { width: 3.4rem; height: 3.4rem; border-radius: 16px; background: var(--gold); color: var(--gold-ink); display: grid; place-items: center; font-size: 1.6rem; }
.step-panel h3 { font-size: 1.4rem; margin-bottom: .4rem; }
.step-panel p { color: rgba(242, 247, 255, .88); margin: 0; }
.step-panel .btn { align-self: flex-start; background: var(--gold); color: var(--gold-ink); }
.step-body { animation: fadeUp .45s var(--ease); }

/* المدرسين */
.filter-bar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-bottom: 1.25rem; }
.search { position: relative; flex: 1; min-width: 220px; }
.search .ic { position: absolute; inset-inline-start: .9rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding-inline-start: 2.6rem; }
.teacher-card { display: flex; gap: 1rem; align-items: flex-start; text-decoration: none; color: inherit; position: relative; }
.teacher-card h3 { color: var(--ink); transition: color .2s; }
.teacher-card:hover h3 { color: var(--primary); }
.teacher-card .go { position: absolute; inset-inline-end: 1.1rem; bottom: 1rem; color: var(--primary); opacity: 0; transform: translateX(8px); transition: all .3s var(--ease); }
.teacher-card:hover .go { opacity: 1; transform: none; }
.avatar { width: 64px; height: 64px; border-radius: 50%; flex: none; display: grid; place-items: center; background: linear-gradient(135deg, var(--gold), var(--gold-strong)); color: var(--gold-ink); font: 800 1.7rem var(--font); overflow: hidden; box-shadow: 0 0 0 3px var(--surface), 0 0 0 4.5px var(--line); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* الأسئلة الشائعة */
.faq { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); align-items: start; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); transition: border-color .2s, box-shadow .2s; }
.faq details[open] { border-color: var(--primary); box-shadow: var(--shadow-1); }
.faq summary { list-style: none; cursor: pointer; padding: 1rem 1.2rem; font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ic { color: var(--primary); transition: transform .3s var(--ease); }
.faq details[open] summary .ic { transform: rotate(180deg); }
.faq details > div { padding: 0 1.2rem 1.1rem; color: var(--muted); animation: fadeUp .35s var(--ease); }

.cta { position: relative; overflow: hidden; text-align: center; color: var(--hero-ink); border-radius: 28px; padding: clamp(2rem, 5vw, 3.2rem) 1.4rem; background: linear-gradient(135deg, var(--hero-a), var(--hero-b) 55%, var(--hero-c)); }
.cta h2 { margin-bottom: .6rem; }
.cta p { margin: 0 auto 1.3rem; max-width: 46ch; color: rgba(242, 247, 255, .88); }
.cta .btn { background: var(--gold); color: var(--gold-ink); }

/* ---------- الفوتر ---------- */
.footer { background: #0A1424; color: #D6E2F3; padding: 2.8rem 0 1.4rem; margin-top: auto; }
.footer .inner { display: grid; gap: 1.8rem; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; }
.footer .brand { color: #fff; margin-bottom: .6rem; }
.footer h4 { font-size: 1rem; margin: 0 0 .8rem; color: #fff; }
.footer p, .footer li, .footer a { color: #B9C9E0; text-decoration: none; font-size: .94rem; }
.footer a:hover { color: var(--gold); }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.footer li { display: flex; align-items: center; gap: .5rem; }
.footer .bottom { margin-top: 1.8rem; padding-top: 1rem; border-top: 1px solid rgba(255, 255, 255, .1); text-align: center; color: #8DA2C0; font-size: .84rem; }
.to-top { position: fixed; inset-inline-start: 1.2rem; bottom: 1.2rem; z-index: 70; opacity: 0; pointer-events: none; transform: translateY(12px); transition: all .3s var(--ease); box-shadow: var(--shadow-2); }
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }

/* ---------- صفحة المدرس ---------- */
.hero.sm { padding: clamp(2rem, 5vw, 3.4rem) 0 clamp(2.6rem, 6vw, 4rem); }
.t-hero { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.t-hero .avatar { width: 108px; height: 108px; font-size: 2.8rem; box-shadow: 0 0 0 4px rgba(255, 255, 255, .25); }
.t-hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: .4rem; }
.t-hero p { margin: .5rem 0 0; max-width: 56ch; color: rgba(242, 247, 255, .9); }
.tabbar { display: flex; gap: .25rem; border-bottom: 1.5px solid var(--line); margin-bottom: 1.4rem; overflow-x: auto; scrollbar-width: none; }
.tabbar button { position: relative; padding: .7rem 1.1rem; background: none; border: 0; color: var(--muted); font: 700 .98rem var(--font); cursor: pointer; white-space: nowrap; transition: color .2s; }
.tabbar button::after { content: ""; position: absolute; inset-inline: .6rem; bottom: -1.5px; height: 3px; border-radius: 3px; background: var(--primary); transform: scaleX(0); transition: transform .3s var(--ease); }
.tabbar button:hover { color: var(--ink); }
.tabbar button[aria-selected=true] { color: var(--primary); }
.tabbar button[aria-selected=true]::after { transform: scaleX(1); }
.pkg { display: flex; flex-direction: column; gap: .7rem; }
.price { font: 800 2.1rem/1.2 var(--font); color: var(--ink); }
.price small { font-size: .9rem; font-weight: 600; color: var(--muted); }
.price-note { color: var(--teal); font-size: .85rem; font-weight: 700; margin-top: -.4rem; }

/* ---------- الدخول والتسجيل ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { position: relative; overflow: hidden; color: var(--hero-ink); display: flex; flex-direction: column; justify-content: space-between; padding: 2.5rem; background: linear-gradient(135deg, var(--hero-a), var(--hero-b) 55%, var(--hero-c)); isolation: isolate; }
.auth-side::after { content: ""; position: absolute; width: 22rem; height: 22rem; border-radius: 50%; background: rgba(242, 178, 58, .18); filter: blur(60px); inset-inline-end: -6rem; bottom: -8rem; z-index: -1; animation: drift 12s ease-in-out infinite alternate; }
.auth-side .brand { color: #fff; }
.auth-side h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); margin-bottom: 1rem; }
.auth-side ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; }
.auth-side li { display: flex; gap: .7rem; align-items: center; color: rgba(242, 247, 255, .92); }
.auth-side li .ic { color: var(--gold); }
.auth-main { display: grid; place-items: center; padding: 2rem 1.25rem; position: relative; }
.auth-card { width: min(460px, 100%); }
.auth-main .theme-corner { position: absolute; top: 1rem; inset-inline-end: 1rem; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: var(--r); padding: .3rem; margin-bottom: 1.4rem; }
.tabs button { padding: .6rem; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font: 700 1rem var(--font); cursor: pointer; transition: all .25s var(--ease); }
.tabs button[aria-selected=true] { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-1); }
.form-in { animation: fadeUp .4s var(--ease); }

/* ---------- لوحات الطالب والأدمن ---------- */
.shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-inline-end: 1px solid var(--line); padding: 1.1rem; display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .who { font-size: .88rem; color: var(--muted); margin-top: .5rem; line-height: 1.5; }
.menu { display: flex; flex-direction: column; gap: .25rem; flex: 1; }
.menu a { position: relative; display: flex; align-items: center; gap: .7rem; padding: .65rem .9rem; border-radius: 12px; color: var(--muted); text-decoration: none; font-weight: 700; transition: all .2s var(--ease); }
.menu a:hover { background: var(--surface-2); color: var(--ink); }
.menu a[aria-current=page] { background: var(--primary-soft); color: var(--primary); }
.menu a[aria-current=page]::before { content: ""; position: absolute; inset-inline-start: -1.1rem; top: 22%; bottom: 22%; width: 4px; border-radius: 0 4px 4px 0; background: var(--primary); }
.main { min-width: 0; display: flex; flex-direction: column; }
.bar { display: flex; align-items: center; gap: .75rem; padding: .75rem 1.25rem; border-bottom: 1px solid var(--line); background: var(--surface); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 20; }
.bar h2 { font-size: 1.25rem; }
.view { padding: 1.5rem 1.25rem 4rem; max-width: 1680px; width: 100%; animation: fadeUp .4s var(--ease); }
.only-mobile { display: none; }
.scrim { position: fixed; inset: 0; background: rgba(5, 12, 24, .55); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .25s; }
.scrim.show { opacity: 1; pointer-events: auto; }
.welcome { position: relative; overflow: hidden; color: var(--hero-ink); border-radius: var(--r-lg); padding: 1.6rem; margin-bottom: 1.5rem; background: linear-gradient(135deg, var(--hero-a), var(--hero-b) 60%, var(--hero-c)); }
.welcome h2 { margin-bottom: .4rem; }
.welcome p { margin: 0; color: rgba(242, 247, 255, .9); }
.welcome .btn { margin-top: 1rem; background: var(--gold); color: var(--gold-ink); }
.resume { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; text-decoration: none; color: inherit; border-inline-start: 5px solid var(--gold); }
.resume .ico { width: 2.8rem; height: 2.8rem; border-radius: 50%; background: var(--gold); color: var(--gold-ink); display: grid; place-items: center; font-size: 1.2rem; flex: none; }

.course-card { display: flex; flex-direction: column; gap: .55rem; text-decoration: none; color: inherit; border-inline-start: 5px solid var(--teal); }
.course-card.locked { border-inline-start-color: var(--line); }
.course-card h3 { color: var(--ink); }
.progress { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 99px; background: var(--teal); transition: width .6s var(--ease); }
.list { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.lec { display: flex; align-items: center; gap: 1rem; padding: .95rem 1.1rem; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; transition: background-color .2s, padding .2s var(--ease); }
.lec:last-child { border-bottom: 0; }
a.lec:hover { background: var(--primary-soft); padding-inline-start: 1.4rem; }
.lec.locked { opacity: .65; }
.lec .n { width: 2.2rem; height: 2.2rem; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font-weight: 800; }
.lec.done .n { background: var(--ok-soft); color: var(--ok); }
.player { position: relative; aspect-ratio: 16/9; background: #000; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-2); }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player:fullscreen { border-radius: 0; }
.wm { position: absolute; z-index: 2; pointer-events: none; color: #fff; opacity: .4; font-size: .95rem; font-weight: 700; text-shadow: 0 0 4px rgba(0, 0, 0, .7); transition: top 1.2s, inset-inline-start 1.2s; white-space: nowrap; direction: ltr; }
.lec-nav { display: flex; justify-content: space-between; gap: .75rem; margin: 1rem 0; flex-wrap: wrap; }

/* ---------- جداول ---------- */
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.toolbar input[type=search] { flex: 1; min-width: 180px; }
.toolbar select { width: auto; min-width: 150px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { padding: .75rem .95rem; text-align: start; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: var(--surface-2); font-weight: 800; white-space: nowrap; font-size: .88rem; color: var(--muted); }
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]:hover { color: var(--primary); }
th[data-sort]::after { content: "↕"; margin-inline-start: .35rem; opacity: .35; font-size: .8em; }
th[aria-sort=ascending]::after { content: "↑"; opacity: 1; color: var(--primary); }
th[aria-sort=descending]::after { content: "↓"; opacity: 1; color: var(--primary); }
tbody tr { transition: background-color .15s; }
tbody tr:hover { background: var(--primary-soft); }
tr:last-child td { border-bottom: 0; }
td.act { white-space: nowrap; text-align: end; }
.count { color: var(--muted); font-size: .88rem; margin-inline-start: auto; }
.stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.stat { padding: 1.1rem 1.2rem; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); display: flex; gap: .9rem; align-items: center; }
.stat .ico { width: 2.8rem; height: 2.8rem; border-radius: 13px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: 1.3rem; flex: none; }
.stat b { display: block; font: 800 1.7rem/1.2 var(--font); font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .88rem; font-weight: 600; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.25rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }

/* ---------- نوافذ وتنبيهات ---------- */
dialog.modal { border: 0; border-radius: 20px; padding: 0; width: min(640px, calc(100% - 1.5rem)); max-height: 92vh; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); }
dialog.modal[open] { animation: pop .25s var(--ease); }
dialog.modal::backdrop { background: rgba(5, 12, 24, .6); backdrop-filter: blur(3px); }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.modal-b { padding: 1.25rem; overflow-y: auto; max-height: calc(92vh - 130px); }
.modal-f { display: flex; gap: .6rem; flex-wrap: wrap; padding: 1rem 1.25rem; border-top: 1px solid var(--line); }
.toasts { position: fixed; inset-inline: 0; bottom: 1rem; display: flex; flex-direction: column; align-items: center; gap: .5rem; z-index: 99; pointer-events: none; padding: 0 1rem; }
.toast { display: flex; align-items: center; gap: .6rem; background: var(--ink); color: var(--bg); padding: .7rem 1.1rem; border-radius: 12px; box-shadow: var(--shadow-2); font-weight: 700; animation: pop .3s var(--ease); }
.toast .ic { color: var(--gold); }
.toast.err { background: var(--danger); color: var(--on-danger); }
.toast.err .ic { color: inherit; }
.sk { background: linear-gradient(90deg, var(--surface-2) 25%, var(--bg-2) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: 10px; }
.sk-line { height: 1rem; margin-bottom: .6rem; } .sk-card { height: 7.5rem; border-radius: var(--r-lg); }

/* ---------- حركة ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes drift { to { transform: translate(40px, -30px) scale(1.15); } }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- متجاوب ---------- */
@media (max-width: 960px) {
  .hero-grid, .steps, .auth { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .footer .inner { grid-template-columns: 1fr 1fr; }
  .auth-side { display: none; }
  .links { display: none; }
  .nav-toggle { display: inline-grid; }
  .links.open { display: flex; position: absolute; inset-inline: 0; top: 100%; flex-direction: column; margin: 0; padding: .75rem 1rem 1rem; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-2); animation: fadeUp .25s var(--ease); }
  .links.open > a { padding: .75rem 1rem; }
  .actions #nav { display: none; }
  .links.open .nav-clone { display: flex; gap: .5rem; padding: .75rem 1rem 0; margin-top: .4rem; border-top: 1px solid var(--line); }
  .links.open .nav-clone .btn { flex: 1; padding: .6rem; font-size: .95rem; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: 280px; height: 100%; z-index: 40; transform: translateX(100%); transition: transform .28s var(--ease); box-shadow: var(--shadow-2); }
  .side.open { transform: none; }
  .menu a[aria-current=page]::before { display: none; }
  .only-mobile { display: inline-grid; }
}
@media (max-width: 560px) {
  .footer .inner { grid-template-columns: 1fr; }
  .actions .btn.sm { padding: .3rem .65rem; }
  .step[aria-selected=true] { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- صفحات قانونية ---------- */
.legal h3 { margin: 1.5rem 0 .4rem; }
.legal p { color: var(--muted); }
.legal a { font-weight: 700; }

/* ---------- الدفع ---------- */
.pay-opts { display: grid; gap: .6rem; }
.pay-opt { display: flex; align-items: center; gap: .9rem; width: 100%; text-align: start; padding: .85rem 1rem; border-radius: var(--r); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: 700 1rem var(--font); cursor: pointer; transition: all .2s var(--ease); }
.pay-opt:hover { border-color: var(--primary); background: var(--primary-soft); transform: translateX(-4px); }
.pay-opt .ico { width: 2.6rem; height: 2.6rem; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: 1.3rem; flex: none; }
.pay-opt small { display: block; font-weight: 400; color: var(--muted); font-size: .82rem; }
.pay-opt.ghost { border-style: dashed; }
.big-ic { width: 4.5rem; height: 4.5rem; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; font-size: 2.2rem; }
.big-ic.ok { background: var(--ok-soft); color: var(--ok); } .big-ic.bad { background: var(--danger-soft); color: var(--danger); } .big-ic.wait { background: var(--gold-soft); color: var(--ink); }
.spinner-lg { width: 3rem; height: 3rem; margin: 0 auto; border: 4px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin .9s linear infinite; }

/* ---------- امتحانات (لوحة الأدمن) ---------- */
.grid2 { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.notice { border-inline-start: 5px solid var(--gold); background: var(--gold-soft); }
.qcard { margin-bottom: 1rem; }
.qhead { display: flex; align-items: center; gap: .6rem; margin-bottom: .9rem; flex-wrap: wrap; }
.icon-btn.sm { width: 2rem; height: 2rem; font-size: .9rem; }
.opt-row { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.opt-row .radio { display: grid; place-items: center; width: 1.8rem; flex: none; cursor: pointer; }
.opt-row input[type=radio], .choice input[type=radio] { width: 1.15rem; height: 1.15rem; accent-color: var(--ok); }
.savebar { position: sticky; bottom: .5rem; z-index: 15; display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; padding: .8rem 1rem; margin-top: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-2); }
.answerbox { white-space: pre-wrap; background: var(--surface-2); border-radius: var(--r); padding: .8rem 1rem; margin: 0; font-family: inherit; }
.opt { display: flex; align-items: center; gap: .6rem; padding: .5rem .8rem; border: 1.5px solid var(--line); border-radius: var(--r); margin-bottom: .4rem; }
.opt.correct { border-color: var(--ok); background: var(--ok-soft); }
.opt.wrong { border-color: var(--danger); background: var(--danger-soft); }
.opt .mark { margin-inline-start: auto; font-size: .8rem; font-weight: 700; }
.points-in { max-width: 150px; }

/* ---------- امتحانات (الطالب) ---------- */
.exam-bar { position: sticky; top: 4.3rem; z-index: 12; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .7rem 1rem; margin-bottom: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.timer { font: 800 1.5rem/1 var(--font); font-variant-numeric: tabular-nums; direction: ltr; padding: .35rem .8rem; border-radius: 12px; background: var(--primary-soft); color: var(--primary); }
.timer.low { background: var(--danger-soft); color: var(--danger); animation: pulse 1s ease-in-out infinite; }
.qnav { display: flex; flex-wrap: wrap; gap: .35rem; }
.qnav a, .qnav button { background: transparent; font-family: inherit; cursor: pointer; width: 2rem; height: 2rem; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: .85rem; text-decoration: none; color: var(--muted); border: 1.5px solid var(--line); }
.qnav a.done, .qnav button.done { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.choice { display: flex; align-items: center; gap: .7rem; padding: .7rem .9rem; border: 1.5px solid var(--line); border-radius: var(--r); margin-bottom: .5rem; cursor: pointer; transition: all .15s; }
.choice:hover { border-color: var(--primary); }
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.score-ring { width: 9rem; height: 9rem; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; background: conic-gradient(var(--teal) calc(var(--p) * 1%), var(--surface-2) 0); }
.score-ring > div { width: 7.4rem; height: 7.4rem; border-radius: 50%; background: var(--surface); display: grid; place-items: center; align-content: center; }
.score-ring b { font: 800 2rem/1 var(--font); } .score-ring span { color: var(--muted); font-size: .85rem; }
@keyframes pulse { 50% { opacity: .6; } }
