/* ===== التربية الإسلامية مع الأستاذ عبد القادر يونس · Exams — brand tokens ===== */
/* الهوية من الكتاب واللوجو: كحلي (اللوجو/الزخرفة) + عنّابي (عنوان الكتاب) + ذهبي (الزخارف) */
:root {
  --cream: #F7F4EE;
  --cream-2: #EFEAE0;
  --paper: #FFFFFF;
  --ink: #1B2147;
  --ink-2: #4A5070;
  --muted: #8489A3;
  --line: #E6E1D6;

  --navy: #1B2147;
  --navy-2: #2E3A7A;
  --navy-soft: #E4E7F4;
  --plum: #B4386B;
  --plum-2: #D6558A;
  --plum-soft: #F9E1EB;
  --gold: #C39A3E;
  --gold-2: #E2BC5F;
  --gold-soft: #F8EED4;
  --purple: #7B4F9E;
  --purple-soft: #ECE4F7;
  --teal: #2F8F8A;
  --teal-soft: #DDF1EF;
  --red: #E0433C;
  --red-soft: #FDE3E1;
  --ok: #2E9E6B;
  --ok-soft: #DDF3E8;

  /* أسماء توافقية مع المحرّك (كانت برتقالي/وردي في النسخة الأصلية) */
  --orange: var(--plum);
  --orange-2: var(--plum-2);
  --orange-soft: var(--plum-soft);
  --pink: var(--gold);
  --pink-soft: var(--gold-soft);

  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 10px 30px rgba(27, 33, 71, 0.08);
  --shadow-lg: 0 24px 60px rgba(27, 33, 71, 0.14);

  --font-display: "Cairo", "Tahoma", sans-serif;
  --font-body: "Cairo", "Tahoma", sans-serif;
  --font-en: "Nunito", "Cairo", sans-serif;
  --font-quran: "Amiri", "Cairo", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 400px at 90% -10%, rgba(195, 154, 62, .18), transparent 60%),
    radial-gradient(500px 400px at -10% 30%, rgba(180, 56, 107, .10), transparent 60%),
    radial-gradient(500px 500px at 50% 110%, rgba(46, 58, 122, .10), transparent 60%);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.en { font-family: var(--font-en); direction: ltr; }
.container { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* ===== Nav ===== */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(247, 244, 238, .85);
  border-bottom: 1px solid var(--line);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 46px; height: 46px; border-radius: 14px;
  background: linear-gradient(135deg, var(--navy-2), var(--navy));
  display: grid; place-items: center; color: #fff;
  font-family: var(--font-display); font-weight: 800; font-size: 20px;
  box-shadow: 0 8px 18px rgba(27, 33, 71, .35);
}
.brand-mark img { width: 34px; height: 34px; object-fit: contain; display: block; }
.brand-text { line-height: 1.15; }
.brand-text .t { font-family: var(--font-display); font-weight: 900; font-size: 18px; }
.brand-text .s { font-size: 12px; color: var(--ink-2); }
.nav-links { display: flex; gap: 6px; align-items: center; }
.nav-links a { padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--ink-2); transition: .2s; }
.nav-links a:hover { background: var(--plum-soft); color: var(--plum); }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--paper); border: 1px solid var(--line); color: var(--ink-2); }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--plum); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 24px; border-radius: 999px; border: 0;
  font-family: var(--font-body); font-weight: 800; font-size: 15px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: linear-gradient(135deg, var(--plum), var(--plum-2)); color: #fff; box-shadow: 0 10px 24px rgba(180, 56, 107, .35); }
.btn-primary:hover { box-shadow: 0 14px 30px rgba(180, 56, 107, .45); transform: translateY(-2px); }
.btn-ghost { background: var(--paper); color: var(--ink); border: 2px solid var(--line); }
.btn-ghost:hover { border-color: var(--plum); color: var(--plum); }
.btn-gold, .btn-pink { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: var(--navy); box-shadow: 0 10px 24px rgba(195, 154, 62, .35); }
.btn-whatsapp { background: #25D366; color: #fff; box-shadow: 0 10px 24px rgba(37, 211, 102, .3); }
.btn-youtube { background: #FF0033; color: #fff; box-shadow: 0 10px 24px rgba(255,0,51,.3); }
.btn-youtube:hover, .btn-whatsapp:hover { transform: translateY(-2px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn-sm { padding: 9px 16px; font-size: 13px; }

/* ===== Hero ===== */
.hero { padding: 48px 0 24px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 32px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; background: var(--paper); border: 1px solid var(--line); padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--purple); }
.hero h1 { font-family: var(--font-display); font-weight: 900; font-size: clamp(36px, 5.6vw, 58px); line-height: 1.25; margin: 16px 0 12px; }
.hero h1 .hl { background: linear-gradient(120deg, var(--gold-2), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero h1 .sub-line { display: block; font-size: .42em; color: var(--ink-2); font-weight: 700; margin-top: 6px; line-height: 1.5; }
.hero p.lead { font-size: 17px; color: var(--ink-2); max-width: 540px; margin: 0 0 22px; }
.hero p.lead strong { display: block; margin-top: 8px; color: var(--plum); }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero-note { margin-top: 18px; font-size: 13px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
.hero-note span::before { content: "✦ "; color: var(--gold); }

.hero-visual { position: relative; display: flex; justify-content: center; }
.hero-visual img.teacher { position: relative; width: min(400px, 88%); filter: drop-shadow(0 20px 40px rgba(0,0,0,.35)); }
.hero-card {
  position: absolute; background: var(--paper); border-radius: 16px; padding: 10px 14px;
  box-shadow: var(--shadow); font-size: 13px; font-weight: 700; display: flex; gap: 10px; align-items: center;
  animation: float 5s ease-in-out infinite; color: var(--ink);
}
.hero-card.c1 { top: 10%; left: 2%; }
.hero-card.c2 { bottom: 12%; right: 2%; animation-delay: -2.5s; }
.hero-card .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; }
@keyframes float { 50% { transform: translateY(-8px); } }
.hero-name { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); background: #fff; color: var(--ink); padding: 8px 18px; border-radius: 999px; font-weight: 800; font-size: 14px; white-space: nowrap; box-shadow: var(--shadow-lg); }
.hero-name .tag { font-weight: 700; color: var(--plum); font-size: 12px; margin-inline-start: 8px; }

/* ===== Stats strip ===== */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 26px auto 10px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow); color: var(--ink); }
.stat .num { font-family: var(--font-display); font-weight: 900; font-size: 28px; line-height: 1; }
.stat .lbl { font-size: 13px; color: var(--ink-2); font-weight: 700; }
.stat .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; }
.ic.o { background: var(--plum-soft); } .ic.p { background: var(--gold-soft); } .ic.v { background: var(--purple-soft); } .ic.t { background: var(--teal-soft); } .ic.g { background: var(--ok-soft); }

/* mask icons */
.mi { display: inline-block; width: 62%; height: 62%; background: var(--c, var(--ink)); -webkit-mask-size: contain; mask-size: contain; -webkit-mask-position: center; mask-position: center; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.mi-book { -webkit-mask-image: url(../assets/icon-book.svg); mask-image: url(../assets/icon-book.svg); }
.mi-chat { -webkit-mask-image: url(../assets/icon-chat.png); mask-image: url(../assets/icon-chat.png); }

/* ===== Section headers ===== */
.section { padding: 48px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.section-head h2 { font-family: var(--font-display); font-weight: 900; font-size: clamp(26px, 4vw, 36px); margin: 0; line-height: 1.3; }
.section-head p { margin: 4px 0 0; color: var(--ink-2); }
.kicker { font-size: 13px; font-weight: 800; color: var(--plum); letter-spacing: .5px; }

/* ===== Unit blocks ===== */
.unit { margin-bottom: 34px; --uc: var(--plum); --us: var(--plum-soft); }
.unit[data-color="plum"]   { --uc: var(--plum);   --us: var(--plum-soft); }
.unit[data-color="navy"]   { --uc: var(--navy-2); --us: var(--navy-soft); }
.unit[data-color="purple"] { --uc: var(--purple); --us: var(--purple-soft); }
.unit[data-color="gold"]   { --uc: var(--gold);   --us: var(--gold-soft); }
.unit[data-color="teal"]   { --uc: var(--teal);   --us: var(--teal-soft); }
/* أسماء قديمة (للتوافق) */
.unit[data-color="orange"] { --uc: var(--plum);   --us: var(--plum-soft); }
.unit[data-color="pink"]   { --uc: var(--gold);   --us: var(--gold-soft); }
.unit[data-color="green"]  { --uc: var(--teal);   --us: var(--teal-soft); }

.unit-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.unit-cube {
  width: 64px; height: 64px; border-radius: 18px; background: var(--uc); color: #fff;
  display: grid; place-items: center; line-height: 1; font-family: var(--font-display);
  box-shadow: 0 10px 22px color-mix(in srgb, var(--uc) 40%, transparent);
  position: relative; overflow: hidden;
}
.unit-cube::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,.28), transparent 55%); }
.unit-cube small { font-size: 10px; font-weight: 700; opacity: .9; }
.unit-cube b { font-size: 24px; font-weight: 900; font-family: var(--font-en); }
.unit-title h3 { margin: 0; font-family: var(--font-display); font-size: 24px; font-weight: 900; line-height: 1.3; color: var(--uc); }
.unit-title p { margin: 0; font-size: 13px; color: var(--muted); }

.lessons { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.lesson {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 10px; position: relative;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
  box-shadow: 0 4px 14px rgba(27,33,71,.04);
}
.lesson:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--uc); }
.lesson-top { display: flex; align-items: center; justify-content: space-between; }
.lesson-num { font-family: var(--font-display); font-weight: 800; font-size: 13px; padding: 4px 12px; border-radius: 999px; background: var(--us); color: var(--uc); }
.lesson.rev .lesson-num { background: var(--ink); color: #fff; }
.lesson-done { font-size: 12px; font-weight: 800; color: var(--ok); background: var(--ok-soft); padding: 3px 10px; border-radius: 999px; }
.lesson h4 { margin: 2px 0 0; font-family: var(--font-display); font-weight: 800; font-size: 18px; line-height: 1.4; }
.lesson .topic { font-size: 13px; color: var(--muted); }
.lesson-meta { display: flex; gap: 10px; font-size: 12.5px; color: var(--ink-2); font-weight: 700; margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--line); }
.lesson-meta span::before { content: "• "; color: var(--uc); }
.lesson .btn { margin-top: 6px; background: var(--uc); color: #fff; box-shadow: 0 8px 18px color-mix(in srgb, var(--uc) 35%, transparent); }
.lesson.soon { opacity: .6; }
.lesson.soon .btn { background: var(--line); color: var(--muted); box-shadow: none; pointer-events: none; }

/* ===== About / help band ===== */
.band { background: var(--ink); color: #fff; border-radius: 28px; padding: 36px; display: grid; grid-template-columns: 1.05fr .95fr; gap: 24px; align-items: center; position: relative; overflow: hidden; }
.band::before { content: ""; position: absolute; inset: 0; background: url(../assets/pattern.jpg) center / cover; opacity: .35; pointer-events: none; }
.band::after { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(195,154,62,.35), transparent 65%); top: -170px; right: -120px; pointer-events: none; }
.band > * { position: relative; z-index: 1; }
.band h3 { font-family: var(--font-display); font-size: 30px; margin: 0 0 8px; font-weight: 900; }
.band p { margin: 0 0 18px; color: rgba(255,255,255,.78); }
.band-list { display: grid; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; }
.band-list li { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.band-list li::before { content: "✓"; width: 24px; height: 24px; border-radius: 8px; background: var(--gold); color: var(--navy); display: grid; place-items: center; font-size: 13px; font-weight: 800; flex-shrink: 0; }
.band-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.band-offer { display: block; background: #fff; border-radius: 18px; padding: 10px; box-shadow: 0 20px 50px rgba(0,0,0,.35); transition: transform .2s; justify-self: center; width: 100%; max-width: 340px; color: var(--ink); text-align: center; }
.band-offer:hover { transform: translateY(-4px) scale(1.01); }
.band-offer img { width: 100%; border-radius: 12px; }
.band-offer-cap { display: block; padding: 10px 0 2px; font-weight: 800; font-size: 14px; color: var(--plum); }

/* ===== Footer ===== */
footer { padding: 40px 0 28px; color: var(--muted); font-size: 13px; }
footer .container { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 22px; }
footer a { color: var(--plum); font-weight: 700; }

/* ===== Modal ===== */
.modal-bg { position: fixed; inset: 0; background: rgba(27,33,71,.55); backdrop-filter: blur(6px); display: none; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal-bg.open { display: flex; }
.modal { background: var(--paper); border-radius: 26px; padding: 28px; width: min(460px, 100%); box-shadow: var(--shadow-lg); animation: pop .25s ease; }
@keyframes pop { from { transform: translateY(14px) scale(.98); opacity: 0; } }
.modal h3 { font-family: var(--font-display); margin: 0 0 4px; font-size: 24px; font-weight: 900; }
.modal .sub { color: var(--ink-2); font-size: 14px; margin: 0 0 18px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 800; font-size: 13.5px; }
.field input { width: 100%; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); font: inherit; background: var(--cream); transition: .15s; }
.field input:focus { outline: none; border-color: var(--plum); background: #fff; }
.field .err { font-size: 12px; color: var(--red); display: none; }
.field.invalid input { border-color: var(--red); }
.field.invalid .err { display: block; }
.consent { font-size: 12.5px; color: var(--muted); background: var(--cream); padding: 10px 12px; border-radius: 12px; margin-bottom: 16px; }

/* ===== Exam page ===== */
.exam-top { position: sticky; top: 0; z-index: 40; background: rgba(247,244,238,.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.exam-top .container { display: flex; align-items: center; justify-content: space-between; gap: 14px; height: 64px; }
.exam-title { font-weight: 800; font-size: 14px; display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.exam-title .sub { font-size: 12px; color: var(--muted); font-weight: 700; }
.timer { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-weight: 800; font-family: var(--font-en); font-size: 16px; min-width: 96px; justify-content: center; }
.timer.warn { color: var(--red); border-color: var(--red); background: var(--red-soft); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .6; } }
.progress { height: 6px; background: var(--line); }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--plum), var(--gold)); transition: width .3s; }

.exam-wrap { width: min(820px, 100% - 32px); margin: 24px auto 120px; }
.qcard { background: var(--paper); border-radius: 26px; padding: 26px; box-shadow: var(--shadow); border: 1px solid var(--line); animation: pop .25s ease; }
.q-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.q-num { font-family: var(--font-display); font-weight: 800; color: var(--plum); font-size: 15px; }
.q-tag { font-size: 11.5px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--purple-soft); color: var(--purple); }
.q-passage { white-space: pre-line; background: var(--cream); border-inline-start: 4px solid var(--gold); padding: 12px 16px; border-radius: 12px; font-size: 15.5px; line-height: 1.9; margin-bottom: 14px; }
.q-passage.quran { font-family: var(--font-quran); font-size: 19px; line-height: 2.1; color: var(--navy); background: var(--gold-soft); }
.q-passage.en { font-family: var(--font-en); direction: ltr; text-align: left; }
.q-text { font-family: var(--font-body); font-size: 19px; font-weight: 700; line-height: 1.7; margin: 0 0 18px; }
.q-text.en { font-family: var(--font-en); direction: ltr; text-align: left; }
.q-text .blank { display: inline-block; min-width: 90px; border-bottom: 2px solid var(--plum); }
.options { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-radius: 16px;
  border: 2px solid var(--line); background: var(--cream); text-align: right; direction: rtl;
  font-family: var(--font-body); font-size: 16px; font-weight: 600; color: var(--ink); transition: .15s;
}
.opt.en { direction: ltr; text-align: left; font-family: var(--font-en); }
.opt:hover { border-color: var(--plum-2); background: #fff; }
.opt .key { width: 32px; height: 32px; border-radius: 10px; background: #fff; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 800; font-size: 13px; flex-shrink: 0; }
.opt.selected { border-color: var(--plum); background: var(--plum-soft); }
.opt.selected .key { background: var(--plum); border-color: var(--plum); color: #fff; }
.opt.correct { border-color: var(--ok); background: var(--ok-soft); }
.opt.correct .key { background: var(--ok); border-color: var(--ok); color: #fff; }
.opt.wrong { border-color: var(--red); background: var(--red-soft); }
.opt.wrong .key { background: var(--red); border-color: var(--red); color: #fff; }
.opt[disabled] { cursor: default; }

.exam-nav { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(255,255,255,.94); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 12px 0; z-index: 40; }
.exam-nav .container { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: min(820px, 100% - 32px); }
.dots { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; max-width: 60%; }
.dots button { width: 22px; height: 22px; border-radius: 7px; border: 0; background: var(--line); font-size: 10px; font-weight: 800; color: var(--muted); font-family: var(--font-en); }
.dots button.answered { background: var(--gold); color: #fff; }
.dots button.current { outline: 2px solid var(--ink); outline-offset: 1px; }

/* ===== Result ===== */
.result { text-align: center; padding: 10px 0; }
.ring { width: 170px; height: 170px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; position: relative; background: conic-gradient(var(--ok) calc(var(--p) * 1%), var(--line) 0); }
.ring.low { background: conic-gradient(var(--red) calc(var(--p) * 1%), var(--line) 0); }
.ring.mid { background: conic-gradient(var(--gold) calc(var(--p) * 1%), var(--line) 0); }
.ring::before { content: ""; position: absolute; inset: 12px; background: var(--paper); border-radius: 50%; }
.ring span { position: relative; font-family: var(--font-en); font-weight: 800; font-size: 40px; line-height: 1; }
.ring small { direction: ltr; position: relative; display: block; font-size: 13px; color: var(--muted); font-weight: 700; font-family: var(--font-en); }
.result h2 { font-family: var(--font-display); font-weight: 900; margin: 0 0 4px; font-size: 26px; }
.result p { color: var(--ink-2); margin: 0 0 16px; }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.result-grid div { background: var(--cream); border-radius: 14px; padding: 12px; }
.result-grid b { display: block; font-family: var(--font-en); font-size: 24px; }
.result-grid span { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.result-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.review { margin-top: 28px; display: grid; gap: 14px; }
.review .qcard { padding: 20px; animation: none; }
.review .why { margin-top: 12px; padding: 10px 14px; border-radius: 12px; background: var(--purple-soft); color: var(--purple); font-size: 14px; font-weight: 700; }
.review-head { display: flex; justify-content: space-between; align-items: center; margin-top: 26px; }
.review-head h3 { font-family: var(--font-display); margin: 0; font-size: 22px; }
.saved { font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.saved.ok { color: var(--ok); }

.toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 700; z-index: 200; opacity: 0; transition: .25s; pointer-events: none; }
.toast.show { opacity: 1; }

.loading { text-align: center; padding: 80px 0; color: var(--muted); font-weight: 700; }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--plum); margin: 0 auto 14px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Locked lessons / admin tag ===== */
.lesson.locked { background: repeating-linear-gradient(135deg, #fff, #fff 12px, #F5F1E9 12px, #F5F1E9 24px); }
.lesson.locked h4, .lesson.locked .topic { opacity: .55; }
.lesson.locked .btn { background: var(--cream-2); color: var(--muted); box-shadow: none; cursor: not-allowed; }
.lesson-lock { font-size: 12px; font-weight: 800; color: var(--purple); background: var(--purple-soft); padding: 3px 10px; border-radius: 999px; }
.admin-tag { position: fixed; bottom: 16px; left: 16px; z-index: 60; background: var(--purple); color: #fff; padding: 9px 16px; border-radius: 999px; font-size: 13px; font-weight: 800; box-shadow: var(--shadow-lg); }

/* ===== Admin panel ===== */
.admin-list { display: grid; gap: 8px; }
.admin-row { display: grid; grid-template-columns: auto auto auto 1fr auto; align-items: center; gap: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px; cursor: pointer; transition: .15s; }
.admin-row:hover { border-color: var(--uc); }
.admin-row.on { border-color: color-mix(in srgb, var(--ok) 50%, transparent); background: #FBFFFC; }
.admin-row .lesson-num { background: var(--us); color: var(--uc); }
.admin-title { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.admin-title b { font-size: 15px; text-align: right; }
.admin-title small { color: var(--muted); font-size: 12px; }
.admin-state { font-size: 12.5px; font-weight: 800; color: var(--muted); }
.admin-row.on .admin-state { color: var(--ok); }
.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: .2s; }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(-20px); }

/* ===== Two-tone layout: dark top band (nav + hero) with the booklet pattern, cream below ===== */
.top-band {
  position: relative; color: #fff; overflow: hidden;
  background: linear-gradient(160deg, #141A3A 0%, #1B2147 55%, #26306B 100%);
  border-bottom-left-radius: 44px; border-bottom-right-radius: 44px;
  padding-bottom: 36px;
}
.top-band::before { content: ""; position: absolute; inset: 0; background: url(../assets/pattern.jpg) center / cover; opacity: .28; pointer-events: none; }
.top-band::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(900px 500px at 85% -10%, rgba(195,154,62,.35), transparent 60%),
              radial-gradient(700px 500px at 0% 100%, rgba(180,56,107,.35), transparent 60%); }
.top-band > * { position: relative; z-index: 1; }
.top-band .nav { position: relative; background: transparent; border-bottom: 1px solid rgba(255,255,255,.12); backdrop-filter: none; }
.top-band .brand-text .t { color: #fff; font-size: 19px; }
.top-band .brand-text .s { color: rgba(255,255,255,.72); }
.top-band .brand-mark { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); box-shadow: 0 8px 18px rgba(0,0,0,.25); }
.nav-pill { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.22); color: #fff; }
.nav-pill .dot { background: var(--gold-2); }
.top-band .eyebrow { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.22); color: #fff; }
.top-band .hero h1 { color: #fff; }
.top-band .hero h1 .sub-line { color: rgba(255,255,255,.78); }
.top-band .hero p.lead { color: rgba(255,255,255,.82); }
.top-band .hero p.lead strong { color: #F1D48A; }
.top-band .hero-note { color: rgba(255,255,255,.65); }
.top-band .hero-note span::before { color: var(--gold-2); }
.top-band .btn-ghost { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.35); }
.top-band .btn-ghost:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,.14); }
.top-band .hero-visual::before { content: ""; position: absolute; width: 78%; aspect-ratio: 1; border-radius: 50%; top: 6%; background: radial-gradient(circle, rgba(195,154,62,.35), rgba(180,56,107,.15) 60%, transparent 72%); }

/* ===== Empty state when no lessons are open ===== */
.empty-lessons { background: var(--paper); border: 2px dashed var(--line); border-radius: var(--radius); padding: 40px 24px; text-align: center; color: var(--ink-2); }
.empty-lessons b { display: block; font-family: var(--font-display); font-size: 22px; color: var(--ink); margin-bottom: 6px; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .hero-visual img.teacher { width: min(300px, 80%); }
  .stats { grid-template-columns: repeat(2, 1fr); margin-top: 18px; }
  .band { grid-template-columns: 1fr; padding: 26px; }
  .band-offer { max-width: 100%; }
  .top-band { border-radius: 0 0 32px 32px; }
}
@media (max-width: 600px) {
  .nav-links a:not(.keep) { display: none; }
  .nav-pill { display: none !important; }
  .brand-mark { flex-shrink: 0; }
  .brand-text .s { overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
  .brand-text .t { white-space: nowrap; font-size: 15px; }
  .brand-text .s { font-size: 11px; white-space: nowrap; }
  .top-band .brand-text .t { font-size: 15px; }
  .hero { padding-top: 22px; }
  .hero h1 { font-size: 32px; }
  .hero-card.c1 { top: 4%; }
  .lessons { grid-template-columns: 1fr; }
  .qcard { padding: 20px 16px; border-radius: 20px; }
  .q-text { font-size: 17px; }
  .result-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .dots { display: none; }
  .btn-youtube, .band .btn-whatsapp { width: 100%; }
  /* exam header inside the viewport */
  .exam-top .container { gap: 8px; }
  .exam-top #back-btn { padding: 7px 10px; font-size: 12px; }
  .exam-top .timer { min-width: 0; padding: 6px 10px; font-size: 14px; }
  .exam-top .exam-title { max-width: 46%; }
  .exam-top .exam-title .sub { display: none; }
  .exam-top .exam-title span:not(.sub) { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
  .exam-nav .container { gap: 8px; }
  .exam-nav .btn { flex: 1; }
  .admin-row { grid-template-columns: 1fr auto; }
  .admin-row .lesson-num, .admin-state { display: none; }
  .unit-head { flex-wrap: wrap; }
}

/* ===== آيات وأحاديث داخل الأسئلة والخيارات ===== */
.ayah { font-family: var(--font-quran); font-size: 1.12em; line-height: 2; color: var(--navy); background: var(--gold-soft); padding: 1px 6px; border-radius: 6px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.hadith { font-family: var(--font-quran); font-size: 1.06em; color: var(--plum); }
.opt .ayah, .opt .hadith { font-size: 1.04em; }
.q-tags { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.q-tag.ministry { background: var(--gold-soft); color: #7a5a00; }

/* ===== توقيع المصمم في الفوتر ===== */
footer .credit a { font-family: var(--font-en); direction: ltr; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--muted); font-weight: 800; font-size: 12px; text-decoration: none; transition: .15s; }
footer .credit a::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #25D366; }
footer .credit a:hover { color: var(--plum); border-color: var(--plum); }

/* ===== حماية صفحة الامتحان ===== */
html.guarded body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
html.guarded input, html.guarded textarea { -webkit-user-select: text; user-select: text; }
html.guarded img { pointer-events: none; -webkit-user-drag: none; }
#hn-wm { position: fixed; inset: -20%; z-index: 9999; pointer-events: none; display: flex; flex-wrap: wrap; gap: 70px 90px; align-content: space-around; justify-content: space-around; transform: rotate(-24deg); opacity: .075; }
#hn-wm span { font-family: var(--font-body); font-weight: 800; font-size: 15px; color: var(--navy); white-space: nowrap; direction: ltr; }
@media print { html.guarded body > * { display: none !important; } html.guarded body::before { content: "طباعة صفحة الامتحان غير مسموحة"; display: block; padding: 40px; font-size: 20px; text-align: center; } }
