/* =========================================================
   v9.css — يُحمَّل آخر شيء. تنسيق فقط، بدون أي تغيير في المنطق.
   ١) هيدر قريب من هيدر «تعلم بسهولة»  ٢) زر القائمة بلون خارج ألوان المنصة
   ٣) الدورق أكبر وبحركة أكبر  ٤) صفحات الاختبارات والمحاضرات بروح لوحة التحكم
   ========================================================= */
:root{--v9-rose:#D6296E;--v9-rose-l:#FF5C9A;--v9-line:#DDEEEA;--v9-soft:#EEF8F6;--v9-r:16px}
html[data-theme=dark]{--v9-line:#16263C;--v9-soft:#0E1B2E}

/* ---------- ١) الهيدر ---------- */
:is(.pg,body) .hx{background:#fff;box-shadow:0 10px 28px -20px rgba(18,18,58,.35);position:sticky;top:0;z-index:100}
html[data-theme=dark] :is(.pg,body) .hx{background:#0B1626;box-shadow:0 10px 28px -18px rgba(0,0,0,.7)}
:is(.pg,body) .hx .ac{height:3px;background:linear-gradient(90deg,#4F46E5 0%,#22D3EE 55%,#8DB8FF 100%)}
:is(.pg,body) .hx .hd{padding-block:12px}
:is(.pg,body) .hx .tg{border-radius:999px;box-shadow:inset 0 0 0 1px var(--v9-line)}

/* ---------- ٣) الدورق: أكبر + حركة أكبر ---------- */
:is(.pg,body) .hx .brand .brand__mark{width:clamp(46px,4.2vw,62px);height:clamp(46px,4.2vw,62px);overflow:visible;transform-origin:50% 85%;animation:v9-flask 3.4s ease-in-out infinite !important}
:is(.pg,body) .hx .brand .brand__mark g path{transform-box:fill-box;animation:v9-liquid 1.8s ease-in-out infinite}
:is(.pg,body) .hx .brand:hover .brand__mark{animation-duration:1.4s !important}
@keyframes v9-flask{0%,100%{transform:translateY(0) rotate(-7deg) scale(1)}25%{transform:translateY(-4px) rotate(0) scale(1.07)}50%{transform:translateY(0) rotate(7deg) scale(1)}75%{transform:translateY(-4px) rotate(0) scale(1.07)}}
@keyframes v9-liquid{0%,100%{transform:translateY(0) skewX(0)}50%{transform:translateY(-3px) skewX(-10deg)}}
@media(max-width:720px){
  :is(.pg,body) .hx .brand .brand__mark{width:clamp(34px,9.4vw,42px);height:clamp(34px,9.4vw,42px)}
}
@media(prefers-reduced-motion:reduce){
  :is(.pg,body) .hx .brand .brand__mark,:is(.pg,body) .hx .brand .brand__mark g path{animation:none !important}
}

/* ---------- ٤) صفحات الاختبارات والمحاضرات: روح لوحة التحكم ---------- */
.pg:has(.xm-hero),.pg:has(.lc-hero),.pg:has(.ex-grid),.pg:has(#xh){background:var(--v9-soft)}
html[data-theme=dark] .pg:has(.xm-hero),html[data-theme=dark] .pg:has(.lc-hero){background:#08111F}
/* الهيرو: أهدأ وأقصر، بحواف مدوّرة من تحت */
.pg .xm-hero,.pg .lc-hero{border-radius:0 0 28px 28px}
.pg .xm-hero{padding:26px 0 62px}.pg .lc-hero{padding:26px 0 76px}
/* البطاقات: حواف 16 + إطار هادئ + شريط لوني علوي بنفس منطق ألوان الصفوف */
.xm-card,.lc,.ex,.lc-ft,.lc-panel,.xs{border:1px solid var(--v9-line) !important;border-radius:var(--v9-r) !important;box-shadow:0 14px 30px -24px rgba(18,18,58,.35) !important;background:var(--card)}
.xm-card,.lc,.ex{position:relative;overflow:hidden;transition:transform .18s,box-shadow .18s,border-color .18s}
.xm-card::before,.lc::before,.ex::before{content:"";position:absolute;inset:0 0 auto 0;height:4px;z-index:2;background:linear-gradient(90deg,var(--gc,#4F46E5),var(--gl,#22D3EE))}
.xm-grid>:nth-child(3n+2),.lc-grid>:nth-child(3n+2),.ex-grid>:nth-child(3n+2){--gc:#2F62C4;--gl:#8DB8FF}
.xm-grid>:nth-child(3n),.lc-grid>:nth-child(3n),.ex-grid>:nth-child(3n){--gc:#5E4FC0;--gl:#B8AEFF}
.xm-card:hover,.lc:hover,.ex:hover{transform:translateY(-3px);border-color:var(--gl,#22D3EE) !important;box-shadow:0 20px 36px -22px rgba(18,18,58,.45) !important}
/* أيقونات في مربّعات ملوّنة خفيفة */
.xm-ico,.ic,.xm-empty .ic{border-radius:12px !important;background:color-mix(in srgb,var(--gc,#4F46E5) 12%,#fff) !important;color:var(--gc,#4F46E5) !important}
html[data-theme=dark] .xm-ico,html[data-theme=dark] .ic{background:rgba(34,211,238,.12) !important;color:#22D3EE !important}
/* عناوين الأقسام */
.xm-h h2::before,.lc-head h2::before,.gh h3::before{border-radius:4px}
.xm-h .cnt{background:var(--v9-soft);border:1px solid var(--v9-line);color:#4338CA;border-radius:999px;padding:1px 12px;font-weight:800}
/* تبويبات وفلاتر وبحث: كأزرار الشريط العلوي في لوحة التحكم */
.lc-tabs button,.lc-chips button{border-radius:999px !important;border:1px solid var(--v9-line) !important;background:var(--card);font-weight:700}
.lc-tabs button:hover,.lc-chips button:hover{border-color:#22D3EE !important;background:var(--v9-soft)}
.lc-tabs button[aria-pressed=true],.lc-chips button[aria-pressed=true]{background:linear-gradient(270deg,rgba(34,211,238,.28),rgba(34,211,238,.08)) !important;color:#12123A !important;border-color:#22D3EE !important;box-shadow:inset -3px 0 0 #22D3EE}
html[data-theme=dark] .lc-tabs button[aria-pressed=true],html[data-theme=dark] .lc-chips button[aria-pressed=true]{color:#fff !important}
.lc-search input{border-radius:999px !important;border:1px solid var(--v9-line) !important;background:var(--v9-soft)}
.lc-search input:focus{border-color:#22D3EE !important;box-shadow:0 0 0 3px rgba(34,211,238,.2)}
/* الأزرار الرئيسية: عنبري (CTA) بشكل كبسولة */
.pg .xm-go,.pg .lc-go,.ex .btn:not(.b2),.pg .lc-ft .lc-go{background:#FFB02E !important;color:#12123A !important;border:0 !important;border-radius:999px !important;font-weight:800;box-shadow:0 10px 20px -10px rgba(255,176,46,.8)}
.pg .xm-go:hover,.pg .lc-go:hover,.ex .btn:not(.b2):hover{background:#FFC25A !important;transform:translateY(-1px)}
.xm-view{border-radius:999px}
/* إحصائيات الهيرو كبطاقات الداشبورد */
.xm-stats span,.lc-stats span{border-radius:999px}
.xs b{color:#4338CA}
/* الحلقات والشارات */
.ring{box-shadow:0 0 0 4px var(--v9-soft)}
.tg2,.vd,.xm-vd{border-radius:999px}
/* شريط الاختبار أثناء الحل + بطاقة السؤال */
.rb{background:color-mix(in srgb,var(--card) 90%,transparent);backdrop-filter:blur(10px);border-radius:0 0 var(--v9-r) var(--v9-r)}
.qc{border:1px solid var(--v9-line) !important;border-radius:var(--v9-r) !important;box-shadow:0 14px 30px -24px rgba(18,18,58,.35) !important}
.op{border-radius:12px !important}
.qn button{border-radius:10px !important}

/* ---------- زر الأدمن في تذييل الرئيسية ---------- */
.ds-wrap{position:relative;display:flex;justify-content:center;padding:6px 0 18px;background:var(--ft,#0A0A24)}
.ds-wrap .ds-in{margin:0}
.ds-admin{font:700 11.5px/1 'Cairo',system-ui,sans-serif;color:#9FB3C8;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.16);border-radius:999px;padding:7px 14px;min-height:30px;cursor:pointer;transition:color .2s,border-color .2s,background .2s}
.ds-admin:hover,.ds-admin[aria-expanded=true]{color:#FFB02E;border-color:rgba(255,176,46,.5);background:rgba(255,176,46,.1)}
.ds-admin:focus-visible{outline:2px solid #22D3EE;outline-offset:2px}
.ds-wrap .ds-pop{position:absolute;left:50%;bottom:calc(100% - 6px);transform:translateX(-50%)}

/* =====================================================================
   v10 — الهيدر على طريقة «تعلم بسهولة»: الاسم + الدورق في النص،
   زر الوضع في أقصى اليمين، والقائمة (همبرجر) يسار بدون إطار وبلون برتقالي.
   ===================================================================== */
:root{--v10-orange:#FF6A13;--v10-orange-d:#FF8A3D;--v10-coral:#E5484D}
:is(.pg,body) .hx .hd{display:grid !important;grid-template-columns:1fr auto 1fr;align-items:center;column-gap:12px;row-gap:0;padding:10px 24px;min-height:0;flex-wrap:nowrap}
:is(.pg,body) .hx .hd>.he{grid-column:1;grid-row:1;justify-self:start;margin:0;order:0}
:is(.pg,body) .hx .hd>.brand{grid-column:2;grid-row:1;justify-self:center;margin:0 !important;order:0}
:is(.pg,body) .hx .hd>.hs{grid-column:3;grid-row:1;justify-self:end;margin:0;order:0}
:is(.pg,body) .hx .hd>.hm,:is(.pg,body) .hx .hd>.dhm{grid-column:3;grid-row:1;justify-self:end;order:0}
:is(.pg,body) .hx .he .hm,:is(.pg,body) .hx .he .dhm{display:none}
/* الروابط في صف تاني بالنص على الديسكتوب */
@media(min-width:1024px){
  :is(.pg,body) .hx .hd>.nav{grid-column:1/-1;grid-row:2;justify-self:center;margin:6px 0 0 !important;order:0}
  :is(.pg,body) .hx .hd{padding-block:12px 8px}
}
/* زر القائمة: بدون إطار ولا خلفية، ثلاث خطوط برتقالية */
:is(.pg,body) .hx .hm,:is(.pg,body) .hx .dhm,html[data-theme=dark] :is(.pg,body) .hx .hm,html[data-theme=dark] :is(.pg,body) .hx .dhm{border:0 !important;background:transparent !important;box-shadow:none !important;border-radius:10px;padding:0}
:is(.pg,body) .hx .hm span,:is(.pg,body) .hx .dhm span{background:var(--v10-orange) !important;height:3px;border-radius:3px}
html[data-theme=dark] :is(.pg,body) .hx .hm span,html[data-theme=dark] :is(.pg,body) .hx .dhm span{background:var(--v10-orange-d) !important}
:is(.pg,body) .hx .hm:hover,:is(.pg,body) .hx .dhm:hover{background:rgba(255,106,19,.10) !important}
:is(.pg,body) .hx .hm:focus-visible,:is(.pg,body) .hx .dhm:focus-visible{outline:2px solid var(--v10-orange);outline-offset:2px}
@media(max-width:1023px){
  :is(.pg,body) .hx .hd>.hs{display:none}
  :is(.pg,body) .hx.is-open .hd>.hs{display:flex}
}
@media(max-width:720px){
  :is(.pg,body) .hx .hd{padding:8px 14px}
  :is(.pg,body) .hx .hm{display:inline-flex}
  :is(.pg,body) .hx .hm span{width:24px}
  :is(.pg,body) .hx .hd>.nav{grid-column:1/-1;grid-row:2;order:0}
  :is(.pg,body) .hx .hd>.hs{grid-column:1/-1;grid-row:3;justify-self:stretch}
  :is(.pg,body) .hx .brand{min-height:0}
}
@media(min-width:721px) and (max-width:1023px){
  :is(.pg,body) .hx .hm,:is(.pg,body) .hx .dhm{display:inline-flex}
  :is(.pg,body) .hx .hm span,:is(.pg,body) .hx .dhm span{width:26px}
  :is(.pg,body) .hx .hd>.nav{grid-column:1/-1;grid-row:2}
  :is(.pg,body) .hx .hd>.hs{grid-column:1/-1;grid-row:3;justify-self:stretch}
}
/* زر «إنشاء حساب» في الهيرو: مرجاني، ليس تركوازيًا ولا أخضر */
.hv__br{flex-basis:100%;height:0}
.hv__b3{font-weight:800;color:#fff;background:linear-gradient(135deg,#F0555A,#D63A3F);border:2px solid transparent;box-shadow:0 .5cqw 1.2cqw -.6cqw rgba(214,58,63,.6)}
.hv__b3:hover{filter:brightness(1.07)}
.hv__b3 svg circle{fill:#fff}.hv__b3 svg path{fill:none;stroke:#D63A3F;stroke-width:2.6;stroke-linecap:round}
@media(min-width:1024px){
  :is(.pg,body) .hx .hd>.hs{display:flex !important;gap:8px;align-items:center}
  :is(.pg,body) .hx .hd>.hs .hl{display:inline-flex !important;align-items:center;gap:8px;padding:9px 18px;border-radius:999px;border:1px solid var(--v9-line);font-weight:700;font-size:14px}
}
@media(max-width:1023px){
  :is(.pg,body) .hx .hd>.hs{display:none !important}
  :is(.pg,body) .hx.is-open .hd>.hs{display:flex !important;width:100% !important;padding:6px 0 8px !important}
  :is(.pg,body) .hx.is-open .hd>.hs .hl{display:inline-flex !important;flex:1;justify-content:center;align-items:center;gap:8px;min-height:46px;border:1px solid var(--v9-line);border-radius:12px;font-weight:700}
  :is(.pg,body) .hx.has-user .hd>.hs{display:flex !important;width:auto !important;padding:0 !important;grid-column:3;grid-row:1}
}

/* v11: زر إنشاء حساب في الهيرو بالأصفر (لون الـCTA في الهوية) بنص كحلي */
.hv__b3{color:#12123A !important;background:linear-gradient(135deg,#FFC247,#FFA81F) !important;border:2px solid transparent;box-shadow:0 .5cqw 1.2cqw -.6cqw rgba(255,168,31,.75) !important}
.hv__b3 svg circle{fill:#12123A}.hv__b3 svg path{fill:none;stroke:#FFB02E;stroke-width:2.6;stroke-linecap:round}

/* v12: الدورق يتمايل يمين وشمال بوضوح، وأكبر على الموبايل. تقليل الحركة يوقفه (قاعدة v9 أعلاه) */
:is(.pg,body) .hx .brand .brand__mark{animation:v12-sway 2.6s ease-in-out infinite !important;transform-origin:50% 90%}
:is(.pg,body) .hx .brand:hover .brand__mark{animation-duration:1.8s !important}
@keyframes v12-sway{0%,100%{transform:translateX(-9px) rotate(-12deg)}50%{transform:translateX(9px) rotate(12deg)}}
@keyframes v9-liquid{0%,100%{transform:translateY(0) skewX(8deg)}50%{transform:translateY(-2px) skewX(-8deg)}}
@media(max-width:720px){
  :is(.pg,body) .hx .brand .brand__mark{width:clamp(42px,11.5vw,52px);height:clamp(42px,11.5vw,52px)}
  @keyframes v12-sway{0%,100%{transform:translateX(-7px) rotate(-12deg)}50%{transform:translateX(7px) rotate(12deg)}}
}
@media(prefers-reduced-motion:reduce){
  :is(.pg,body) .hx .brand .brand__mark,:is(.pg,body) .hx .brand:hover .brand__mark{animation:none !important}
}

/* =====================================================================
   v13 — زر الوضع الليلي/النهاري بلون من الهوية
   نهاري: مسار تركوازي متدرّج + مقبض أبيض. ليلي: مسار كحلي بحد تركوازي + مقبض أصفر.
   ===================================================================== */
:is(.pg,body) .hx .tg{background:linear-gradient(135deg,#4F46E5,#22D3EE) !important;box-shadow:0 6px 14px -8px rgba(79,70,229,.8) !important;border:0 !important}
:is(.pg,body) .hx .tg::before{background:#fff !important;box-shadow:0 2px 6px rgba(18,18,58,.3) !important}
:is(.pg,body) .hx .tg .i{color:#12123A !important;opacity:1 !important;stroke:currentColor}
:is(.pg,body) .hx .tg .i:nth-of-type(2){color:#fff !important}
html[data-theme=dark] :is(.pg,body) .hx .tg{background:#1B1A5C !important;box-shadow:inset 0 0 0 1.5px #22D3EE !important}
html[data-theme=dark] :is(.pg,body) .hx .tg::before{background:#FFB02E !important;box-shadow:0 2px 8px rgba(255,176,46,.45) !important}
html[data-theme=dark] :is(.pg,body) .hx .tg .i:first-of-type{color:#9FB3C8 !important}
html[data-theme=dark] :is(.pg,body) .hx .tg .i:nth-of-type(2){color:#12123A !important}

/* v14: DR badge on every page (was only defined in intro.css / theme-tokens.css) */
.drb{display:inline-block;font:900 .7em/1 Cairo,'Segoe UI',Arial,sans-serif;letter-spacing:.16em;padding:.3em .5em .24em .66em;border-radius:.6em;color:#4338CA;background:#E8EBFF;border:1px solid rgba(67,56,202,.3);margin-inline-end:.5em;vertical-align:.14em;font-style:normal;white-space:nowrap}
html[data-theme=dark] .drb,.drb--dark{color:#22D3EE;background:rgba(34,211,238,.13);border-color:rgba(34,211,238,.42)}
.drb--sm{font-size:.72em;vertical-align:.1em}
.drb--lg{font-size:.42em;vertical-align:.55em;margin-inline-end:.7em}

/* v17: "تصفح الدورات" = هوية (كحلي + تركواز)، "إنشاء حساب" = أصفر. ما يتشابهوش */
.hv__b1{color:#fff !important;background:linear-gradient(135deg,#1A5C8E 0%,#1B1A5C 100%) !important;border:2px solid #22D3EE !important;box-shadow:0 .6cqw 1.4cqw -.6cqw rgba(11,38,66,.55),inset 0 1px 0 rgba(255,255,255,.18) !important}
.hv__b1:hover{filter:brightness(1.12)}
.hv__b1 svg circle{fill:#22D3EE !important;stroke:none}
.hv__b1 svg path{fill:none !important;stroke:#1B1A5C !important;stroke-width:2.8}
html[data-theme=dark] .hv__b1{color:#fff !important;background:linear-gradient(135deg,#17608F 0%,#0E3556 100%) !important;border-color:#22D3EE !important}
