/* ==========================================================================
   ثلاثة الأصول — ملف التنسيق الرئيسي
   الألوان: الأخضر والأبيض  |  الوضعان: النهاري والليلي
   ========================================================================== */

/* ---------- 1. المتغيرات ---------- */
:root {
  --green-950: #04241a;
  --green-900: #063a29;
  --green-800: #075537;
  --green-700: #0a6b45;
  --green-600: #0e8253;
  --green-500: #12a06a;
  --green-400: #35bd89;
  --green-100: #d9f2e6;
  --green-50: #edf9f3;
  --gold: #c8a44d;
  --gold-soft: #f0d79a;
  --gold-deep: #8a6a12;
  --gold-bright: #f3d98b;

  --bg: #f5fbf8;
  --bg-alt: #eaf7f1;
  --surface: #ffffff;
  --surface-2: #f2faf6;
  --text: #0d2019;
  --text-soft: #3f6355;
  --muted: #618577;
  --line: #d6ebe0;
  --accent: var(--green-700);
  --accent-soft: var(--green-100);
  --on-accent: #ffffff;
  --shadow-sm: 0 2px 10px rgba(6, 58, 41, .07);
  --shadow-md: 0 12px 30px rgba(6, 58, 41, .10);
  --shadow-lg: 0 26px 60px rgba(6, 58, 41, .16);
  --ring: 0 0 0 4px rgba(18, 160, 106, .28);

  --grad-title: linear-gradient(120deg, var(--green-800) 0%, var(--green-500) 55%, var(--green-700) 100%);
  --grad-brand: linear-gradient(135deg, var(--green-600) 0%, var(--green-800) 100%);

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;
  --r-pill: 999px;

  --header-h: 68px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --t-fast: .18s var(--ease);
  --t: .32s var(--ease);
  --t-slow: .6s var(--ease);

  --font-body: "Noto Naskh Arabic", "Segoe UI", Tahoma, "Geeza Pro", "Arabic Typesetting",
    "Traditional Arabic", system-ui, -apple-system, sans-serif;
  --font-display: "Cairo", "Tajawal", "Noto Kufi Arabic", "Segoe UI", Tahoma, "Geeza Pro", system-ui, sans-serif;
}

[data-theme="dark"] {
  --bg: #04120c;
  --bg-alt: #072018;
  --surface: #0a2119;
  --surface-2: #0d2a20;
  --text: #e8f6ef;
  --text-soft: #bcdcca;
  --muted: #8fb9a7;
  --line: #17402f;
  --accent: #3ecf9a;
  --accent-soft: #0d3a2a;
  --on-accent: #04241a;
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, .40);
  --shadow-md: 0 14px 34px rgba(0, 0, 0, .48);
  --shadow-lg: 0 28px 64px rgba(0, 0, 0, .58);
  --ring: 0 0 0 4px rgba(62, 207, 154, .30);
  --grad-title: linear-gradient(120deg, #7ef0c0 0%, #ffffff 45%, #35bd89 100%);
  --grad-brand: linear-gradient(135deg, #0e8253 0%, #052e20 100%);
}

/* ---------- 2. الأساس ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 18px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(1.02rem, .96rem + .28vw, 1.16rem);
  line-height: 1.95;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  min-height: 100vh;
  animation: page-in .5s var(--ease) both;
  transition: background-color var(--t), color var(--t);
}

body.leaving { opacity: 0; transform: translateY(-10px) scale(.995); transition: opacity .26s var(--ease), transform .26s var(--ease); }

@keyframes page-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.35;
  margin: 0 0 .5em;
  letter-spacing: -.01em;
}

h1 { font-size: clamp(2.1rem, 1.3rem + 4vw, 4.1rem); }
h2 { font-size: clamp(1.55rem, 1.15rem + 1.9vw, 2.5rem); }
h3 { font-size: clamp(1.15rem, 1rem + .7vw, 1.5rem); }
p  { margin: 0 0 1.1em; }

a { color: var(--accent); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--green-500); }
img { max-width: 100%; display: block; }
ul, ol { margin: 0 0 1.1em; padding-inline-start: 1.4em; }
li { margin-bottom: .45em; }
li::marker { color: var(--accent); }

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--r-sm);
}

::selection { background: var(--accent); color: var(--on-accent); }

/* ---------- 3. أدوات مساعدة ---------- */
.container { width: min(1180px, 100% - 2.2rem); margin-inline: auto; }
.container-narrow { width: min(880px, 100% - 2.2rem); margin-inline: auto; }
.section { padding-block: clamp(2.6rem, 1.6rem + 3.4vw, 5rem); }
.center { text-align: center; }
.lead { font-size: clamp(1.06rem, 1rem + .45vw, 1.32rem); color: var(--text-soft); }
.muted { color: var(--muted); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* عنوان عريض جذّاب */
.headline {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 1.1rem + 3.6vw, 3.6rem);
  line-height: 1.28;
  background: var(--grad-title);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0 0 .35em;
}

.section-title { position: relative; display: inline-block; margin-bottom: 1.2rem; }
.section-title::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  bottom: -.45em;
  width: 74px; height: 5px;
  border-radius: var(--r-pill);
  background: var(--grad-brand);
}
.section-title.centered { display: block; text-align: center; }
.section-title.centered::after { left: 50%; transform: translateX(-50%); }

.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid var(--line);
  padding: .42rem 1rem; border-radius: var(--r-pill);
  font-weight: 700; font-size: .92rem; margin-bottom: 1rem;
}

/* أزرار */
.btn {
  --btn-bg: var(--grad-brand);
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  padding: .85rem 1.6rem;
  border: 0; border-radius: var(--r-pill);
  background: var(--btn-bg); color: var(--on-accent);
  font-family: var(--font-display); font-weight: 700; font-size: 1rem;
  cursor: pointer; box-shadow: var(--shadow-sm);
  transition: transform var(--t-fast), box-shadow var(--t), filter var(--t-fast);
  position: relative; overflow: hidden;
}
.btn:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); color: var(--on-accent); filter: brightness(1.06); }
.btn:active { transform: translateY(-1px) scale(.99); }
.btn-ghost {
  background: transparent; color: var(--accent);
  border: 2px solid var(--accent); box-shadow: none;
}
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent); }
.btn-light { background: rgba(255,255,255,.95); color: var(--green-800); }
[data-theme="dark"] .btn-light { background: #e9f7f0; color: var(--green-900); }
.btn-row { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; margin-top: 1.8rem; }

/* ---------- 4. شريط تقدّم القراءة ---------- */
.progress {
  position: fixed; inset-block-start: 0; inset-inline: 0;
  height: 4px; background: transparent; z-index: 90; pointer-events: none;
}
.progress span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--green-500), var(--gold-soft), var(--green-600));
  border-radius: 0 var(--r-pill) var(--r-pill) 0;
  box-shadow: 0 0 12px rgba(18,160,106,.55);
  transition: width .1s linear;
}

/* ---------- 5. الترويسة ---------- */
.header {
  position: sticky; top: 0; z-index: 80;
  height: var(--header-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow var(--t), background-color var(--t), border-color var(--t);
}
.header.scrolled { box-shadow: var(--shadow-sm); }
.header .container { display: flex; align-items: center; gap: 1rem; justify-content: space-between; }

.brand { display: flex; align-items: center; gap: .7rem; color: var(--text); font-weight: 800; }
.brand:hover { color: var(--text); }
.brand img { width: 40px; height: 40px; border-radius: 12px; box-shadow: var(--shadow-sm); transition: transform var(--t); }
.brand:hover img { transform: rotate(-6deg) scale(1.06); }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text b { font-family: var(--font-display); font-size: 1.06rem; }
.brand-text small { color: var(--muted); font-size: .74rem; font-weight: 500; }

.nav { display: flex; align-items: center; gap: .25rem; }
.nav a {
  padding: .5rem .9rem; border-radius: var(--r-pill);
  color: var(--text-soft); font-weight: 600; font-size: .98rem;
  transition: background-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.nav a:hover { background: var(--accent-soft); color: var(--accent); transform: translateY(-1px); }
.nav a[aria-current="page"] { background: var(--grad-brand); color: var(--on-accent); }

.header-tools { display: flex; align-items: center; gap: .5rem; }

.icon-btn {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: var(--r-pill); border: 1px solid var(--line);
  background: var(--surface); color: var(--text-soft); cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t), background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.icon-btn:hover { transform: translateY(-2px) rotate(-8deg); color: var(--accent); border-color: var(--accent); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }

.nav-toggle { display: none; }

/* ---------- 6. البطل (الصفحة الرئيسية) ---------- */
.hero {
  position: relative;
  min-height: min(88vh, 820px);
  display: grid; place-items: center;
  text-align: center;
  padding: clamp(3rem, 2rem + 5vw, 6rem) 0;
  overflow: hidden;
  isolation: isolate;
}
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media img {
  width: 100%; height: 100%; object-fit: cover;
  animation: hero-zoom 16s var(--ease) both;
}
@keyframes hero-zoom { from { transform: scale(1.1); } to { transform: scale(1); } }
.hero-media::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(4,36,26,.80) 0%, rgba(6,58,41,.86) 45%, rgba(4,36,26,.94) 100%),
    radial-gradient(120% 80% at 50% 0%, rgba(18,160,106,.45), transparent 60%);
}
.hero-inner { color: #fff; max-width: 900px; }
.hero h1 { color: #fff; text-shadow: 0 10px 40px rgba(0,0,0,.45); margin-bottom: .35em; margin-top: 0; }
.hero h1 .accent { color: var(--gold-soft); }
.hero .lead { color: rgba(255,255,255,.9); max-width: 44ch; margin-inline: auto; }
.hero .eyebrow { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.28); backdrop-filter: blur(6px); }
/* زر شفاف فوق خلفية داكنة */
.hero .btn-ghost {
  color: #fff;
  border-color: rgba(255,255,255,.65);
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(6px);
}
.hero .btn-ghost:hover {
  background: rgba(255,255,255,.2);
  color: #fff;
  border-color: #fff;
}
.hero-badges { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: 1.6rem; }

/* السؤال والجواب في الواجهة */
.hero-question {
  margin: 1.5rem auto .6rem;
  max-width: 52ch;
  font-family: var(--font-display);
  font-size: clamp(1rem, .94rem + .5vw, 1.22rem);
  font-weight: 600;
  color: rgba(255, 255, 255, .92);
  line-height: 1.9;
}
.hero-answer {
  /* يناسب حجم الكتابة تماماً */
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, .95rem + .6vw, 1.35rem);
  font-weight: 800;
  line-height: 1.9;
  color: #ffffff;
  padding: .8rem 1.4rem;
  border-radius: var(--r-lg);
  background: linear-gradient(150deg, rgba(8, 58, 41, .82) 0%, rgba(4, 36, 26, .88) 100%);
  border: 2px solid rgba(200, 164, 77, .55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .14),
    0 10px 30px rgba(0, 0, 0, .3);
  backdrop-filter: blur(8px);
  position: relative;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.hero-answer .hz { color: var(--gold-soft, #f0d79a); }
[data-theme="dark"] .hero-answer {
  color: #ffffff;
  background: linear-gradient(150deg, rgba(4, 30, 22, .92) 0%, rgba(3, 20, 15, .94) 100%);
  border-color: rgba(200, 164, 77, .45);
}
.hero-answer:hover {
  transform: translateY(-4px);
  border-color: rgba(240, 215, 154, .8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .2),
    0 16px 40px rgba(0, 0, 0, .38);
}
[data-theme="dark"] .hero-answer:hover { border-color: rgba(240, 215, 154, .75); }
/* بدون أسهم في الطرفين — الإطار بسيط يناسب النص فقط */
.hero-answer::before,
.hero-answer::after { content: none; }
.hero-badges > span {
  padding: .45rem 1.05rem; border-radius: var(--r-pill);
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.26);
  font-weight: 700; font-size: .92rem; backdrop-filter: blur(6px);
  transition: transform var(--t-fast), background-color var(--t-fast);
}
.hero-badges > span:hover { transform: translateY(-3px); background: rgba(255,255,255,.22); }
.scroll-hint {
  position: absolute; inset-block-end: 1.4rem; inset-inline-start: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.8); font-size: .82rem;
  display: grid; justify-items: center; gap: .3rem;
}
.scroll-hint i {
  width: 22px; height: 34px; border: 2px solid rgba(255,255,255,.55); border-radius: var(--r-pill);
  position: relative;
}
.scroll-hint i::after {
  content: ""; position: absolute; inset-inline-start: 50%; top: 7px;
  width: 4px; height: 7px; border-radius: 2px; background: #fff;
  transform: translateX(-50%); animation: dot 1.8s var(--ease) infinite;
}
@keyframes dot { 0%,100% { opacity: 0; transform: translate(-50%, 0); } 40% { opacity: 1; transform: translate(-50%, 8px); } }

/* ---------- 7. بطاقات الأصول ---------- */
.cards { display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fit, minmax(275px, 1fr)); }

.card {
  position: relative; display: flex; flex-direction: column; gap: .7rem;
  padding: 2rem 1.7rem 1.8rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  text-decoration: none; color: var(--text); overflow: hidden;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t), background-color var(--t);
}
.card::before {
  content: ""; position: absolute; inset-block-start: 0; inset-inline: 0; height: 5px;
  background: var(--grad-brand);
  transform: scaleX(0); transform-origin: right;
  transition: transform var(--t-slow);
}
.card:hover, .card:focus-visible {
  transform: translateY(-9px);
  box-shadow: var(--shadow-lg);
  border-color: var(--green-400);
  color: var(--text);
}
.card:hover::before, .card:focus-visible::before { transform: scaleX(1); }

.card-icon {
  width: 74px; height: 74px; border-radius: 22px;
  display: grid; place-items: center; margin-bottom: .3rem;
  background: var(--accent-soft); color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform var(--t), background-color var(--t), color var(--t);
}
.card-icon svg { width: 38px; height: 38px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.card:hover .card-icon {
  transform: translateY(-4px) rotate(-7deg) scale(1.06);
  background: var(--grad-brand); color: var(--on-accent);
}
.card-num {
  position: absolute; inset-block-start: 1.2rem; inset-inline-end: 1.6rem;
  font-family: var(--font-display); font-size: 2.4rem; font-weight: 800;
  color: var(--accent); opacity: .16; line-height: 1;
  transition: opacity var(--t), transform var(--t);
}
.card:hover .card-num { opacity: .32; transform: scale(1.12); }
.card h3 { margin: 0; }
.card p { margin: 0; color: var(--text-soft); font-size: 1rem; line-height: 1.85; }
.card-cta {
  margin-top: auto; padding-top: .9rem;
  display: inline-flex; align-items: center; gap: .45rem;
  color: var(--accent); font-weight: 700;
}
.card-cta svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--t-fast); }
.card:hover .card-cta svg { transform: translateX(-6px); }

/* ---------- 7ب. الإطار الذهبي حول الأصول الثلاثة ---------- */
.cards-frame {
  position: relative;
  margin-top: 2.4rem;
  padding: clamp(1.1rem, .5rem + 1.6vw, 1.9rem);
  border-radius: calc(var(--r-lg) + 12px);
  background:
    linear-gradient(160deg, rgba(240, 215, 154, .16) 0%, rgba(200, 164, 77, .06) 45%, rgba(240, 215, 154, .12) 100%);
  border: 2px solid rgba(200, 164, 77, .55);
  box-shadow:
    0 0 0 6px rgba(200, 164, 77, .08),
    0 24px 56px rgba(6, 58, 41, .18),
    inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: border-color var(--t), box-shadow var(--t);
}
.cards-frame:hover {
  border-color: rgba(200, 164, 77, .85);
  box-shadow:
    0 0 0 7px rgba(200, 164, 77, .12),
    0 28px 64px rgba(6, 58, 41, .24),
    inset 0 1px 0 rgba(255, 255, 255, .45);
}
/* زوايا مزخرفة */
.frame-corner {
  position: absolute;
  width: 26px; height: 26px;
  border: 3px solid var(--gold);
  opacity: .9;
  transition: opacity var(--t), width var(--t), height var(--t);
}
.cards-frame:hover .frame-corner { opacity: 1; width: 30px; height: 30px; }
.frame-corner.tl { top: 10px; inset-inline-start: 10px; border-inline-end: 0; border-block-end: 0; border-start-start-radius: 12px; }
.frame-corner.tr { top: 10px; inset-inline-end: 10px; border-inline-start: 0; border-block-end: 0; border-start-end-radius: 12px; }
.frame-corner.bl { bottom: 10px; inset-inline-start: 10px; border-inline-end: 0; border-block-start: 0; border-end-start-radius: 12px; }
.frame-corner.br { bottom: 10px; inset-inline-end: 10px; border-inline-start: 0; border-block-start: 0; border-end-end-radius: 12px; }

/* وضع ليلي */
[data-theme="dark"] .cards-frame {
  background:
    linear-gradient(160deg, rgba(240, 215, 154, .13) 0%, rgba(200, 164, 77, .05) 45%, rgba(240, 215, 154, .1) 100%);
  border-color: rgba(200, 164, 77, .5);
  box-shadow:
    0 0 0 6px rgba(200, 164, 77, .06),
    0 24px 56px rgba(0, 0, 0, .45),
    inset 0 1px 0 rgba(255, 255, 255, .08);
}
[data-theme="dark"] .cards-frame:hover {
  border-color: rgba(240, 215, 154, .8);
  box-shadow:
    0 0 0 7px rgba(200, 164, 77, .1),
    0 28px 64px rgba(0, 0, 0, .55),
    inset 0 1px 0 rgba(255, 255, 255, .12);
}
[data-theme="dark"] .frame-corner { border-color: var(--gold-soft); }

/* البطاقات داخل الإطار: بلا حدّ منفرد لتظهر الحدود unified */
.cards-frame .cards { margin-top: 0; }
.cards-frame .card {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(4px);
}
[data-theme="dark"] .cards-frame .card { background: rgba(10, 46, 35, .78); }
.cards-frame .card::before { background: linear-gradient(90deg, var(--gold-soft), var(--gold), var(--gold-soft)); }

/* ---------- 8. أقسام المحتوى ---------- */
.band { background: var(--bg-alt); border-block: 1px solid var(--line); }

.info-grid { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.info-item {
  padding: 1.5rem 1.4rem; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.info-item:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: var(--green-400); }
.info-item b { display: block; font-family: var(--font-display); font-size: 1.1rem; margin-bottom: .35rem; color: var(--green-700); }
[data-theme="dark"] .info-item b { color: var(--green-400); }

/* ---------- 9. ترويسة الصفحات الداخلية ---------- */
.page-head {
  position: relative; overflow: hidden; isolation: isolate;
  padding-block: clamp(2.6rem, 2rem + 3vw, 4.4rem);
  background: var(--grad-brand); color: #fff;
}
.page-head::after {
  content: ""; position: absolute; inset-block-start: -40%; inset-inline-end: -8%;
  width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.16), transparent 65%);
  z-index: -1;
}
.page-head h1 {
  color: var(--gold-bright, #f3d98b);
  margin-bottom: .3em;
  line-height: 1.9;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .38), 0 1px 3px rgba(0, 0, 0, .3);
}
/* رمز ﷺ وحده داخل العناوين: يحتاج ارتفاع سطر أكبر */
.page-head h1 .honorific {
  font-size: .72em;
  vertical-align: middle;
  line-height: 1;
  display: inline-block;
  margin-inline-start: .1em;
  white-space: nowrap;
}
.page-head .lead { color: rgba(255,255,255,.92); max-width: 60ch; }
[data-theme="dark"] .page-head h1 {
  color: var(--gold-soft, #f0d79a);
  text-shadow: 0 2px 16px rgba(0, 0, 0, .55);
}
.page-head .eyebrow { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.3); }
[data-theme="dark"] .page-head { background: var(--grad-brand); }
[data-theme="dark"] .page-head .lead { color: #d6ece1; }

.crumbs { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: .92rem; color: rgba(255,255,255,.85); margin-bottom: 1rem; }
.crumbs a { color: #fff; font-weight: 700; border-bottom: 1px dashed rgba(255,255,255,.6); }
.crumbs a:hover { color: var(--gold-soft); border-color: var(--gold-soft); }

/* زر العودة للرئيسية داخل ترويسة الصفحات */
.home-btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .6rem 1.15rem;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .32);
  color: #fff; font-family: var(--font-display); font-weight: 700; font-size: .95rem;
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .16);
  transition: transform var(--t), background-color var(--t), border-color var(--t), box-shadow var(--t);
}
.home-btn svg {
  width: 19px; height: 19px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2.1;
  stroke-linecap: round; stroke-linejoin: round;
  transition: transform var(--t);
}
.home-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, .22);
  border-color: rgba(255, 255, 255, .6);
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, .24);
}
.home-btn:hover svg { transform: translateX(4px) rotate(-12deg); }
.home-btn:active { transform: translateY(-1px) scale(.99); }

/* ---------- 10. محتوى الصفحة ---------- */
/* ---------- 8ب. مربعات المسائل الأربع ---------- */
.steps-lead {
  display: inline-grid; gap: .4rem;
  margin: 1.4rem auto 0; padding: 0; list-style: none;
  text-align: start;
  counter-reset: step;
}
.steps-lead li {
  position: relative; padding-inline-start: 2.1rem; margin: 0;
  color: var(--text-soft); font-size: 1.04rem; line-height: 1.95;
}
.steps-lead li::before {
  counter-increment: step; content: counter(step);
  position: absolute; inset-inline-start: 0; inset-block-start: .28em;
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--grad-brand); color: var(--on-accent);
  font-size: .82rem; font-weight: 800; font-family: var(--font-display);
}
.steps-lead b { color: var(--accent); font-family: var(--font-display); }

.masafiq {
  display: grid; gap: 1.3rem; margin-top: 2.4rem;
  position: relative;
  padding: clamp(1.1rem, .5rem + 1.6vw, 1.9rem);
  border-radius: calc(var(--r-lg) + 12px);
  background: linear-gradient(160deg, rgba(240,215,154,.15) 0%, rgba(200,164,77,.05) 45%, rgba(240,215,154,.11) 100%);
  border: 2px solid rgba(200, 164, 77, .55);
  box-shadow:
    0 0 0 6px rgba(200, 164, 77, .08),
    0 24px 56px rgba(6, 58, 41, .18),
    inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: border-color var(--t), box-shadow var(--t);
}
.masafiq:hover {
  border-color: rgba(200, 164, 77, .85);
  box-shadow:
    0 0 0 7px rgba(200, 164, 77, .12),
    0 28px 64px rgba(6, 58, 41, .24),
    inset 1px 0 0 rgba(255, 255, 255, .45);
}
/* زوايا ذهبية مزخرفة */
.masafiq::before, .masafiq::after {
  content: ""; position: absolute;
  width: 26px; height: 26px;
  border: 3px solid var(--gold);
  opacity: .9;
  transition: opacity var(--t), width var(--t), height var(--t);
}
.masafiq::before {
  top: 10px; inset-inline-start: 10px;
  border-inline-end: 0; border-block-end: 0;
  border-start-start-radius: 12px;
}
.masafiq::after {
  bottom: 10px; inset-inline-end: 10px;
  border-inline-start: 0; border-block-start: 0;
  border-end-end-radius: 12px;
}
.masafiq:hover::before, .masafiq:hover::after { opacity: 1; width: 30px; height: 30px; }

.masafa-card {
  position: relative;
  padding: 1.9rem 1.8rem 1.7rem;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t), background-color var(--t);
}
.masafa-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--green-400);
  background: var(--surface);
}
.masafa-num {
  position: absolute; inset-block-start: 1.1rem; inset-inline-end: 1.4rem;
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--gold-soft), var(--gold));
  color: var(--green-900, #04241a);
  font-family: var(--font-display); font-weight: 800; font-size: 1.2rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
}
.masafa-head { margin-bottom: .8rem; padding-inline-end: 3.6rem; }
.masafa-head h3 {
  margin: 0 0 .5rem; color: var(--accent);
  font-size: clamp(1.15rem, 1.02rem + .65vw, 1.5rem);
}
.masafa-tag {
  margin: 0 0 .3rem;
  font-size: .95rem; font-weight: 700;
  color: var(--gold-deep, #8a6a12);
}
.masafa-text { margin: 0; color: var(--text-soft); line-height: 2.05; }

[data-theme="dark"] .masafa-card { background: rgba(10, 46, 35, .8); }
[data-theme="dark"] .masafa-card:hover { background: rgba(16, 70, 52, .9); }
[data-theme="dark"] .masafiq {
  background: linear-gradient(160deg, rgba(240,215,154,.12) 0%, rgba(200,164,77,.04) 45%, rgba(240,215,154,.09) 100%);
  border-color: rgba(200, 164, 77, .5);
  box-shadow:
    0 0 0 6px rgba(200, 164, 77, .06),
    0 24px 56px rgba(0, 0, 0, .45),
    inset 0 1px 0 rgba(255, 255, 255, .08);
}
[data-theme="dark"] .masafiq:hover {
  border-color: rgba(240, 215, 154, .8);
  box-shadow:
    0 0 0 7px rgba(200, 164, 77, .1),
    0 28px 64px rgba(0, 0, 0, .55),
    inset 0 1px 0 rgba(255, 255, 255, .12);
}
[data-theme="dark"] .masafiq::before, [data-theme="dark"] .masafiq::after { border-color: var(--gold-soft); }
[data-theme="dark"] .masafa-head h3 { color: var(--green-400); }
[data-theme="dark"] .masafa-tag { color: var(--gold, #c8a44d); }
[data-theme="dark"] .masafa-text { color: var(--text-soft); }
[data-theme="dark"] .steps-lead b { color: var(--green-400); }
[data-theme="dark"] .steps-lead li { color: var(--text-soft); }

/* ---------- 9ب. رمز ﷺ باللون الذهبي في كل الصفحات ---------- */
.hz {
  color: var(--gold-deep, #8a6a12);
  font-weight: 700;
  white-space: nowrap;
}
/* يمنع انفصال الكلمة عن رمز ﷺ عند ضيق الشاشة */
.nw { white-space: nowrap; }
/* خلفيات داكنة: نحتاج ذهبياً أفتح ليظهر */
[data-theme="dark"] .hz,
body.page .hz,
.hero .hz,
.footer .hz,
.page-head .hz {
  color: var(--gold, #c8a44d);
  text-shadow: 0 1px 8px rgba(0, 0, 0, .35);
}
/* البطاقات ذات الخلفية الفاتحة في الوضع النهاري */
.card .hz,
.info-item .hz,
.list-cards .hz,
.pager .hz,
.quiz-card .hz,
.nav .hz,
.brand-text .hz {
  color: var(--gold-deep, #8a6a12);
}
[data-theme="dark"] .card .hz,
[data-theme="dark"] .info-item .hz,
[data-theme="dark"] .list-cards .hz,
[data-theme="dark"] .pager .hz,
[data-theme="dark"] .nav .hz,
[data-theme="dark"] .brand-text .hz {
  color: var(--gold, #c8a44d);
}

/* ---------- 10. محتوى الصفحة (خلفية أخضر داكنة دائماً لإبراز النص) ---------- */
body.page {
  --bg: #05201a;
  --bg-alt: #04281f;
  --surface: #0a2e23;
  --surface-2: #0d382b;
  --text: #eafaf3;
  --text-soft: #c3e6d6;
  --muted: #9bc9b6;
  --line: #17503c;
  --accent: #45d7a1;
  --accent-soft: #0e3b2c;
  --on-accent: #04241a;
  --ring: 0 0 0 4px rgba(69, 215, 161, .32);
  --grad-title: linear-gradient(120deg, #8af0c6 0%, #ffffff 50%, #45d7a1 100%);
  --grad-brand: linear-gradient(135deg, #10875a 0%, #052a1f 100%);
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, .40);
  --shadow-md: 0 14px 34px rgba(0, 0, 0, .48);
  --shadow-lg: 0 28px 64px rgba(0, 0, 0, .58);
  color-scheme: dark;
}
.prose {
  padding-block: clamp(2.2rem, 1.6rem + 2vw, 3.6rem);
  background:
    radial-gradient(90% 45% at 50% 0%, rgba(16, 135, 90, .22), transparent 70%),
    linear-gradient(180deg, #05201a 0%, #041c15 100%);
  background-attachment: fixed;
}
.prose section + section { margin-top: 2.6rem; }

.summary {
  position: relative;
  padding: 1.9rem 1.8rem;
  border-radius: var(--r-lg);
  background: linear-gradient(150deg, #0e3b2c 0%, #0a2e23 100%);
  border: 1px solid rgba(69, 215, 161, .38);
  border-inline-start: 7px solid var(--accent);
  box-shadow: var(--shadow-md);
  margin-bottom: 2.6rem;
}
.summary h2 { font-size: clamp(1.3rem, 1.1rem + .8vw, 1.7rem); margin-bottom: .6rem; display: flex; align-items: center; gap: .55rem; color: var(--gold-soft); }
.summary h2 svg { width: 26px; height: 26px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
/* عنوان داخل الملخّص */
.summary .summary-title {
  font-family: var(--font-display);
  font-size: clamp(1.12rem, 1rem + .55vw, 1.42rem);
  font-weight: 800;
  color: var(--gold);
  line-height: 1.7;
  margin: .2rem 0 1rem;
  padding-bottom: .7rem;
  border-bottom: 1px solid rgba(200, 164, 77, .35);
  text-shadow: 0 2px 12px rgba(0, 0, 0, .3);
}
.summary p { margin: 0 0 1em; font-size: 1.08rem; line-height: 2.05; color: #dcf3e8; }
.summary p:last-child { margin-bottom: 0; }

.prose h2 {
  margin-bottom: .9rem;
  color: var(--gold-soft);
  text-shadow: 0 2px 12px rgba(0, 0, 0, .35);
}
.prose h3 { color: var(--green-400); margin-top: 1.8rem; }
.prose p { color: #d5eee2; }
.prose ul { padding-inline-start: 0; list-style: none; }
.prose ol { padding-inline-start: 1.3em; }
.prose ul li {
  position: relative; padding-inline-start: 2rem; margin-bottom: .7rem;
  color: #d5eee2;
}
.prose ul li::before {
  content: ""; position: absolute; inset-inline-start: .35rem; inset-block-start: .78em;
  width: 9px; height: 9px; border-radius: 3px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--gold) 100%);
  transform: rotate(45deg);
}
.list-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); margin-bottom: 1.2rem; }
.list-cards > div {
  padding: 1.25rem 1.3rem; border-radius: var(--r-md);
  background: rgba(13, 56, 43, .72); border: 1px solid var(--line);
  color: #d5eee2;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t), background-color var(--t);
}
.list-cards > div:hover {
  transform: translateY(-6px); box-shadow: var(--shadow-md);
  border-color: var(--green-400); background: rgba(16, 70, 52, .8);
}
.list-cards b { display: block; font-family: var(--font-display); color: var(--accent); margin-bottom: .3rem; }

.note {
  padding: 1.4rem 1.5rem; border-radius: var(--r-md);
  background: rgba(14, 59, 44, .8); border: 1px dashed rgba(200, 164, 77, .5);
  color: #dcf3e8;
  margin: 1.6rem 0;
}
.note b { font-family: var(--font-display); color: var(--gold-soft); }
/* مربع الفائدة: عنوان + نص */
.note-label {
  display: inline-block;
  padding: .28rem .85rem; margin-bottom: .85rem;
  border-radius: var(--r-pill);
  background: linear-gradient(140deg, var(--gold-soft), var(--gold));
  color: var(--green-900, #04241a);
  font-family: var(--font-display); font-weight: 800; font-size: .88rem;
  letter-spacing: .02em;
}
.note .note-text {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.06rem, 1rem + .45vw, 1.28rem);
  font-weight: 600;
  line-height: 2.15;
  color: var(--gold-soft);
  text-align: center;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .3);
}
.reflect {
  padding: 1.6rem 1.7rem; border-radius: var(--r-lg);
  background: rgba(10, 46, 35, .8); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); margin-top: 1.4rem;
}
.reflect h3 { margin-top: 0; display: flex; align-items: center; gap: .5rem; color: var(--gold-soft); }
.reflect ol { margin-bottom: 0; }
.reflect li { color: #d5eee2; }

.pager { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); margin-top: 2.6rem; }
.pager a {
  display: flex; flex-direction: column; gap: .25rem;
  padding: 1.3rem 1.4rem; border-radius: var(--r-md);
  background: rgba(10, 46, 35, .8); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); color: var(--text);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t), background-color var(--t);
}
.pager a:hover { background: rgba(16, 70, 52, .85); }
.pager a:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: var(--green-400); color: var(--text); }
.pager a small { color: var(--muted); font-size: .84rem; font-weight: 700; }
.pager a b { font-family: var(--font-display); font-size: 1.12rem; }
.pager a.next { text-align: start; }
.pager .arrow { color: var(--accent); font-weight: 800; }

/* ---------- 11. زر العودة للأعلى ---------- */
.to-top {
  position: fixed; inset-block-end: 1.4rem; inset-inline-start: 1.4rem; z-index: 70;
  width: 50px; height: 50px; border-radius: var(--r-pill);
  display: grid; place-items: center; cursor: pointer;
  background: var(--grad-brand); color: var(--on-accent);
  border: 0; box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; transform: translateY(18px) scale(.85);
  transition: opacity var(--t), transform var(--t), visibility var(--t);
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { transform: translateY(-4px) scale(1.06); }
.to-top svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 12. التنبيه ---------- */
.toast {
  position: fixed; inset-block-end: 1.6rem; inset-inline-end: 1.6rem; z-index: 95;
  display: flex; align-items: center; gap: .6rem;
  padding: .9rem 1.3rem; border-radius: var(--r-pill);
  background: var(--green-800); color: #fff; font-weight: 700;
  box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(20px);
  transition: opacity var(--t), transform var(--t), visibility var(--t);
}
.toast.show { opacity: 1; visibility: visible; transform: none; }
.toast svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 12ب. نافذة شرح التثبيت ---------- */
.guide {
  position: fixed; inset-block-start: 50%; inset-inline-start: 50%;
  transform: translate(-50%, -50%);
  z-index: 99; width: min(420px, calc(100% - 2rem));
  padding: 1.8rem 1.7rem;
  border-radius: var(--r-lg);
  background: var(--surface); color: var(--text);
  border: 2px solid rgba(200, 164, 77, .5);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
  animation: card-rise .32s var(--ease) both;
}
.guide h3 {
  margin: 0 0 1rem; font-size: 1.2rem;
  color: var(--accent);
}
.guide ol { margin: 0 0 1.4rem; padding-inline-start: 1.3em; }
.guide li { margin-bottom: .55rem; line-height: 1.8; }
.guide li::marker { color: var(--accent); font-weight: 800; }
.guide-close {
  width: 100%; padding: .8rem;
  border: 0; border-radius: var(--r-pill);
  background: var(--grad-brand); color: var(--on-accent);
  font-family: var(--font-display); font-weight: 700; font-size: 1rem;
  cursor: pointer; transition: transform var(--t-fast), filter var(--t-fast);
}
.guide-close:hover { transform: translateY(-2px); filter: brightness(1.06); }
.guide-close:focus-visible { box-shadow: var(--ring); }

/* ---------- 13. التذييل ---------- */
.footer {
  margin-top: 2rem; padding-block: 2.6rem 2.2rem;
  background: var(--green-950); color: #cfe8dc;
  text-align: center;
}
.footer h3 { color: #fff; margin-bottom: .4rem; }
.footer p { color: #a8cdba; font-size: .98rem; }
.footer .btn-ghost { color: #fff; border-color: rgba(255,255,255,.55); }
.footer .btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.footer-links { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-top: 1.2rem; }
.footer-links a {
  padding: .45rem 1rem; border-radius: var(--r-pill);
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
  color: #dff1e8; font-size: .92rem; font-weight: 600;
  transition: transform var(--t-fast), background-color var(--t-fast);
}
.footer-links a:hover { transform: translateY(-3px); background: rgba(255,255,255,.18); color: #fff; }
.footer small { color: #8fb9a7; display: block; margin-top: 1.4rem; }

/* اعتماد التصميم */
.credit {
  display: flex; flex-direction: column; align-items: center; gap: .45rem;
  margin: 2rem auto 0; padding-top: 1.7rem;
  max-width: 420px;
}
.credit::before {
  content: ""; position: absolute;
}
.credit-rule {
  width: 54px; height: 2px; border-radius: var(--r-pill);
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
}
.credit-label {
  font-size: .84rem; color: #8fb9a7; letter-spacing: .02em;
}
.credit-name {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.05rem + .9vw, 1.6rem);
  font-weight: 800; color: var(--gold-soft);
  letter-spacing: .01em;
  text-shadow: 0 6px 22px rgba(240, 215, 154, .22);
  transition: transform var(--t), text-shadow var(--t);
}
.credit-name:hover {
  transform: translateY(-3px);
  text-shadow: 0 10px 28px rgba(240, 215, 154, .38);
}

/* ---------- 14. الاختبار ---------- */
.quiz-bar {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1.5rem;
}
.quiz-bar-track {
  flex: 1; height: 10px; border-radius: var(--r-pill);
  background: rgba(13, 56, 43, .9);
  border: 1px solid var(--line);
  overflow: hidden;
}
.quiz-bar-track span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--green-500), var(--gold));
  transition: width .45s var(--ease);
}
.quiz-bar-text {
  font-weight: 800; color: var(--gold-soft);
  white-space: nowrap; font-size: .95rem;
}

.quiz-card {
  padding: clamp(1.5rem, 1.1rem + 1.4vw, 2.4rem);
  border-radius: var(--r-lg);
  background: rgba(10, 46, 35, .82);
  border: 1px solid rgba(200, 164, 77, .3);
  box-shadow: var(--shadow-md);
  position: relative;
  animation: card-rise .45s var(--ease) both;
}
@keyframes card-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.quiz-card.shake { animation: shake .4s var(--ease); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  50% { transform: translateX(7px); }
  75% { transform: translateX(-4px); }
}

.quiz-qnum {
  position: absolute; inset-block-start: 1.1rem; inset-inline-end: 1.4rem;
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--gold-soft), var(--gold));
  color: var(--green-900);
  font-family: var(--font-display); font-weight: 800; font-size: 1.35rem;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .3);
}
.quiz-question {
  color: var(--gold-soft);
  font-size: clamp(1.2rem, 1.05rem + .8vw, 1.7rem);
  line-height: 1.8;
  margin: .3rem 0 1.6rem;
  padding-inline-end: 3.4rem;
}

.quiz-options { display: grid; gap: .75rem; }
.opt {
  display: flex; align-items: center; gap: .9rem;
  width: 100%; text-align: start;
  padding: 1rem 1.15rem;
  border-radius: var(--r-md);
  background: rgba(13, 56, 43, .7);
  border: 2px solid var(--line);
  color: #dff2e8;
  font-family: var(--font-body); font-size: 1.03rem; font-weight: 600;
  cursor: pointer;
  transition: transform var(--t-fast), border-color var(--t-fast), background-color var(--t-fast), opacity var(--t);
}
.opt:hover:not(.locked) {
  transform: translateX(-5px);
  border-color: var(--green-400);
  background: rgba(18, 70, 52, .85);
}
.opt:disabled { cursor: default; }
.opt-mark {
  width: 30px; height: 30px; flex: none;
  border-radius: 50%;
  border: 2px solid var(--green-400);
  display: grid; place-items: center;
  transition: all var(--t-fast);
}
.opt-mark::after {
  content: ""; width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); transform: scale(0);
  transition: transform var(--t-fast);
}
.opt.is-correct {
  border-color: #34d399;
  background: rgba(16, 90, 62, .6);
  color: #dcfff0;
}
.opt.is-correct .opt-mark { border-color: #34d399; background: #34d399; }
.opt.is-correct .opt-mark::after { transform: scale(1); }
.opt.is-correct .opt-mark::before {
  content: ""; position: absolute;
  width: 12px; height: 7px;
  border-inline-start: 2.5px solid #04241a;
  border-block-end: 2.5px solid #04241a;
  transform: rotate(-45deg) translate(1px, -2px);
  z-index: 2;
}
.opt.is-correct .opt-mark::after { transform: scale(0); }
.opt.is-wrong {
  border-color: #f87171;
  background: rgba(110, 30, 30, .45);
  color: #ffe2e2;
}
.opt.is-wrong .opt-mark { border-color: #f87171; background: #f87171; }
.opt.is-wrong .opt-mark::after { transform: scale(1); background: #fff; }
.opt.locked:not(.is-correct):not(.is-wrong) { opacity: .45; }

.quiz-feedback {
  margin-top: 1.4rem; padding: 1.1rem 1.3rem;
  border-radius: var(--r-md);
  background: rgba(6, 36, 26, .8);
  border-inline-start: 5px solid var(--accent);
  animation: card-rise .35s var(--ease) both;
}
.quiz-verdict { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; margin-bottom: .35rem; }
.quiz-verdict.ok { color: #4ade80; }
.quiz-verdict.bad { color: #fca5a5; }
.quiz-why { margin: 0; color: #cfe8dc; font-size: .98rem; line-height: 1.9; }

.quiz-nav { margin-top: 1.6rem; display: flex; justify-content: flex-end; }
/* زر السؤال التالي: خلفية بيضاء ونص أخضر داكن، على اليسار */
.quiz-nav .btn {
  background: #ffffff;
  color: var(--green-900, #04241a);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
}
.quiz-nav .btn:hover {
  background: #f2fbf6;
  color: var(--green-900, #04241a);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .34);
}

/* النتيجة */
.quiz-result {
  text-align: center;
  padding: clamp(1.8rem, 1.4rem + 1.6vw, 2.8rem);
  border-radius: var(--r-lg);
  background: rgba(10, 46, 35, .85);
  border: 2px solid rgba(200, 164, 77, .4);
  box-shadow: var(--shadow-lg);
  animation: card-rise .5s var(--ease) both;
}
.quiz-result.perfect { border-color: rgba(74, 222, 128, .55); }
.quiz-result.partial { border-color: rgba(200, 164, 77, .5); }

.result-ring { position: relative; width: 190px; height: 190px; margin: 0 auto 1.2rem; }
.result-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(13, 56, 43, .9); stroke-width: 11; }
.ring-fg {
  fill: none; stroke: url(#none); stroke: var(--gold);
  stroke-width: 11; stroke-linecap: round;
  transition: stroke-dashoffset 1.1s var(--ease);
}
.perfect .ring-fg { stroke: #34d399; }
.result-score {
  position: absolute; inset: 0;
  display: grid; place-content: center; text-align: center;
}
.result-score b {
  display: block;
  font-family: var(--font-display); font-size: 3.6rem; font-weight: 800;
  color: var(--gold-soft); line-height: 1;
}
.perfect .result-score b { color: #4ade80; }
.result-score span { color: var(--muted); font-size: .95rem; }

.result-title {
  color: var(--gold-soft);
  font-size: clamp(1.25rem, 1.05rem + 1vw, 1.85rem);
  margin-bottom: .5rem;
}
.result-text { color: #d5eee2; max-width: 52ch; margin-inline: auto; }
.result-actions {
  display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center;
  margin: 1.6rem 0 .4rem;
}
.result-actions .btn-ghost { color: var(--gold-soft); border-color: rgba(200, 164, 77, .5); }
.result-actions .btn-ghost:hover { background: rgba(200, 164, 77, .15); color: var(--gold-soft); }

/* مراجعة الأخطاء */
.quiz-review { margin-top: 2.6rem; }
.review-item {
  padding: 1.25rem 1.4rem; margin-bottom: 1rem;
  border-radius: var(--r-md);
  background: rgba(10, 46, 35, .78);
  border: 1px solid var(--line);
  border-inline-start: 5px solid #f87171;
}
.review-item h3 { font-size: 1.06rem; color: #fca5a5; margin-bottom: .5rem; }
.review-pick { color: #fca5a5; font-size: .96rem; margin-bottom: .25rem; }
.review-right { color: #86efac; font-weight: 700; margin-bottom: .35rem; }
.review-why { color: #cfe8dc; font-size: .96rem; margin: 0; }

/* بطاقة الاختبار في الرئيسية */
.card-quiz .card-icon { background: linear-gradient(140deg, rgba(200,164,77,.22), rgba(200,164,77,.08)); }

/* ---------- 14ب. ظهور تدريجي عند التمرير ---------- */
.reveal { opacity: 0; transform: translateY(26px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .6s var(--ease), transform .6s var(--ease); }

/* ---------- 15. الجوال ---------- */
@media (max-width: 860px) {
  :root { --header-h: 62px; }

  .nav {
    position: absolute; inset-inline: 0; inset-block-start: calc(100% + 1px);
    flex-direction: column; align-items: stretch; gap: .2rem;
    padding: .8rem 1.1rem 1.2rem;
    background: var(--surface); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    opacity: 0; visibility: hidden; transform: translateY(-12px);
    transition: opacity var(--t), transform var(--t), visibility var(--t);
  }
  .nav.open { opacity: 1; visibility: visible; transform: none; }
  .nav a { padding: .75rem 1rem; border-radius: var(--r-sm); }
  .nav-toggle { display: grid; }
  .nav-toggle .close { display: none; }
  .nav-toggle[aria-expanded="true"] .bars { display: none; }
  .nav-toggle[aria-expanded="true"] .close { display: block; }

  .hero { min-height: auto; padding-block: 4.4rem 4.8rem; }
  .scroll-hint { display: none; }
  .summary { padding: 1.5rem 1.25rem; border-inline-start-width: 5px; }
  .to-top { inset-block-end: 1rem; inset-inline-start: 1rem; width: 46px; height: 46px; }
  .toast { inset-inline: 1rem; inset-block-end: 1rem; justify-content: center; }
}

@media (max-width: 420px) {
  .brand-text small { display: none; }
  .btn { width: 100%; }
}

/* ---------- 16. تقليل الحركة ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* انتقال سلس بين الصفحات (Chrome) */
@view-transition { navigation: auto; }