:root {
  --brand: #1e4a84;
  --brand-dark: #163a66;
  --brand-50: #eef3fa;
  --teal: #5cbfc5;
  --teal-dark: #3fa6ad;
  --gold: #e3c453;
  --cream: #f7f5dc;
  --ink: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --bad: #dc2626;
  --warn-bg: #fffbeb;
  --warn: #b45309;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: "Tajawal", system-ui, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.7; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1 { font-size: 1.75rem; margin: 0 0 .5rem; line-height: 1.4; }
h2 { font-size: 1.3rem; margin: 2rem 0 1rem; }
h3 { font-size: 1.05rem; margin: 0 0 .5rem; }
h4 { font-size: .9rem; color: var(--muted); margin: 1rem 0 .4rem; }
fieldset { border: 0; margin: 0; }
legend { padding: 0; margin-bottom: .75rem; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 1rem; }
.narrow { max-width: 460px; }
.page { padding-top: 2rem; padding-bottom: 3rem; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.strong { font-weight: 700; }
.big { font-size: 2rem; }
.brand-text { color: var(--brand); }
.ok { color: var(--brand); }
.bad { color: var(--bad); }
.nowrap { white-space: nowrap; }
.mt { margin-top: .75rem; }
.mb { margin-bottom: 1rem; }
.pad { padding: 1rem; }
.rounded { border-radius: 8px; }
.inline { display: inline; }
.block { display: flex; width: 100%; }
.grow { flex: 1; min-width: 0; }
.w-sm { width: 90px; }
.w-progress { min-width: 160px; }
.stack > * + * { margin-top: 1rem; }
.stack-lg > * + * { margin-top: 2rem; }
.row { display: flex; align-items: center; }
.gap { gap: .6rem; }
[hidden] { display: none !important; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.wrap-row { flex-wrap: wrap; }
.align-end { align-items: flex-end; }

/* الشريط العلوي */
.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; padding-top: .7rem; padding-bottom: .7rem; gap: 1rem; }
.brand { font-size: 1.3rem; font-weight: 700; color: var(--brand-dark); }
.nav-links { display: flex; align-items: center; gap: .9rem; font-size: .92rem; }
.nav-links a { color: #475569; }
.nav-links a.btn { color: #fff; }
.nav-links a.btn-outline { color: #334155; }
.link-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; padding: 0; }
.link-btn:hover { color: var(--bad); }
.footer { border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: .85rem; padding: 1.5rem; }

/* الأزرار والحقول */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; background: var(--brand); color: #fff; border: 1px solid var(--brand);
  border-radius: 10px; padding: .55rem 1.1rem; font: inherit; font-weight: 500; cursor: pointer; text-decoration: none !important; transition: .15s; }
.btn:hover { background: var(--brand-dark); }
.btn-outline { background: #fff; color: #334155; border-color: #cbd5e1; }
.btn-outline:hover { background: #f1f5f9; }
.btn-light { background: #fff; color: var(--brand-dark); border-color: #fff; }
.btn-light:hover { background: var(--brand-50); }
.btn-sm { padding: .3rem .8rem; font-size: .88rem; }
.btn-danger { background: none; border: 0; color: var(--bad); font: inherit; font-size: .88rem; cursor: pointer; padding: .35rem .7rem; border-radius: 8px; }
.btn-danger:hover { background: #fef2f2; }
.btn-danger.bordered { border: 1px solid #fecaca; }
.input { width: 100%; border: 1px solid #cbd5e1; border-radius: 10px; padding: .55rem .75rem; font: inherit; background: #fff; color: var(--ink); }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.input-sm { padding: .3rem .5rem; width: auto; }
textarea.input { resize: vertical; }
.field { display: block; }
.field > span { display: block; font-size: .85rem; color: #475569; margin-bottom: .3rem; font-weight: 500; }
.check { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.span2 { grid-column: span 2; }

/* البطاقات */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.badge { display: inline-block; background: #f1f5f9; color: #475569; border-radius: 99px; padding: .1rem .65rem; font-size: .78rem; font-weight: 500; }
.badge-brand { background: var(--brand-50); color: var(--brand-dark); }
.badge-bad { background: #fef2f2; color: var(--bad); }
.alert { border-radius: 10px; padding: .75rem 1rem; margin-bottom: .75rem; font-size: .95rem; }
.alert-success { background: var(--brand-50); color: var(--brand-dark); }
.alert-error { background: #fef2f2; color: var(--bad); }
.alert-warn { background: var(--warn-bg); color: var(--warn); }
.flashes { padding-top: 1rem; }
.code { background: #0f172a; color: #e2e8f0; padding: 1rem; border-radius: 8px; overflow: auto; text-align: left; }

/* الرئيسية */
.hero { background: linear-gradient(to left, var(--brand), var(--brand-dark)); color: #fff; padding: 3.5rem 0; }
.hero h1 { font-size: 2.1rem; }
.hero p { color: #d5ece6; max-width: 560px; }
.search { display: flex; gap: .5rem; max-width: 520px; margin-top: 1.5rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 1.25rem; }
.course-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; color: inherit; transition: .15s; }
.course-card:hover { text-decoration: none; box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.course-card img, .course-card .cover { height: 160px; width: 100%; object-fit: cover; }
.cover { display: flex; align-items: center; justify-content: center; text-align: center; padding: 1rem; color: #fff; font-weight: 700; font-size: 1.1rem;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark)); }
.course-card .body { padding: 1rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.course-card .body p { margin: 0; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { color: var(--brand); font-weight: 700; margin-top: auto !important; }

/* صفحة الدورة والتعلّم */
.layout-aside { display: grid; grid-template-columns: 1fr 320px; gap: 2rem; align-items: start; }
.layout-learn { display: grid; grid-template-columns: 1fr 300px; gap: 1.5rem; align-items: start; }
.sticky { position: sticky; top: 1rem; }
.prose { white-space: normal; line-height: 2; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: .3rem 0; }
.video { aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; }
.video iframe, .video video { width: 100%; height: 100%; border: 0; }
.side { font-size: .9rem; }
.side-list { list-style: none; padding: 0; margin: 0; }
.side-list a, .side-list span { display: flex; gap: .4rem; padding: .35rem .5rem; border-radius: 8px; color: var(--ink); }
.side-list a:hover { background: #f8fafc; text-decoration: none; }
.side-list a.active { background: var(--brand-50); color: var(--brand-dark); font-weight: 700; }
.progress { flex: 1; height: 8px; background: #f1f5f9; border-radius: 99px; overflow: hidden; min-width: 60px; }
.progress > div { height: 100%; background: var(--brand); border-radius: 99px; }
.choice { display: flex; align-items: center; gap: .7rem; border: 1px solid var(--line); border-radius: 10px; padding: .7rem .9rem; margin-top: .5rem; cursor: pointer; }
.choice input { accent-color: var(--brand); }
.choice-ok { border-color: var(--brand); background: var(--brand-50); }
.choice-bad { border-color: #f87171; background: #fef2f2; }
.result { border-radius: var(--radius); padding: 1.1rem 1.25rem; }
.result strong { font-size: 1.2rem; }
.result p { margin: .3rem 0 0; font-size: .9rem; }
.result-ok { background: var(--brand-50); color: var(--brand-dark); }
.result-bad { background: #fef2f2; color: var(--bad); }

/* اللوحات */
.tabs { display: flex; gap: .4rem; border-bottom: 1px solid var(--line); padding-bottom: .6rem; margin-bottom: 1.5rem; font-size: .92rem; overflow-x: auto; }
.tabs a { padding: .35rem .8rem; border-radius: 8px; color: #475569; white-space: nowrap; }
.tabs a.active, .tabs a:hover { background: #fff; color: var(--brand-dark); text-decoration: none; box-shadow: 0 0 0 1px var(--line); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1rem 0 1.5rem; }
.stats-5 { grid-template-columns: repeat(5, 1fr); }
.stats .card { display: flex; flex-direction: column; }
.stats strong { font-size: 1.5rem; }
.table-wrap { padding: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { background: #f8fafc; color: var(--muted); font-weight: 500; text-align: start; padding: .7rem .9rem; }
td { border-top: 1px solid #f1f5f9; padding: .7rem .9rem; vertical-align: middle; }
.lesson-row { border: 1px solid var(--line); border-radius: 10px; }
.lesson-row summary, .add-box summary { cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: .7rem .9rem; list-style: none; }
.lesson-row summary::-webkit-details-marker, .add-box summary::-webkit-details-marker { display: none; }
.lesson-row[open] summary { border-bottom: 1px solid var(--line); }
.add-box { background: #f8fafc; border-radius: 10px; }
.add-box summary { color: var(--brand); font-weight: 500; font-size: .92rem; }
.add-box form { padding: 0 .9rem .9rem; }
.danger-zone { border-color: #fecaca; }
.danger-zone h3 { color: var(--bad); }

@media (max-width: 860px) {
  .layout-aside, .layout-learn { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .stats, .stats-5 { grid-template-columns: 1fr 1fr; }
  .hide-sm { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .hero h1 { font-size: 1.6rem; }
}

/* ================== الإصدار 3: واجهة الأكاديمية ================== */
html { scroll-behavior: smooth; }
section[id] { scroll-margin-top: 80px; }
.topbar { position: sticky; top: 0; z-index: 50; backdrop-filter: saturate(1.4) blur(8px); background: rgba(255,255,255,.92); }
.brand { display: flex; align-items: center; gap: .55rem; }
.brand img { height: 40px; width: auto; border-radius: 8px; }
.brand.light { color: #fff; font-size: 1.2rem; font-weight: 700; margin-bottom: .6rem; }
.menu-toggle, .menu-btn { display: none; }
.btn-lg { padding: .75rem 1.5rem; font-size: 1.05rem; border-radius: 12px; }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.btn-ghost:hover { background: rgba(255,255,255,.12); }
.btn-whatsapp { background: #25d366; border-color: #25d366; }
.btn-whatsapp:hover { background: #1ebe5b; }
.btn-insta { background: linear-gradient(45deg, #f09433, #dc2743, #bc1888); border: 0; }
.btn-insta:hover { filter: brightness(1.05); }
.narrow-lg { max-width: 820px; }
.hero-sm { padding: 2.5rem 0; }

.landing-hero { background: radial-gradient(1200px 500px at 85% -10%, #2bb48f 0%, transparent 60%), linear-gradient(135deg, var(--brand-dark), var(--brand)); color: #fff; padding: 4.5rem 0; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2rem; align-items: center; }
.hero-text h1 { font-size: 2.8rem; font-weight: 800; line-height: 1.3; margin: .4rem 0 1rem; }
.hero-text p { font-size: 1.15rem; color: #d5ece6; max-width: 560px; margin-bottom: 1.8rem; }
.eyebrow { display: inline-block; background: rgba(255,255,255,.15); padding: .25rem .9rem; border-radius: 99px; font-size: .9rem; }
.hero-logo { display: flex; justify-content: center; }
.hero-logo img { max-height: 260px; width: auto; background: #fff; border-radius: 28px; padding: 1.25rem; box-shadow: 0 20px 50px rgba(0,0,0,.25); }

.section { padding: 4.5rem 0; }
.section.alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-title { text-align: center; font-size: 2rem; margin: 0 0 .4rem; color: var(--brand-dark); }
.section-title.start { text-align: start; margin: 0; }
.section-title.light { color: #fff; }
.section-sub { text-align: center; color: var(--muted); margin: 0 0 2.2rem; font-size: 1.1rem; }
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.cards-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; margin-top: 2rem; }
.feature { text-align: center; padding: 2rem 1.5rem; }
.feature .icon, .value .icon { font-size: 2.2rem; width: 68px; height: 68px; margin: 0 auto 1rem; display: flex; align-items: center; justify-content: center; background: var(--brand-50); border-radius: 20px; }
.value { text-align: center; padding: 1.6rem 1rem; transition: .2s; }
.value:hover, .feature:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(18,90,73,.12); }
.steps { margin-top: 1.5rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; }
.steps h3 { margin: 0; flex-basis: 100%; }
.steps ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 1rem 2rem; flex: 1; }
.steps li { display: flex; align-items: center; gap: .6rem; }
.steps li span { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }

.impact { background: linear-gradient(135deg, var(--brand), #10294a); color: #fff; }
.stats-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem; margin: 2rem 0; }
.stat { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 16px; padding: 1.4rem .8rem; text-align: center; }
.stat strong { display: block; font-size: 2rem; font-weight: 800; }
.stat span { color: #cfe0f5; font-size: .9rem; }
.enroll-card { background: #fff; color: var(--ink); border-radius: 20px; padding: 1.8rem; }
.enroll-card h3 { text-align: center; color: var(--brand-dark); font-size: 1.3rem; }
.enroll-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .8rem; margin: 1.2rem 0; }
.enroll-grid div { background: var(--brand-50); border-radius: 14px; padding: 1rem .5rem; text-align: center; }
.enroll-grid strong { display: block; font-size: 1.6rem; color: var(--brand-dark); }
.enroll-grid span { font-size: .85rem; color: var(--muted); }
.special { text-align: center; margin: 0; font-weight: 500; }

.teachers { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 1rem; margin-top: 2rem; }
.teacher { text-align: center; }
.avatar { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto .8rem; background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; font-size: 1.8rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.contact-box { background: linear-gradient(135deg, var(--brand-50), #fff); border: 1px solid var(--line); border-radius: 24px; padding: 3rem 1.5rem; text-align: center; }
.contact-box h2 { font-size: 2rem; color: var(--brand-dark); margin-top: 0; }
.contact-box p { color: var(--muted); font-size: 1.1rem; margin-bottom: 1.5rem; }
.center-row { justify-content: center; }

.site-footer { background: #10294a; color: #c8d6ea; padding-top: 3rem; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 2rem; padding-bottom: 2rem; }
.footer-grid h4 { color: #fff; font-size: 1rem; margin: 0 0 .8rem; }
.footer-grid a, .footer-grid span { display: block; color: #c8d6ea; margin-bottom: .4rem; font-size: .92rem; }
.footer-grid a:hover { color: #fff; }
.footer-grid p { font-size: .92rem; line-height: 1.9; }
.socials { display: flex; gap: .8rem; flex-wrap: wrap; }
.socials a { display: inline-block; background: rgba(255,255,255,.08); padding: .25rem .8rem; border-radius: 99px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 1.2rem 1rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .85rem; }
.footer-bottom a { color: #c8d6ea; }
.footer { display: none; }
.wa-float { position: fixed; bottom: 20px; inset-inline-end: 20px; width: 56px; height: 56px; border-radius: 50%; background: #25d366; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 20px rgba(0,0,0,.25); z-index: 60; }

.grade-tabs { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .5rem; margin-bottom: 1.5rem; }
.grade-tabs a { white-space: nowrap; padding: .5rem 1.1rem; border-radius: 99px; background: #fff; border: 1px solid var(--line); color: var(--ink); }
.grade-tabs a.active { background: var(--brand); border-color: var(--brand); color: #fff; text-decoration: none; }
.packages-layout { display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem; align-items: start; }
.subjects { display: grid; gap: .75rem; }
.subject { display: flex; align-items: center; gap: .9rem; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem; cursor: pointer; transition: .15s; }
.subject:hover { border-color: #b7dccf; }
.subject.selected { border-color: var(--brand); background: var(--brand-50); }
.subject.owned { cursor: default; opacity: .75; }
.subject input { width: 20px; height: 20px; accent-color: var(--brand); flex-shrink: 0; }
.subject-body { flex: 1; display: flex; flex-direction: column; }
.subject-price { font-weight: 700; color: var(--brand); white-space: nowrap; }
.check-done { width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-size: .8rem; }
.summary .total { font-size: 1.15rem; border-top: 1px solid var(--line); padding-top: .8rem; }
.summary .total strong { color: var(--brand); font-size: 1.3rem; }
.block-link { display: block; margin-top: .6rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.content-group summary { cursor: pointer; list-style: none; }
.content-group summary h3 { display: inline; }
.content-group summary::-webkit-details-marker { display: none; }
.save-bar { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 1rem 0; }

@media (max-width: 980px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .cards-5 { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .menu-btn { display: block; font-size: 1.6rem; cursor: pointer; padding: 0 .4rem; }
  .nav { flex-wrap: wrap; }
  .nav-links { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: .3rem; padding: .6rem 0; }
  .nav-links a, .nav-links form { padding: .5rem .2rem; }
  .nav-links .btn { text-align: center; }
  .menu-toggle:checked ~ .nav-links { display: flex; }
  .hero-grid, .packages-layout { grid-template-columns: 1fr; }
  .hero-logo { order: -1; }
  .hero-logo img { max-height: 140px; }
  .hero-text h1 { font-size: 2rem; }
  .landing-hero { padding: 3rem 0; }
  .section { padding: 3rem 0; }
  .section-title { font-size: 1.6rem; }
  .cards-3 { grid-template-columns: 1fr; }
  .cards-5 { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .enroll-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .brand img { height: 34px; }
}


/* ================== الإصدار 4: هوية tafawqi.org + دعم الإنجليزية ================== */
[dir="ltr"] body { font-family: "Tajawal", system-ui, sans-serif; }
[dir="ltr"] .arrow { display: inline-block; transform: scaleX(-1); }
.topbar { box-shadow: 0 4px 14px rgba(16,41,74,.06); }
.nav-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: .7rem; padding-bottom: .7rem; }
.brand img { height: 56px; border-radius: 0; }
.brand-text { font-size: 1.15rem; font-weight: 800; color: var(--brand); }
.nav-desktop { display: flex; gap: 1.3rem; font-weight: 500; }
.nav-desktop a { color: #334155; }
.nav-desktop a:hover { color: var(--brand); text-decoration: none; }
.nav-actions { display: flex; align-items: center; gap: .55rem; }
.btn-lang { border: 1.5px solid #d6dfec; color: var(--brand); border-radius: 12px; padding: .45rem .85rem; font-weight: 600; background: #fff; }
.btn-lang:hover { background: var(--brand-50); text-decoration: none; }
.btn-cream { background: var(--cream); color: var(--brand); border: 2px solid var(--brand); }
.btn-cream:hover { background: #efecc5; }
.btn-navy { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-navy:hover { background: var(--brand-dark); }
.nav-top .btn { border-radius: 12px; padding: .5rem 1.1rem; }
.btn-teal { background: var(--teal-dark); border-color: var(--teal-dark); color: #fff; }
.btn-teal:hover { background: #33929a; }
.btn-outline-navy { background: #fff; color: var(--brand); border: 2px solid var(--brand); }
.btn-outline-navy:hover { background: var(--brand-50); }
.nav-tabs { display: none; }

.landing-hero { position: relative; background: #fbfbf6; color: var(--ink); padding: 5rem 0 4.5rem; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; pointer-events: none; }
.blob-gold { width: 420px; height: 420px; background: #f8eeb8; top: -80px; inset-inline-end: -60px; }
.blob-teal { width: 380px; height: 380px; background: #d3f0f1; bottom: -120px; inset-inline-start: -80px; }
.blob-rose { width: 220px; height: 220px; background: #f7e4ea; bottom: 40px; inset-inline-end: 12%; border-radius: 40px; transform: rotate(45deg); filter: none; opacity: .6; }
.hero-center { position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; }
.hero-badge { display: inline-flex; align-items: center; gap: .6rem; background: #fffbea; border: 3px solid var(--gold); color: var(--brand); font-weight: 700; font-size: 1.1rem; padding: .55rem 1.5rem; border-radius: 99px; box-shadow: 0 8px 20px rgba(227,196,83,.25); }
.hero-badge svg { width: 26px; height: 26px; fill: var(--gold); }
.hero-title { font-size: 4rem; line-height: 1.15; font-weight: 800; color: var(--brand); margin: 2rem 0 0; max-width: 900px; }
.hero-title .teal { color: var(--teal); }
.hero-underline { width: min(340px, 60%); height: 14px; margin-top: .3rem; }
.hero-underline path { fill: none; stroke: var(--gold); stroke-width: 5; stroke-linecap: round; }
.hero-sub { font-size: 1.35rem; color: #475569; max-width: 720px; margin: 1.5rem 0 2rem; line-height: 1.8; }
.hero-actions { display: flex; gap: .9rem; flex-wrap: wrap; justify-content: center; }
.hero-actions .btn { min-width: 190px; border-radius: 16px; padding: .85rem 1.6rem; font-size: 1.1rem; }
.hero-logo { display: none; }

.section-title { color: var(--brand); }
.feature .icon, .value .icon { background: #e9f6f7; }
.enroll-grid div { background: #eef7f8; }
.enroll-grid strong { color: var(--brand); }
.avatar { background: linear-gradient(135deg, var(--teal), var(--brand)); }
.contact-box { background: linear-gradient(135deg, #fffbea, #eef7f8); }
.contact-box h2 { color: var(--brand); }
.grade-tabs a.active { background: var(--brand); border-color: var(--brand); }
.subject.selected { border-color: var(--teal-dark); background: #eef8f8; }
.cover { background: linear-gradient(135deg, var(--teal-dark), var(--brand)); }
.hero { background: linear-gradient(to left, var(--brand), #10294a); }
[dir="ltr"] .hero { background: linear-gradient(to right, var(--brand), #10294a); }

@media (max-width: 980px) {
  .nav-desktop { display: none; }
  .nav-tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); background: #fff; padding: .4rem; gap: .4rem; }
  .nav-tabs > a, .nav-tabs summary { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .5rem; border-radius: 16px; color: #334155; font-size: .95rem; cursor: pointer; list-style: none; }
  .nav-tabs summary::-webkit-details-marker { display: none; }
  .nav-tabs svg { width: 26px; height: 26px; fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; }
  .nav-tabs .more svg { fill: #64748b; stroke: none; }
  .nav-tabs > a.active { background: var(--cream); color: var(--brand); }
  .nav-tabs > a:hover { text-decoration: none; }
  .more { position: relative; }
  .more-menu { position: absolute; inset-inline-end: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.12); min-width: 200px; padding: .4rem; z-index: 70; }
  .more-menu a { display: block; padding: .6rem .8rem; border-radius: 10px; color: var(--ink); }
  .more-menu a:hover { background: var(--brand-50); text-decoration: none; }
  .menu-btn, .menu-toggle { display: none !important; }
}
@media (max-width: 600px) {
  .brand img { height: 46px; }
  .nav-actions { gap: .4rem; }
  .nav-top .btn, .btn-lang { padding: .45rem .7rem; font-size: .92rem; }
  .hero-title { font-size: 2.9rem; }
  .hero-sub { font-size: 1.15rem; }
  .hero-badge { font-size: 1rem; }
  .landing-hero { padding: 3.5rem 0; }
}
.nav-desktop a, .nav-top .btn, .btn-lang { white-space: nowrap; }
.nav-desktop { gap: 1rem; }
@media (max-width: 1150px) { .nav-desktop a[href$="#teachers"] { display: none; } }
@media (max-width: 600px) { .brand-text { font-size: .95rem; line-height: 1.4; } .nav-top .btn { padding: .45rem .6rem; font-size: .88rem; } }

.stats-4 { grid-template-columns: repeat(4, 1fr); }
.stats .earn { background: var(--brand); border-color: var(--brand); color: #fff; }
.stats .earn span { color: #cfe0f5; }
@media (max-width: 860px) { .stats-4 { grid-template-columns: 1fr 1fr; } }
.pay-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.pay-method { text-align: center; display: flex; flex-direction: column; gap: .6rem; }
.pay-method .icon { font-size: 2.2rem; }
.pay-method .btn { margin-top: auto; }
.bank-details { display: grid; gap: .5rem; margin: 0; }
.bank-details > div { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem .8rem; background: #f8fafc; border-radius: 10px; flex-wrap: wrap; }
.bank-details dt { color: var(--muted); }
.bank-details dd { margin: 0; font-weight: 600; word-break: break-all; }
.badge-warn { background: #fef3c7; color: #92400e; }
@media (max-width: 700px) { .pay-methods { grid-template-columns: 1fr; } }

/* ================== الإصدار 8: دليل المواد وصفحة المادة ================== */
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.course-card .thumb { position: relative; }
.course-card .thumb img, .course-card .thumb .cover { height: 170px; width: 100%; object-fit: cover; }
.ribbon { position: absolute; top: 10px; inset-inline-start: 10px; background: #dc2626; color: #fff; font-size: .75rem; font-weight: 700; padding: .15rem .6rem; border-radius: 99px; }
.level-chip { position: absolute; top: 10px; inset-inline-end: 10px; background: rgba(255,255,255,.92); color: var(--brand); font-size: .75rem; font-weight: 700; padding: .15rem .6rem; border-radius: 99px; }
.meta-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.meta-row .cat { color: var(--teal-dark); font-weight: 600; }
.course-card h3 { font-size: 1.02rem; line-height: 1.5; margin: .1rem 0 .2rem; }
.teacher-line { display: flex; align-items: center; gap: .5rem; margin: 0; color: #334155; }
.teacher-line:hover { text-decoration: none; }
.price-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: auto; padding-top: .5rem; border-top: 1px solid #f1f5f9; }
.price-row .price { margin: 0 !important; }
.view-link { margin-inline-start: auto; color: var(--brand); font-weight: 600; }
.catalog { display: grid; grid-template-columns: 260px 1fr; gap: 1.5rem; align-items: start; }
.filters { position: sticky; top: 90px; padding: 1.1rem; }
.filters h3 { margin-bottom: .3rem; }
.filters h4 { color: #0f172a; margin: 1rem 0 .3rem; font-size: .9rem; }
.filters a { display: block; padding: .3rem .6rem; border-radius: 8px; color: #475569; font-size: .9rem; }
.filters a:hover { background: #f1f5f9; text-decoration: none; }
.filters a.on { background: var(--brand-50); color: var(--brand); font-weight: 700; }
.pager-public { display: flex; gap: .4rem; justify-content: center; margin-top: 1.5rem; flex-wrap: wrap; }
.pager-public a { padding: .4rem .85rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: #334155; }
.pager-public a.cur { background: var(--brand); color: #fff; border-color: var(--brand); }
.course-hero { background: linear-gradient(135deg, #10294a, var(--brand)); color: #fff; padding: 2.5rem 0 2.2rem; }
.course-hero h1 { font-size: 2.1rem; margin: .6rem 0 .5rem; }
.course-hero .lead { color: #d6e2f3; font-size: 1.1rem; max-width: 760px; }
.crumbs { color: #b8c8e0; margin-bottom: .8rem; } .crumbs a { color: #d6e2f3; }
.chip { display: inline-block; background: rgba(255,255,255,.14); padding: .2rem .75rem; border-radius: 99px; font-size: .85rem; margin-inline-end: .3rem; }
.facts { display: flex; flex-wrap: wrap; gap: .6rem 1.3rem; margin: 1rem 0; font-size: .95rem; color: #e2eaf6; }
.course-hero .teacher-line { color: #fff; }
.h-sec { font-size: 1.25rem; margin: 0 0 .8rem; color: var(--brand); }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.checklist li { position: relative; padding-inline-start: 1.6rem; }
.checklist li::before { content: "✓"; position: absolute; inset-inline-start: 0; color: var(--teal-dark); font-weight: 800; }
.two-col { grid-template-columns: 1fr 1fr; }
.dotlist { margin: 0; padding-inline-start: 1.2rem; display: grid; gap: .4rem; }
.cards-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.chapter { padding: 0; }
.chapter summary { cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem; list-style: none; }
.chapter summary::-webkit-details-marker { display: none; }
.chapter[open] summary { border-bottom: 1px solid var(--line); }
.chapter .list { padding: .6rem 1.2rem 1rem; }
.chapter + .chapter { margin-top: .6rem; }
.buy-box .price-row { border: 0; padding: 0; }
.buy-box h4 { margin: .4rem 0 0; color: #0f172a; }
.instructor-box .avatar { margin: 0; }
.avatar-lg { width: 96px; height: 96px; font-size: 2.4rem; margin: 0; }
.pill-title { display: block; width: fit-content; margin: 0 auto .6rem; background: #fdecec; color: #b91c1c; padding: .2rem .9rem; border-radius: 99px; font-size: .85rem; font-weight: 700; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 1rem; margin-top: 1.8rem; }
.cat-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: .35rem; color: var(--ink); transition: .15s; }
.cat-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: 0 10px 24px rgba(30,74,132,.1); }
.cat-ico { font-size: 2rem; width: 64px; height: 64px; border-radius: 18px; background: #e9f6f7; display: flex; align-items: center; justify-content: center; }
.thumb-preview { width: 240px; height: 135px; border-radius: 10px; background: #f1f5f9; display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.thumb-preview img { width: 100%; height: 100%; object-fit: cover; }
a.teacher { color: var(--ink); } a.teacher:hover { text-decoration: none; box-shadow: 0 10px 24px rgba(30,74,132,.1); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) {
  .catalog { grid-template-columns: 1fr; } .filters { position: static; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .two-col, .cards-2 { grid-template-columns: 1fr; }
  .course-hero h1 { font-size: 1.6rem; }
}
@media (max-width: 560px) { .grid-3, .grid-4 { grid-template-columns: 1fr; } .thumb-preview { width: 100%; } }

/* v9: أسعار الباقات */
.summary .saving{color:#15803d}
.tier-list{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px;border-top:1px dashed var(--border,#e5e7eb);padding-top:10px}
.tier-list p{width:100%;margin:0 0 2px}
.tier-list .tier{padding:3px 9px;border-radius:999px;background:#f3f4f6;white-space:nowrap}
.tier-list .tier.on{background:var(--primary,#1e3a8a);color:#fff}

/* v10: المنهج والتقييمات */
.alert-info{background:#eff6ff;color:#1e3a8a;border:1px solid #bfdbfe}
.quiz-meta{display:flex;flex-wrap:wrap;gap:.4rem 1rem}
.timer{position:sticky;top:.5rem;z-index:5;display:flex;justify-content:space-between;align-items:center;font-size:1.05rem}
.timer strong{font-size:1.3rem;font-variant-numeric:tabular-nums}
.timer-low{background:#fef2f2;border-color:#fecaca;color:#b91c1c}
.live-card{border-inline-start:4px solid #dc2626}
.live-past{border-inline-start-color:#9ca3af}
.pdf-frame{border:1px solid var(--line,#e5e7eb);border-radius:12px;overflow:hidden;height:75vh;min-height:420px;background:#f9fafb}
.pdf-frame iframe{width:100%;height:100%;border:0}
.video.embed{aspect-ratio:16/10}
.file-link{display:flex;gap:.6rem;align-items:center;text-decoration:none}
.file-link span:first-of-type{flex:1;font-weight:600}

/* v11: التفاعل */
.bell{position:relative;text-decoration:none}
.bell-count{position:absolute;top:-6px;inset-inline-end:-6px;background:#dc2626;color:#fff;border-radius:999px;font-size:.65rem;font-weight:700;padding:1px 5px;line-height:1.4}
.stars{color:#f59e0b;letter-spacing:1px;white-space:nowrap}
.stars .off{color:#d1d5db}
.rating-line{display:inline-flex;gap:.35rem;align-items:center;font-size:.85rem}
.discussion{margin-top:1.5rem}
.comment{display:flex;gap:.7rem;padding:.9rem 0;border-bottom:1px solid var(--line,#e5e7eb)}
.comment:last-child{border-bottom:0}
.comment .avatar{width:34px;height:34px;border-radius:50%;background:#e8f1ee;color:#125a49;display:flex;align-items:center;justify-content:center;font-weight:700;flex-shrink:0}
.comment .avatar.staff{background:#125a49;color:#fff}
.comment .who{font-weight:700}
.comment .meta{font-size:.78rem;color:var(--muted,#64748b)}
.comment .text{white-space:pre-wrap;margin:.25rem 0}
.comment .replies{margin-top:.5rem;padding-inline-start:.8rem;border-inline-start:2px solid #e5e7eb}
.comment.is-hidden{opacity:.55}
.staff-badge{background:#125a49;color:#fff;border-radius:999px;font-size:.7rem;padding:1px 8px;margin-inline-start:.3rem}
.star-input{display:inline-flex;flex-direction:row-reverse;gap:2px}
[dir="ltr"] .star-input{flex-direction:row-reverse}
.star-input input{display:none}
.star-input label{font-size:1.8rem;color:#d1d5db;cursor:pointer;line-height:1}
.star-input input:checked ~ label,.star-input label:hover,.star-input label:hover ~ label{color:#f59e0b}
.review{padding:.9rem 0;border-bottom:1px solid var(--line,#e5e7eb)}
.review:last-child{border-bottom:0}
.rating-summary{display:flex;gap:1.2rem;align-items:center}
.rating-summary .big{font-size:2.6rem;font-weight:800;line-height:1}
.cert-cta{display:flex;justify-content:space-between;align-items:center;gap:1rem;flex-wrap:wrap;background:linear-gradient(135deg,#fffbeb,#ecfdf5);border:1px solid #fde68a}
.verify-box{max-width:560px;margin:0 auto}
.w-md{width:170px}
.quick-add{background:#f8fafc;border:1px dashed var(--line,#e5e7eb);border-radius:10px;padding:.5rem}

/* v12: ملاحظات الدرس */
.tabs-pub{display:flex;gap:.3rem;border-bottom:1px solid var(--line,#e5e7eb);margin:1.5rem 0 1rem;flex-wrap:wrap}
.tabs-pub a{padding:.6rem 1rem;color:var(--muted,#64748b);text-decoration:none;border-bottom:2px solid transparent;margin-bottom:-1px;font-weight:600}
.tabs-pub a.active{color:var(--brand,#125a49);border-bottom-color:var(--brand,#125a49)}
.lesson-tabs .discussion{margin-top:0}
.note-row{display:flex;gap:.7rem;align-items:flex-start;padding:.7rem 0;border-bottom:1px solid var(--line,#e5e7eb)}
.note-row:last-child{border-bottom:0}
.note-time{font-family:ui-monospace,monospace;font-size:.78rem;background:#fef2f2;color:#b91c1c;border:0;border-radius:6px;padding:.2rem .45rem;cursor:pointer;direction:ltr}

/* v13: كوبون عند الاشتراك */
.coupon-box{border-top:1px dashed var(--line,#e5e7eb);padding-top:.7rem;margin-top:.4rem;display:flex;flex-direction:column;gap:.35rem}
.coupon-box .input{padding:.45rem .7rem}

/* v13: الأسئلة الشائعة + نوع الحساب + رمز الربط */
.narrow-wide{max-width:860px}
.faq{display:flex;flex-direction:column;gap:.6rem;margin-top:1.2rem}
.faq details{background:#fff;border:1px solid var(--line,#e5e7eb);border-radius:12px;padding:.9rem 1.1rem;transition:box-shadow .2s}
.faq details[open]{box-shadow:0 6px 18px rgba(18,90,73,.08);border-color:var(--brand-50,#d1fae5)}
.faq summary{cursor:pointer;font-weight:700;list-style:none;display:flex;justify-content:space-between;gap:1rem}
.faq summary::-webkit-details-marker{display:none}
.faq summary::after{content:"+";color:var(--brand,#125a49);font-size:1.3rem;line-height:1}
.faq details[open] summary::after{content:"−"}
.faq details p{margin:.6rem 0 0;color:var(--muted,#6b7280);line-height:1.8}
.acct-type{display:grid;grid-template-columns:1fr 1fr;gap:.5rem}
.acct-type label{display:flex;align-items:center;gap:.4rem;border:1.5px solid var(--line,#e5e7eb);border-radius:10px;padding:.65rem .8rem;cursor:pointer;font-weight:600}
.acct-type label:has(input:checked){border-color:var(--brand,#125a49);background:var(--brand-50,#ecfdf5)}
.link-code{font-family:ui-monospace,monospace;font-size:1.4rem;letter-spacing:.2em;background:var(--brand-50,#ecfdf5);color:var(--brand-dark,#0d3f33);padding:.35rem .8rem;border-radius:8px}
.linkish{background:none;border:0;color:inherit;cursor:pointer;padding:0 .2rem}

/* اشتراك الزائر بخطوة واحدة */
.quick-acct{display:flex;flex-direction:column;gap:.6rem;border-top:1px solid var(--line);padding-top:.9rem;margin:.4rem 0 .8rem}
.qa-tabs{display:grid;grid-template-columns:1fr 1fr;gap:.4rem}
.qa-tabs label{display:flex;align-items:center;justify-content:center;gap:.35rem;border:1.5px solid var(--line);border-radius:10px;padding:.5rem;cursor:pointer;font-weight:700;font-size:.92rem}
.qa-tabs label:has(input:checked){border-color:var(--brand);background:var(--brand-50);color:var(--brand)}
.qa-tabs input{accent-color:var(--brand)}
.quick-acct .qa-login{display:none}
.quick-acct.is-login .qa-login{display:block}
.quick-acct.is-login .qa-new{display:none}
.quick-acct .field{margin:0}

/* حقل الموعد: تاريخ + وقت */
.dt-field{display:flex;flex-direction:column;gap:.35rem;width:100%}
.dt-parts{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:.5rem;width:100%}
.dt-part{display:flex;flex-direction:column;gap:.2rem;min-width:0;position:relative}
.dt-part small{color:var(--muted);font-size:.78rem}
.dt-part .input{-webkit-appearance:none;appearance:none;display:block;box-sizing:border-box;width:100%;max-width:100%;min-width:0;min-height:44px;text-align:left;background:#fff}
.dt-part .input::-webkit-date-and-time-value{text-align:left;margin:0}
.dt-part .input::-webkit-datetime-edit{padding:0}
.dt-ph{display:none;position:absolute;inset-inline:0;bottom:0;height:44px;align-items:center;justify-content:center;color:var(--muted);font-size:.9rem;pointer-events:none;z-index:1}
.dt-js .dt-part.is-empty .dt-ph{display:flex}
.dt-js .dt-part.is-empty .input{color:transparent}
.dt-preview{font-size:.85rem;color:var(--brand);font-weight:600;min-height:1.2em}
.dt-preview.muted{color:var(--muted);font-weight:400}
.dt-compact{min-width:240px}
.dt-compact .dt-part small{display:none}
.dt-compact .dt-ph{height:34px;font-size:.78rem}
.dt-compact .dt-part .input{min-height:34px}
.dt-compact .dt-preview{font-size:.75rem}

/* رقم المستخدم */
.user-code{font-family:ui-monospace,Menlo,monospace;letter-spacing:.06em;background:var(--brand-50);color:var(--brand);padding:.1rem .5rem;border-radius:6px}
.user-code-line{margin:.2rem 0 1rem}
.name-row{display:grid;grid-template-columns:minmax(150px,.6fr) 1.4fr;gap:.6rem}
@media (max-width:520px){.name-row{grid-template-columns:1fr}}
.cred-box{display:flex;flex-wrap:wrap;gap:.6rem 1.5rem}
.cred-box div{display:flex;flex-direction:column;gap:.2rem}

/* التسجيل: رمز التحقق + صفحة بيانات الحساب */
.req{color:var(--bad)}
.captcha-row{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap}
.captcha-img{border-radius:8px;border:1px solid var(--line);background:#eef3fa;width:150px;height:50px}
.captcha-row .input{flex:1;min-width:120px;text-transform:uppercase;letter-spacing:.2em;font-weight:700}
.welcome-ico{font-size:2.6rem}
.welcome-card h1{margin:.2rem 0}
.cred-card{display:grid;grid-template-columns:1fr 1fr;gap:.7rem}
.cred-card div{background:var(--brand-50);border:1.5px dashed var(--brand);border-radius:14px;padding:.9rem;text-align:center;display:flex;flex-direction:column;gap:.3rem}
.cred-card span{color:var(--muted);font-size:.85rem}
.cred-card strong{font-family:ui-monospace,Menlo,monospace;font-size:1.6rem;letter-spacing:.08em;color:var(--brand)}
@media (max-width:420px){.cred-card{grid-template-columns:1fr}}

/* رقم الهاتف: مفتاح الدولة + الرقم */
.phone-input{display:grid;grid-template-columns:auto 1fr;gap:.5rem}
.phone-input select.input{width:auto;min-width:118px;padding-inline:.6rem}
.phone-input .input{min-width:0}
.phone-input input{letter-spacing:.06em}

/* العروض */
.offer-banner{display:flex;gap:.8rem;align-items:center;background:linear-gradient(90deg,#fff7e0,#fffbf0);border:1.5px solid #f1d58a;border-radius:14px;padding:.8rem 1rem;margin-bottom:1rem}
.offer-banner .offer-tag{background:#e3c453;color:#12305a;font-weight:800;border-radius:999px;padding:.25rem .7rem;white-space:nowrap;font-size:.85rem}
.offer-banner div{display:flex;flex-direction:column;gap:.1rem}
.offer-banner span{color:#6b5410;font-size:.9rem}
.offer-banner small{color:var(--muted)}
.offer-line{color:#8a6a0a}

/* صورة المعلم */
.has-photo { overflow: hidden; padding: 0 !important; background: #e5e7eb !important; }
.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.photo-box { display: flex; gap: 1rem; align-items: flex-start; padding: 1rem; border: 1px dashed var(--line, #d1d5db); border-radius: 14px; margin: 1rem 0; }
.photo-box > .avatar { flex-shrink: 0; margin: 0; }
@media (max-width: 520px) { .photo-box { flex-direction: column; align-items: center; text-align: center; } }

/* حصة مجانية مفتوحة */
.free-live { display: grid; gap: 1.25rem; }
.fl-card { background: #fff; border: 1px solid var(--line, #e5e7eb); border-radius: 18px; padding: 1.5rem; display: grid; gap: .9rem; box-shadow: 0 8px 30px rgba(15, 23, 42, .06); }
.fl-badge { justify-self: start; background: #fef3c7; color: #92400e; font-weight: 700; font-size: .85rem; padding: .3rem .8rem; border-radius: 999px; }
.fl-card h1 { margin: 0; font-size: clamp(1.4rem, 4vw, 2rem); line-height: 1.4; }
.fl-sub { margin: 0; color: var(--muted, #64748b); font-weight: 600; }
.fl-teacher { display: flex; align-items: center; gap: .6rem; }
.fl-teacher .mini-avatar { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--brand, #1e3a8a); color: #fff; font-weight: 700; }
.fl-when { display: flex; flex-wrap: wrap; gap: .5rem 1rem; font-weight: 700; background: #f1f5f9; padding: .7rem 1rem; border-radius: 12px; }
.fl-note { margin: 0; color: #334155; }
.fl-count { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; direction: rtl; }
.fl-count div { background: var(--brand, #1e3a8a); color: #fff; border-radius: 12px; padding: .7rem .3rem; text-align: center; }
.fl-count b { display: block; font-size: 1.7rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fl-count span { font-size: .78rem; opacity: .85; }
.fl-join .btn.big { font-size: 1.1rem; padding: .9rem; }
.fl-cta { background: #f8fafc; border: 1px dashed var(--line, #cbd5e1); border-radius: 18px; padding: 1.25rem 1.5rem; display: grid; gap: .5rem; }
.fl-cta h2 { margin: 0; font-size: 1.2rem; }
.fl-cta p { margin: 0; }
.fl-offer { color: #92400e; }
.center { text-align: center; }
.public-box { display: grid; gap: .45rem; margin-top: .7rem; padding-top: .7rem; border-top: 1px dashed var(--line, #e5e7eb); }
.public-box .input.small { font-size: .82rem; padding: .4rem .6rem; }
.free-live .btn-red { background: #dc2626; border-color: #dc2626; color: #fff; } .free-live .btn-red:hover { background: #b91c1c; }

/* صورة المعلم المصغّرة في الصفحات العامة */
.mini-avatar { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--teal, #22b2b8), var(--brand, #1e3a8a)); color: #fff; font-weight: 700; overflow: hidden; }
.course-hero .teacher-line .mini-avatar { width: 48px; height: 48px; border: 2px solid rgba(255, 255, 255, .7); }
.card .teacher-line .mini-avatar { width: 28px; height: 28px; font-size: .8rem; }
.no-photo { background: #e2e8f0 !important; color: #94a3b8 !important; }
.no-photo svg { width: 62%; height: 62%; margin-top: 12%; }
.course-hero .no-photo { background: rgba(255, 255, 255, .18) !important; color: rgba(255, 255, 255, .85) !important; }

/* ——— توافق الشاشات: عناصر الشبكات لا تتجاوز عرض الشاشة ——— */
.packages-layout > *, .subjects > *, .grid > *, .teachers > *, .cat-grid > *, .form-grid > *, .name-row > * { min-width: 0; }
img, video, iframe, svg { max-width: 100%; }
.wrap { box-sizing: border-box; }
@media (max-width: 520px) {
  .subject { flex-wrap: wrap; gap: .35rem .75rem; padding: .85rem .9rem; }
  .subject-body { flex: 1 1 calc(100% - 2.2rem); min-width: 0; }
  .subject-price { margin-inline-start: calc(20px + .75rem); }
  .subject > a.small { margin-inline-start: auto; }
}
.table-wrap th { white-space: nowrap; }
.table-wrap td.nowrap, .table-wrap .nowrap { white-space: nowrap; }
/* الجداول الكبيرة (5 أعمدة فأكثر): تمرير أفقي داخل البطاقة بدل تكسير الكلمات */
.table-wrap table:has(th:nth-child(5)) { min-width: 760px; }
.table-wrap table:has(th:nth-child(5)) td:last-child { white-space: nowrap; }
.table-wrap table:has(th:nth-child(6)) { min-width: 920px; }
/* مفتاح الدولة مع العلم */
.phone-input .cc-native { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.phone-input { position: relative; }
.cc-pick { position: relative; }
.cc-btn { display: inline-flex; align-items: center; gap: .45rem; width: auto; min-width: 112px; height: 100%; cursor: pointer; background: #fff; padding-inline: .6rem; font: inherit; color: inherit; direction: ltr; }
.cc-flag { width: 22px; height: 16px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(15, 23, 42, .12); flex-shrink: 0; }
.cc-caret { margin-inline-start: auto; color: #94a3b8; font-size: .8rem; }
.cc-list { position: absolute; z-index: 60; top: calc(100% + 4px); inset-inline-start: 0; min-width: 220px; margin: 0; padding: .3rem; list-style: none; background: #fff; border: 1px solid var(--line, #e2e8f0); border-radius: 12px; box-shadow: 0 14px 34px rgba(15, 23, 42, .16); max-height: 280px; overflow-y: auto; }
.cc-list li { display: flex; align-items: center; gap: .6rem; padding: .55rem .65rem; border-radius: 8px; cursor: pointer; direction: rtl; }
.cc-list li:hover, .cc-list li:focus { background: #f1f5f9; outline: none; }
.cc-list li[aria-selected=true] { background: var(--brand-50, #eef2ff); font-weight: 700; }
.cc-list .cc-name { flex: 1; }
.cc-list .cc-code { direction: ltr; color: #64748b; font-variant-numeric: tabular-nums; }
/* شريط وضع الصيانة (للأدمن) */
.maint-bar { position: sticky; top: 0; z-index: 100; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .4rem .8rem; background: #b45309; color: #fff; padding: .45rem 1rem; font-size: .88rem; font-weight: 700; text-align: center; }
.maint-bar form { display: inline; margin: 0; }
.maint-bar button { background: #fff; color: #b45309; border: 0; border-radius: 8px; padding: .25rem .7rem; font: inherit; font-size: .82rem; cursor: pointer; }
.maint-card.on { border-color: #f59e0b; background: #fffbeb; }
.maint-go { background: #b45309; border-color: #b45309; }
.name-en-row { display: grid; grid-template-columns: 5.2rem 1fr; gap: .5rem; direction: ltr; }
.name-en-row .input { min-width: 0; }
.dr-tag { display: flex; align-items: center; justify-content: center; font-weight: 700; background: #f1f5f9; }
.completion-box { gap: .8rem; align-items: center; border-inline-start: 4px solid #cbd5e1; }
.completion-box.on { border-inline-start-color: #16a34a; background: #f0fdf4; }
.status.exempt { background: #ecfdf5; color: #047857; }
/* إغلاق الاشتراك */
.enroll-closed { background: #fff7e6; border: 1px solid #f2cf7a; color: #7a5300; border-radius: 12px; padding: 12px 14px; }
.enroll-closed strong { display: inline-block; margin-bottom: 2px; }
.enroll-closed p { margin: 4px 0 0; font-size: .92rem; color: #6b5a33; }
.enroll-closed-lg { margin-bottom: 16px; padding: 16px 18px; }
.check-done.check-off { background: #eef1f5; color: #8a94a3; font-size: .7rem; }
.subject:has(.check-off) { cursor: default; }
.enroll-card.off { border-color: #f2cf7a; }
/* مشغّل Google Drive: يغطّي زر «فتح في Drive» أعلى المشغّل */
.drive-video { position: relative; }
.drive-shield { position: absolute; top: 0; right: 0; width: 84px; height: 64px; z-index: 2; background: transparent; }
.drive-actions { display: flex; justify-content: flex-start; margin-top: 8px; }
.drive-video.scaled iframe { position: absolute; top: 0; left: 0; width: 720px !important; max-width: none !important; height: 405px !important; transform-origin: 0 0; }
.drive-video, .drive-video iframe { -webkit-touch-callout: none; }
/* مشغّل الفيديو الخاص (شبيه بيوتيوب) */
.ytp { position: relative; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; outline: none; font-family: Roboto, Arial, sans-serif; color: #fff; }
.ytp video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.ytp.fs { border-radius: 0; aspect-ratio: auto; width: 100vw; height: 100vh; }
.ytp-big { position: absolute; inset: 0; margin: auto; width: 96px; height: 96px; padding: 10px; border: 0; border-radius: 24px; background: #fff; box-shadow: 0 6px 24px rgba(0,0,0,.35); cursor: pointer; z-index: 3; transition: transform .15s; }
.ytp-big:hover { transform: scale(1.06); }
.ytp-big img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.ytp-big-play { position: absolute; right: -10px; bottom: -10px; width: 38px; height: 38px; border-radius: 50%; background: var(--brand, #1e4a84); border: 3px solid #fff; display: grid; place-items: center; }
.ytp-big-play svg { width: 18px; height: 18px; fill: #fff; margin-left: 2px; }
.ytp.playing .ytp-big { display: none; }
@media (max-width: 520px) { .ytp-big { width: 76px; height: 76px; padding: 8px; border-radius: 20px; } .ytp-big-play { width: 32px; height: 32px; } }
.ytp-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; padding: 0 12px 4px; background: linear-gradient(transparent, rgba(0,0,0,.75)); opacity: 0; transition: opacity .25s; }
.ytp.ctl .ytp-bar, .ytp:not(.playing) .ytp-bar, .ytp.scrub .ytp-bar { opacity: 1; }
.ytp.playing:not(.ctl) { cursor: none; }
.ytp-progress { position: relative; height: 16px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.ytp-track { position: relative; width: 100%; height: 3px; background: rgba(255,255,255,.25); transition: height .1s; }
.ytp-progress:hover .ytp-track, .ytp.scrub .ytp-track { height: 5px; }
.ytp-buf, .ytp-played { position: absolute; top: 0; bottom: 0; left: 0; width: 0; }
.ytp-buf { background: rgba(255,255,255,.4); }
.ytp-played { background: var(--teal, #5cbfc5); }
.ytp-thumb { position: absolute; top: 50%; left: 0; width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; border-radius: 50%; background: var(--teal, #5cbfc5); box-shadow: 0 0 0 2px rgba(30,74,132,.6); transform: scale(0); transition: transform .1s; }
.ytp-progress:hover .ytp-thumb, .ytp.scrub .ytp-thumb, .ytp:not(.playing).started .ytp-thumb { transform: scale(1); }
.ytp-tip { position: absolute; bottom: 20px; transform: translateX(-50%); background: rgba(28,28,28,.9); padding: 3px 7px; border-radius: 4px; font-size: 12px; white-space: nowrap; pointer-events: none; }
.ytp-row { display: flex; align-items: center; gap: 2px; height: 40px; }
.ytp-btn { width: 40px; height: 40px; padding: 8px; border: 0; background: none; color: #fff; cursor: pointer; opacity: .92; position: relative; flex: none; }
.ytp-btn:hover { opacity: 1; }
.ytp-btn svg { width: 100%; height: 100%; fill: #fff; }
.ytp-btn text { fill: #fff; }
.ytp .i-pause, .ytp.playing .i-play, .ytp .i-x, .ytp.muted .i-wave, .ytp .i-exit, .ytp.fs .i-enter { display: none; }
.ytp.playing .i-pause, .ytp.muted .i-x, .ytp.fs .i-exit { display: inline; }
.ytp-vol { display: flex; align-items: center; }
.ytp-volume { width: 0; opacity: 0; transition: width .2s, opacity .2s; accent-color: var(--teal, #5cbfc5); height: 4px; margin: 0; }
.ytp-vol:hover .ytp-volume, .ytp-volume:focus { width: 64px; opacity: 1; margin-right: 6px; }
.ytp-time { font-size: 13px; padding: 0 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ytp-gap { flex: 1; }
.ytp-menu-wrap { position: relative; }
.ytp-rate-badge { position: absolute; top: 3px; right: 0; background: var(--teal-dark, #3fa6ad); color: #fff; font-size: 9px; font-weight: 700; padding: 0 3px; border-radius: 2px; line-height: 13px; }
.ytp-menu { position: absolute; bottom: 46px; right: -40px; min-width: 150px; overflow-y: auto; overscroll-behavior: contain; background: rgba(28,28,28,.92); border-radius: 12px; padding: 8px 0; z-index: 6; }
.ytp-menu-title { font-size: 12px; opacity: .7; padding: 4px 16px 6px; }
.ytp-menu button { display: block; width: 100%; text-align: left; padding: 8px 16px 8px 34px; border: 0; background: none; color: #fff; font-size: 14px; cursor: pointer; position: relative; }
.ytp-menu button:hover { background: rgba(255,255,255,.1); }
.ytp-menu button.on::before { content: '✓'; position: absolute; left: 12px; color: var(--teal, #5cbfc5); }
.ytp-spinner { position: absolute; inset: 0; margin: auto; width: 48px; height: 48px; border: 4px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%; animation: ytp-spin .8s linear infinite; z-index: 2; pointer-events: none; }
@keyframes ytp-spin { to { transform: rotate(360deg); } }
.ytp-seek { position: absolute; top: 50%; transform: translateY(-50%); padding: 14px 18px; border-radius: 40px; background: rgba(0,0,0,.45); font-size: 15px; font-weight: 700; opacity: 0; pointer-events: none; z-index: 2; }
.ytp-seek-back { left: 8%; } .ytp-seek-fwd { right: 8%; }
.ytp-seek.show { animation: ytp-flash .6s ease-out; }
@keyframes ytp-flash { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }
@media (max-width: 520px) {
  .ytp-back10, .ytp-fwd10, .ytp-volume { display: none; }
  .ytp-btn { width: 36px; height: 36px; padding: 7px; }
  .ytp-time { font-size: 12px; }
  .ytp-bar { padding: 0 8px 2px; }
}
@media (prefers-reduced-motion: reduce) { .ytp-seek.show { animation: none; } .ytp-spinner { animation-duration: 2s; } }
