/* ==========================================================
   منافسين — الواجهة الزجاجية
   الألوان مستوحاة من شعار نافس: بنفسجي / برتقالي / أخضر / فيروزي
   ========================================================== */
@font-face { font-family: "Cairo"; font-style: normal; font-weight: 200 1000; font-display: swap;
  src: url(../fonts/cairo-arabic.woff2) format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Cairo"; font-style: normal; font-weight: 200 1000; font-display: swap;
  src: url(../fonts/cairo-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --purple: #4a3b8f;
  --purple-2: #6a58c4;
  --orange: #f29a48;
  --green: #45b27a;
  --teal: #3fb0c4;
  --red: #e0605e;

  --ink: #231c4a;
  --ink-2: #5a5480;
  --ink-3: #8c87a8;
  --bg: #f3f1fb;

  --glass: rgba(255, 255, 255, .58);
  --glass-strong: rgba(255, 255, 255, .78);
  --glass-border: rgba(255, 255, 255, .85);
  --stroke: rgba(74, 59, 143, .12);
  --shadow: 0 10px 40px -12px rgba(46, 33, 110, .22), 0 2px 6px rgba(46, 33, 110, .05);
  --shadow-lg: 0 30px 70px -20px rgba(46, 33, 110, .35);

  --r-sm: 12px;
  --r: 20px;
  --r-lg: 28px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body { min-height: 100%; }
body {
  font-family: "Cairo", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--purple-2); }
img { max-width: 100%; }

/* ---------- حماية المحتوى ---------- */
.protect, .protect * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, [contenteditable] { -webkit-user-select: text; user-select: text; }
@media print { body * { display: none !important; } body::after { content: ""; } }

/* ---------- الخلفية ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background:
  radial-gradient(1200px 600px at 100% -10%, #e9e4ff 0%, transparent 60%),
  radial-gradient(900px 600px at -10% 110%, #ddf4ee 0%, transparent 60%), var(--bg); }
.bg .blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: float 22s var(--ease) infinite alternate; }
.bg .b1 { width: 420px; height: 420px; background: var(--orange); top: -120px; left: 8%; opacity: .35; }
.bg .b2 { width: 380px; height: 380px; background: var(--teal); bottom: -80px; right: 4%; animation-delay: -6s; opacity: .38; }
.bg .b3 { width: 360px; height: 360px; background: var(--green); top: 40%; left: -120px; animation-delay: -12s; opacity: .3; }
.bg .b4 { width: 460px; height: 460px; background: var(--purple-2); top: 20%; right: 30%; animation-delay: -3s; opacity: .18; }
.bg .grid { position: absolute; inset: 0; background-image:
  linear-gradient(rgba(74,59,143,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(74,59,143,.05) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%); }
@keyframes float { to { transform: translate(60px, 40px) scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .bg .blob { animation: none; } * { transition: none !important; animation: none !important; } }

/* ---------- الزجاج ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  border-radius: var(--r-lg);
}

/* ---------- الشريط العلوي ---------- */
.topbar { position: sticky; top: 12px; z-index: 50; margin: 12px auto 0; width: min(1180px, calc(100% - 24px));
  display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 18px; border-radius: 22px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); cursor: pointer; }
.brand-mark { display: flex; gap: 3px; align-items: center; }
.brand-mark span { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; line-height: 1; }
.brand-mark span:nth-child(1) { background: var(--orange); transform: rotate(-10deg); }
.brand-mark span:nth-child(2) { background: var(--green); border-radius: 50%; transform: translateY(-3px) scale(1.12); }
.brand-mark span:nth-child(3) { background: var(--teal); transform: rotate(10deg); }
.brand-name { font-weight: 800; font-size: 20px; color: var(--purple); letter-spacing: -.2px; }
.brand-sub { font-size: 11.5px; color: var(--ink-3); margin-top: -6px; font-weight: 600; }
.topbar .spacer { flex: 1; }
.role-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 8px 6px 14px; border-radius: 99px;
  background: rgba(255,255,255,.7); border: 1px solid var(--stroke); font-weight: 700; font-size: 14px; }
.role-chip i { font-style: normal; font-size: 18px; }
.role-chip button { border: 0; background: var(--purple); color: #fff; border-radius: 99px; padding: 3px 12px; font-size: 12.5px; cursor: pointer; font-weight: 700; }

/* ---------- التخطيط ---------- */
.wrap { width: min(1180px, calc(100% - 24px)); margin: 0 auto; padding: 26px 0 60px; }
.view { animation: rise .5s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.card { padding: 24px; }
.card-sm { padding: 16px 18px; border-radius: var(--r); }
.stack > * + * { margin-top: 16px; }
.muted { color: var(--ink-2); }
.tiny { font-size: 12.5px; color: var(--ink-3); }
.center { text-align: center; }
.hidden { display: none !important; }

h1 { font-size: clamp(28px, 4.2vw, 46px); line-height: 1.3; font-weight: 800; letter-spacing: -.5px; }
h2 { font-size: 24px; font-weight: 800; line-height: 1.4; }
h3 { font-size: 18px; font-weight: 800; line-height: 1.5; }
.grad-text { background: linear-gradient(90deg, var(--purple), var(--purple-2) 45%, var(--teal)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; font-weight: 700; font-size: 13px; color: var(--purple);
  background: rgba(106,88,196,.1); padding: 4px 12px; border-radius: 99px; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 30px 0 14px; }
.section-title .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--orange); box-shadow: 14px 0 0 var(--green), 28px 0 0 var(--teal); margin-left: 30px; }

/* ---------- الأزرار ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer;
  padding: 11px 20px; border-radius: 14px; font-weight: 700; font-size: 15px; transition: transform .15s var(--ease), box-shadow .2s, background .2s, opacity .2s;
  background: rgba(255,255,255,.75); color: var(--ink); border: 1px solid var(--stroke); white-space: nowrap; text-decoration: none; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px -8px rgba(46,33,110,.35); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.primary { background: linear-gradient(135deg, var(--purple-2), var(--purple)); color: #fff; border-color: transparent; box-shadow: 0 10px 24px -10px rgba(74,59,143,.7); }
.btn.orange { background: linear-gradient(135deg, #f7b26b, var(--orange)); color: #fff; border-color: transparent; }
.btn.green { background: linear-gradient(135deg, #5fc792, var(--green)); color: #fff; border-color: transparent; }
.btn.teal { background: linear-gradient(135deg, #5cc3d4, var(--teal)); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.lg { padding: 14px 28px; font-size: 17px; border-radius: 16px; }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn .ico { font-size: 1.15em; line-height: 1; }
.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.btn:not(.primary):not(.orange):not(.green):not(.teal) .spinner { border-color: rgba(74,59,143,.2); border-top-color: var(--purple); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- الصفحة الرئيسية ---------- */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 30px; align-items: center; padding: 26px 8px 10px; }
.hero p.lead { font-size: 18px; color: var(--ink-2); margin-top: 12px; max-width: 560px; }
.hero-art { position: relative; height: 320px; }
.hero-art .tile { position: absolute; display: grid; place-items: center; color: #fff; font-weight: 800; box-shadow: var(--shadow-lg); }
.hero-art .t1 { width: 120px; height: 120px; border-radius: 30px; background: linear-gradient(135deg, #f7b26b, var(--orange)); font-size: 70px; top: 40px; right: 30px; transform: rotate(-12deg); animation: bob 6s ease-in-out infinite; }
.hero-art .t2 { width: 150px; height: 150px; border-radius: 50%; background: linear-gradient(135deg, #63cf97, var(--green)); font-size: 84px; top: 10px; right: 150px; animation: bob 6s ease-in-out -2s infinite; }
.hero-art .t3 { width: 120px; height: 120px; border-radius: 30px; background: linear-gradient(135deg, #62c9da, var(--teal)); font-size: 70px; top: 40px; right: 300px; transform: rotate(12deg); animation: bob 6s ease-in-out -4s infinite; }
.hero-art .ring { position: absolute; inset: 90px 10px 20px 10px; border-radius: 50%; border: 2.5px solid rgba(63,176,196,.5); transform: rotate(-12deg); }
.hero-art .ring.r2 { border-color: rgba(242,154,72,.5); transform: rotate(10deg); inset: 100px 0 10px 20px; }
.hero-art .stat { position: absolute; bottom: 20px; right: 70px; padding: 12px 18px; border-radius: 18px; }
.hero-art .stat b { font-size: 26px; color: var(--purple); display: block; line-height: 1.2; }
@keyframes bob { 50% { translate: 0 -12px; } }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } .hero-art { height: 260px; transform: scale(.8); transform-origin: top right; } }

.roles { margin-top: 26px; }
.role-card { position: relative; padding: 26px 24px 22px; cursor: pointer; overflow: hidden; transition: transform .35s var(--ease), box-shadow .35s; border: 1px solid var(--glass-border); text-align: right; width: 100%; }
.role-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.role-card:focus-visible { outline: 3px solid var(--purple-2); outline-offset: 3px; }
.role-card .ic { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; font-size: 32px; margin-bottom: 14px; color: #fff; }
.role-card h3 { font-size: 22px; }
.role-card p { color: var(--ink-2); margin-top: 6px; font-size: 15px; min-height: 76px; }
.role-card ul { list-style: none; margin-top: 12px; display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.role-card .go { margin-top: 18px; display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: var(--purple); }
.role-card::after { content: ""; position: absolute; width: 200px; height: 200px; border-radius: 50%; top: -90px; left: -70px; opacity: .18; transition: transform .5s var(--ease); }
.role-card:hover::after { transform: scale(1.3); }
.role-card.teacher .ic, .role-card.teacher::after { background: linear-gradient(135deg, #8a78e0, var(--purple)); }
.role-card.parent .ic, .role-card.parent::after { background: linear-gradient(135deg, #f7b26b, var(--orange)); }
.role-card.student .ic, .role-card.student::after { background: linear-gradient(135deg, #63cf97, var(--green)); }

.features .f { display: flex; gap: 14px; align-items: flex-start; }
.features .f .ic { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 20px; background: rgba(106,88,196,.12); }

/* ---------- الصفحات الداخلية ---------- */
.page-head { display: flex; align-items: center; gap: 18px; padding: 22px 26px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .ic { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; font-size: 28px; color: #fff; flex: none; }
.page-head .t { flex: 1; min-width: 220px; }
.page-head p { color: var(--ink-2); }

.tabs { display: flex; gap: 6px; padding: 6px; border-radius: 18px; overflow-x: auto; margin-bottom: 20px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: transparent; padding: 10px 16px; border-radius: 13px; font-weight: 700; cursor: pointer; color: var(--ink-2); white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; transition: background .2s, color .2s; }
.tab:hover { background: rgba(255,255,255,.6); }
.tab.active { background: #fff; color: var(--purple); box-shadow: 0 4px 14px -6px rgba(46,33,110,.3); }

/* ---------- عناصر النماذج ---------- */
.field { display: grid; gap: 6px; }
.field > label, .label { font-weight: 700; font-size: 14px; color: var(--ink-2); }
.input { width: 100%; padding: 11px 14px; border-radius: 13px; border: 1px solid var(--stroke); background: rgba(255,255,255,.8); outline: none; transition: border .2s, box-shadow .2s; }
.input:focus { border-color: var(--purple-2); box-shadow: 0 0 0 4px rgba(106,88,196,.15); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { border: 1.5px solid var(--stroke); background: rgba(255,255,255,.7); padding: 10px 18px; border-radius: 14px; cursor: pointer; font-weight: 700; transition: all .2s var(--ease); display: inline-flex; gap: 8px; align-items: center; }
.chip:hover { border-color: var(--purple-2); }
.chip.on { background: var(--purple); color: #fff; border-color: var(--purple); box-shadow: 0 8px 18px -8px rgba(74,59,143,.7); }
.chip:disabled { opacity: .45; cursor: not-allowed; }
.chip small { font-weight: 600; opacity: .75; font-size: 12px; }

.steps { counter-reset: s; }
.step { position: relative; padding-right: 50px; }
.step + .step { margin-top: 22px; }
.step::before { counter-increment: s; content: counter(s); position: absolute; right: 0; top: 0; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--purple-2), var(--purple)); }
.step h4 { font-size: 16px; font-weight: 800; margin-bottom: 10px; line-height: 34px; }

input[type=range] { width: 100%; accent-color: var(--purple); }
.range-val { font-weight: 800; color: var(--purple); font-size: 22px; min-width: 44px; text-align: center; }
.seg { display: inline-flex; background: rgba(74,59,143,.08); border-radius: 13px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 10px; font-weight: 700; cursor: pointer; color: var(--ink-2); }
.seg button.on { background: #fff; color: var(--purple); box-shadow: 0 3px 10px -4px rgba(46,33,110,.3); }

/* ---------- شجرة النواتج ---------- */
.tree { max-height: 460px; overflow: auto; padding: 6px; border-radius: 16px; background: rgba(255,255,255,.45); border: 1px solid var(--stroke); }
.tree details { border-radius: 12px; }
.tree details > summary { list-style: none; cursor: pointer; display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 12px; }
.tree details > summary::-webkit-details-marker { display: none; }
.tree details > summary:hover { background: rgba(255,255,255,.7); }
.tree .caret { transition: transform .2s; color: var(--ink-3); flex: none; width: 16px; margin-top: 3px; }
.tree details[open] > summary .caret { transform: rotate(-90deg); }
.tree .kids { padding-right: 26px; border-right: 2px dashed rgba(74,59,143,.12); margin-right: 16px; }
.tree .lvl-d > summary { font-weight: 800; color: var(--purple); }
.tree .lvl-s > summary { font-weight: 700; }
.tree .lvl-o > summary { font-weight: 600; font-size: 14px; }
.tree .ind { display: flex; gap: 10px; padding: 6px 10px; border-radius: 10px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.tree .ind:hover { background: rgba(255,255,255,.7); }
.tree .code { font-size: 11.5px; color: var(--ink-3); direction: ltr; unicode-bidi: isolate; font-weight: 600; }
.tree .cnt { margin-right: auto; font-size: 11.5px; background: rgba(69,178,122,.14); color: #2d8a5a; padding: 0 8px; border-radius: 99px; font-weight: 700; flex: none; height: fit-content; }
.cb { appearance: none; width: 20px; height: 20px; border-radius: 6px; border: 2px solid rgba(74,59,143,.35); background: #fff; flex: none; cursor: pointer; display: grid; place-items: center; margin-top: 2px; transition: all .15s; }
.cb:checked { background: var(--purple); border-color: var(--purple); }
.cb:checked::after { content: ""; width: 11px; height: 6px; border: solid #fff; border-width: 0 0 2.5px 2.5px; transform: translateY(-1.5px) rotate(-45deg); }
.cb:indeterminate { background: var(--purple-2); border-color: var(--purple-2); }
.cb:indeterminate::after { content: ""; width: 9px; height: 2.5px; background: #fff; border-radius: 2px; }

/* ---------- الأسئلة ---------- */
.q-card { padding: 20px 22px; border-radius: var(--r); background: rgba(255,255,255,.72); border: 1px solid var(--glass-border); position: relative; }
.q-card + .q-card { margin-top: 14px; }
.q-num { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 8px; border-radius: 11px; background: linear-gradient(135deg, var(--purple-2), var(--purple)); color: #fff; font-weight: 800; margin-left: 10px; float: right; }
.q-text { font-weight: 700; font-size: 17px; white-space: pre-line; overflow: hidden; }
.q-meta { clear: both; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.tag { font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 99px; background: rgba(74,59,143,.08); color: var(--ink-2); }
.tag.easy { background: rgba(69,178,122,.14); color: #2d8a5a; }
.tag.medium { background: rgba(242,154,72,.16); color: #b8661b; }
.tag.hard { background: rgba(224,96,94,.14); color: #b43c3a; }
.opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; clear: both; }
@media (max-width: 640px) { .opts { grid-template-columns: 1fr; } }
.opt { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--stroke); background: rgba(255,255,255,.8); cursor: pointer; text-align: right; font-weight: 600; transition: all .18s var(--ease); width: 100%; }
.opt:hover:not(:disabled) { border-color: var(--purple-2); transform: translateY(-1px); }
.opt .l { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(74,59,143,.08); font-weight: 800; flex: none; color: var(--purple); }
.opt.sel { border-color: var(--purple); background: rgba(106,88,196,.1); }
.opt.sel .l { background: var(--purple); color: #fff; }
.opt.ok { border-color: var(--green); background: rgba(69,178,122,.12); }
.opt.ok .l { background: var(--green); color: #fff; }
.opt.bad { border-color: var(--red); background: rgba(224,96,94,.1); }
.opt.bad .l { background: var(--red); color: #fff; }
.opt:disabled { cursor: default; }
.ltr { direction: ltr; unicode-bidi: isolate; }

/* ---------- شاشة الاختبار ---------- */
.exam { display: grid; grid-template-columns: 1fr 280px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .exam { grid-template-columns: 1fr; } .exam aside { order: -1; } }
.exam-q { padding: 28px; min-height: 380px; }
.exam-q .q-text { font-size: 20px; line-height: 1.9; }
.exam-q .opts { grid-template-columns: 1fr; gap: 12px; margin-top: 22px; }
.exam-q .opt { padding: 15px 16px; font-size: 17px; }
.exam-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.progress { height: 8px; border-radius: 99px; background: rgba(74,59,143,.1); overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--green)); border-radius: 99px; transition: width .4s var(--ease); }
.navgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; margin-top: 12px; }
.navgrid button { aspect-ratio: 1; border-radius: 10px; border: 1.5px solid var(--stroke); background: rgba(255,255,255,.75); font-weight: 800; cursor: pointer; font-size: 13px; position: relative; }
.navgrid button.ans { background: rgba(106,88,196,.16); border-color: rgba(106,88,196,.35); color: var(--purple); }
.navgrid button.cur { outline: 2.5px solid var(--purple); outline-offset: 1px; }
.navgrid button.flag::after { content: ""; position: absolute; top: -3px; left: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--orange); border: 2px solid #fff; }
.navgrid button.ok { background: rgba(69,178,122,.2); border-color: var(--green); color: #2d8a5a; }
.navgrid button.bad { background: rgba(224,96,94,.16); border-color: var(--red); color: #b43c3a; }
.timer { font-weight: 800; font-size: 26px; color: var(--purple); direction: ltr; font-variant-numeric: tabular-nums; }
.timer.warn { color: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .5; } }

/* ---------- النتيجة ---------- */
.score-ring { --p: 0; width: 190px; height: 190px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto;
  background: conic-gradient(var(--c, var(--green)) calc(var(--p) * 1%), rgba(74,59,143,.1) 0); position: relative; transition: --p 1s; }
.score-ring::before { content: ""; position: absolute; inset: 14px; border-radius: 50%; background: rgba(255,255,255,.92); }
.score-ring > div { position: relative; text-align: center; line-height: 1.2; }
.score-ring b { font-size: 44px; font-weight: 800; color: var(--ink); display: block; }
.score-ring span { color: var(--ink-3); font-weight: 700; }
.level { display: inline-flex; padding: 6px 18px; border-radius: 99px; color: #fff; font-weight: 800; margin-top: 14px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px 56px; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--stroke); font-size: 14px; }
.bar-row:last-child { border-bottom: 0; }
.bar-row .bar { height: 10px; border-radius: 99px; background: rgba(74,59,143,.1); overflow: hidden; }
.bar-row .bar i { display: block; height: 100%; border-radius: 99px; }
.bar-row b { text-align: left; direction: ltr; }
@media (max-width: 640px) { .bar-row { grid-template-columns: 1fr 80px 46px; } }
.kpi { padding: 16px; border-radius: 18px; background: rgba(255,255,255,.6); border: 1px solid var(--glass-border); text-align: center; }
.kpi b { display: block; font-size: 26px; font-weight: 800; color: var(--purple); line-height: 1.3; }
.kpi span { font-size: 13px; color: var(--ink-2); font-weight: 700; }

/* ---------- وضع العرض (المعلم) ---------- */
.present { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; padding: 22px clamp(16px, 4vw, 60px);
  background: linear-gradient(135deg, rgba(243,241,251,.92), rgba(233,247,245,.92)); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); animation: rise .4s var(--ease); }
.present-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.present-body { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 1200px; width: 100%; margin: 0 auto; padding: 20px 0; overflow: auto; }
.present .q-text { font-size: clamp(22px, 3vw, 38px); line-height: 1.7; font-weight: 800; }
.present .opts { gap: 16px; margin-top: 30px; }
.present .opt { font-size: clamp(18px, 2.2vw, 28px); padding: 18px 22px; border-radius: 20px; }
.present .opt .l { width: 46px; height: 46px; font-size: 22px; }
.present-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(74,59,143,.18); cursor: pointer; }
.dots i.cur { background: var(--purple); transform: scale(1.3); }
.dots i.ok { background: var(--green); }
.dots i.bad { background: var(--red); }

/* ---------- محتوى تعريفي ---------- */
.info-card { padding: 22px; border-radius: var(--r); }
.info-card .ic { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; font-size: 24px; margin-bottom: 10px; color: #fff; }
.info-card p, .info-card li { color: var(--ink-2); font-size: 15px; }
.info-card ul { padding-right: 20px; margin-top: 6px; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; overflow: hidden; border-radius: 16px; border: 1px solid var(--stroke); background: rgba(255,255,255,.6); }
.table th, .table td { padding: 12px 14px; text-align: right; border-bottom: 1px solid var(--stroke); font-size: 15px; }
.table th { background: rgba(74,59,143,.07); font-weight: 800; color: var(--purple); }
.table tr:last-child td { border-bottom: 0; }
.yes { color: var(--green); font-weight: 800; }
.no { color: var(--ink-3); }
.doc-link { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: 18px; text-decoration: none; color: var(--ink); background: rgba(255,255,255,.7); border: 1px solid var(--glass-border); transition: transform .2s var(--ease), box-shadow .2s; }
.doc-link:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.doc-link .ic { width: 50px; height: 50px; border-radius: 14px; background: linear-gradient(135deg, #f58b7c, var(--red)); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.doc-link b { display: block; }
.doc-link span { font-size: 13px; color: var(--ink-3); }
.callout { padding: 14px 18px; border-radius: 16px; background: rgba(242,154,72,.12); border: 1px solid rgba(242,154,72,.3); color: #8a4f14; font-size: 14px; }
.callout.info { background: rgba(63,176,196,.1); border-color: rgba(63,176,196,.3); color: #1d6776; }
.steps-h { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; counter-reset: sh; }
@media (max-width: 900px) { .steps-h { grid-template-columns: repeat(2, 1fr); } }
.steps-h > div { padding: 18px; border-radius: 18px; background: rgba(255,255,255,.6); border: 1px solid var(--glass-border); position: relative; }
.steps-h > div::before { counter-increment: sh; content: counter(sh); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--teal); color: #fff; font-weight: 800; margin-bottom: 8px; }
.steps-h b { display: block; margin-bottom: 4px; }
.steps-h p { font-size: 14px; color: var(--ink-2); }

/* ---------- نوافذ وتنبيهات ---------- */
.modal-back { position: fixed; inset: 0; z-index: 300; background: rgba(35,28,74,.35); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(520px, 100%); padding: 26px; border-radius: var(--r-lg); background: rgba(255,255,255,.92); box-shadow: var(--shadow-lg); animation: rise .3s var(--ease); max-height: 90vh; overflow: auto; }
.modal.wide { width: min(760px, 100%); }
.modal h3 { margin-bottom: 8px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-start; margin-top: 20px; flex-wrap: wrap; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 400; padding: 12px 22px; border-radius: 16px; background: rgba(35,28,74,.92); color: #fff; font-weight: 700; box-shadow: var(--shadow-lg); animation: rise .3s var(--ease); max-width: calc(100% - 32px); text-align: center; }
.loading-over { position: fixed; inset: 0; z-index: 350; display: grid; place-items: center; background: rgba(243,241,251,.6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.loading-over .box { padding: 26px 34px; border-radius: 24px; text-align: center; }
.loading-over .spinner { width: 42px; height: 42px; border-width: 4px; border-color: rgba(74,59,143,.15); border-top-color: var(--purple); margin: 0 auto 12px; }

.watermark { position: absolute; inset: 0; pointer-events: none; overflow: hidden; border-radius: inherit; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='160'%3E%3Ctext x='20' y='95' font-family='Cairo,sans-serif' font-size='20' font-weight='800' fill='%234a3b8f' transform='rotate(-18 160 80)'%3Emonafeseen.pages.dev%3C/text%3E%3C/svg%3E"); }

.qr-box { display: grid; place-items: center; padding: 14px; background: #fff; border-radius: 18px; width: fit-content; margin: 0 auto; }
.share-url { direction: ltr; font-size: 13px; word-break: break-all; padding: 10px 12px; border-radius: 12px; background: rgba(74,59,143,.06); font-family: monospace; }

.footer { text-align: center; color: var(--ink-3); font-size: 13px; padding: 10px 16px 30px; }
.footer b { color: var(--ink-2); }

/* ---------- ورق الطباعة (خارج الشاشة) ---------- */
.paper-host { position: fixed; left: -99999px; top: 0; z-index: -1; }

/* ---------- الجوال ---------- */
@media (max-width: 640px) {
  .topbar { padding: 8px 10px 8px 12px; gap: 8px; top: 8px; }
  .brand-sub { display: none; }
  .brand-name { font-size: 18px; }
  .brand-mark span { width: 18px; height: 18px; font-size: 11px; border-radius: 6px; }
  .role-chip { font-size: 13px; padding: 4px 6px 4px 10px; white-space: nowrap; }
  .role-chip i { font-size: 15px; }
  .hero { padding-top: 10px; }
  .hero-art { display: none; }
  .hero p.lead { font-size: 16px; }
  .card { padding: 18px; }
  .page-head { padding: 16px; gap: 12px; }
  .page-head .ic { width: 48px; height: 48px; font-size: 24px; }
  .step { padding-right: 0; }
  .step::before { position: static; display: inline-grid; margin-bottom: 6px; width: 28px; height: 28px; }
  .step h4 { line-height: 1.6; }
  .tree { max-height: 380px; }
  .tree .kids { padding-right: 12px; margin-right: 8px; }
  .exam-q { padding: 18px; }
  .exam-q .q-text { font-size: 18px; }
  .navgrid { grid-template-columns: repeat(8, 1fr); }
  .role-card p { min-height: 0; }
  .btn.lg { padding: 12px 18px; font-size: 16px; width: 100%; }
  .present { padding: 14px; }
  .present-foot .row { width: 100%; }
  .present-foot .row .btn { flex: 1; }
}

/* ---------- الأيقونات ---------- */
svg.i { flex: none; display: inline-block; vertical-align: middle; }
.tab svg.i, .chip svg.i { opacity: .85; }
.eyebrow svg.i { margin-left: 2px; }
.big-ic { width: 84px; height: 84px; margin: 0 auto; border-radius: 26px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--purple-2), var(--purple)); box-shadow: 0 14px 30px -12px rgba(74,59,143,.6); }
.present .big-ic { width: 100px; height: 100px; }
.go-ic { margin-right: auto; color: var(--ink-3); display: grid; }
.brand-mark span svg.i { width: 13px; height: 13px; }
.info-card .ic, .page-head .ic, .role-card .ic { color: #fff; }
.info-card h3 { display: flex; align-items: center; gap: 6px; }
h3 svg.i { color: var(--purple-2); }

/* ---------- الصفحة الرئيسية المختصرة ---------- */
.hero-min { display: block; text-align: center; padding: 40px 8px 26px; }
.hero-min h1 { font-size: clamp(44px, 7vw, 76px); line-height: 1.2; }
.hero-min .lead { margin: 8px auto 0; font-size: 19px; }
.roles { margin-top: 22px; }
.role-card { text-align: center; padding: 34px 20px 30px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.role-card .ic { width: 84px; height: 84px; border-radius: 26px; margin: 0; box-shadow: 0 16px 30px -14px rgba(46,33,110,.55); }
.role-card h3 { font-size: 24px; }

/* ---------- العدّاد ---------- */
.countdown { padding: 20px 22px; max-width: 1000px; margin: 0 auto; }
.cd-head { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--purple); font-size: 17px; margin-bottom: 14px; }
.cd-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.cd-item { background: rgba(255,255,255,.62); border: 1px solid var(--glass-border); border-radius: 20px; padding: 14px 12px; text-align: center; }
.cd-grade { font-weight: 800; font-size: 16px; }
.cd-date { font-size: 13px; color: var(--ink-3); font-weight: 700; margin-bottom: 10px; }
.cd-body { display: flex; justify-content: center; gap: 8px; min-height: 58px; align-items: center; }
.cd-u { min-width: 54px; padding: 6px 4px; border-radius: 14px; background: linear-gradient(160deg, var(--purple-2), var(--purple)); color: #fff; }
.cd-u b { display: block; font-size: 22px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.cd-u span { font-size: 11px; opacity: .85; }
.cd-item:nth-child(2) .cd-u { background: linear-gradient(160deg, #5cc3d4, var(--teal)); }
.cd-item:nth-child(3) .cd-u { background: linear-gradient(160deg, #f7b26b, var(--orange)); }
.cd-state { font-weight: 800; color: var(--ink-3); font-size: 14px; padding: 8px 12px; border-radius: 12px; background: rgba(74,59,143,.06); }
.cd-state.live { color: #fff; background: var(--green); animation: pulse 1.6s infinite; }
@media (max-width: 760px) { .cd-grid { grid-template-columns: 1fr; } }

/* ---------- حقائق مختصرة ---------- */
.facts { display: flex; flex-wrap: wrap; gap: 10px; }
.facts span { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 14px; font-weight: 700;
  background: rgba(255,255,255,.7); border: 1px solid var(--glass-border); box-shadow: var(--shadow); }
.facts svg.i { color: var(--purple-2); }

/* ---------- التذييل ---------- */
.footer a { color: var(--purple-2); font-weight: 700; }
/* بطاقة التذييل: زجاجية بإطار متدرّج يدور ببطء، وترتفع قليلاً عند المرور */
@property --fa { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.footer-card { position: relative; display: inline-block; max-width: 760px; margin: 6px auto 0; padding: 16px 26px 14px;
  border-radius: 22px; background: rgba(255,255,255,.62); -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%);
  color: var(--ink-2); font-weight: 600; font-size: 13.5px; line-height: 1.9;
  box-shadow: 0 8px 26px -14px rgba(46,33,110,.35); transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
.footer-card::before { content: ""; position: absolute; inset: 0; padding: 1.5px; border-radius: inherit; pointer-events: none;
  background: conic-gradient(from var(--fa), var(--teal), var(--purple-2), var(--orange), var(--green), var(--teal));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: .55; animation: fa-spin 8s linear infinite; transition: opacity .45s; }
.footer-card:hover { transform: translateY(-4px) scale(1.012); box-shadow: 0 22px 44px -18px rgba(46,33,110,.45); }
.footer-card:hover::before { opacity: 1; animation-duration: 3s; }
.footer-card p { margin: 0; }
.footer-card b { color: var(--ink); }
.footer-school { margin-top: 8px; padding-top: 8px; border-top: 1px dashed rgba(74,59,143,.18); font-weight: 800; font-size: 16px; letter-spacing: .2px;
  background: linear-gradient(90deg, var(--purple), var(--teal), var(--green)); -webkit-background-clip: text; background-clip: text; color: transparent; }
@keyframes fa-spin { to { --fa: 360deg; } }
@media (prefers-reduced-motion: reduce) { .footer-card::before { animation: none; } .footer-card:hover { transform: none; } }

/* الانتقال من شاشة التحميل */
body.booting #app, body.booting #top, body.booting .footer { opacity: 0; animation: boot-failsafe 0s 15s forwards; }
@keyframes boot-failsafe { to { opacity: 1; } }
body.booted #top { animation: rise .7s var(--ease) both; }
body.booted #app { animation: rise .8s .08s var(--ease) both; }
body.booted .footer { animation: rise .8s .16s var(--ease) both; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: 18px 50%, 13px 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-left: 34px; cursor: pointer; }
.cd-prev { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--stroke); font-size: 11.5px; color: var(--ink-3); font-weight: 600; line-height: 1.6; }
.cd-state.wait { color: var(--purple); background: rgba(106,88,196,.1); }
.cd-prev b, .cd-prev span { display: block; unicode-bidi: plaintext; }
.cd-prev b { color: var(--ink-2); }
.cd-date { unicode-bidi: plaintext; }
