/* أكاديمية أدفوكتس جروب — الهوية: كحلي وذهبي وأبيض (من الملف التعريفي) */
@font-face { font-family: "Tajawal"; src: url("../fonts/Tajawal-Light.ttf") format("truetype"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Tajawal"; src: url("../fonts/Tajawal-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Tajawal"; src: url("../fonts/Tajawal-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Tajawal"; src: url("../fonts/Tajawal-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Tajawal"; src: url("../fonts/Tajawal-ExtraBold.ttf") format("truetype"); font-weight: 800; font-display: swap; }

:root {
  --navy: #0A0C24; --navy-2: #141838; --navy-3: #22285a;
  --gold: #C8924A; --gold-soft: #D2AE6D; --gold-pale: #F4EBDD;
  --paper: #F6F4F0; --white: #FFFFFF; --ink: #1B1B2A; --muted: #6B6B7B; --line: #E4E0D8;
  --ok: #1E7A4C; --ok-bg: #E6F4EC; --warn: #9A6A00; --warn-bg: #FFF5DD; --bad: #B3261E; --bad-bg: #FCE8E6; --info-bg: #EAF0FB;
  --radius: 14px; --radius-sm: 9px; --shadow: 0 1px 2px rgba(10,12,36,.06), 0 6px 24px rgba(10,12,36,.06);
  --brand: var(--navy); --accent: var(--gold);
  --fs: 16px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: var(--fs); }
body { margin: 0; font-family: "Tajawal", system-ui, sans-serif; color: var(--ink); background: var(--paper); line-height: 1.7; }
a { color: var(--navy-3); text-decoration: none; }
a:hover { color: var(--gold); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.35; margin: 0 0 .6rem; color: var(--navy); }
h1 { font-size: 1.75rem; font-weight: 800; } h2 { font-size: 1.3rem; font-weight: 700; } h3 { font-size: 1.08rem; font-weight: 700; }
p { margin: 0 0 .8rem; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.muted { color: var(--muted); } .small { font-size: .88rem; } .center { text-align: center; }
.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.grid { display: grid; gap: 1rem; }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.c4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.skip { position: absolute; inset-inline-start: -999px; } .skip:focus { inset-inline-start: 1rem; top: 1rem; z-index: 99; background: #fff; padding: .5rem 1rem; }

/* أزرار */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid transparent; border-radius: 999px;
  padding: .62rem 1.25rem; font: inherit; font-weight: 700; cursor: pointer; background: var(--brand); color: #fff; min-height: 44px; }
.btn:hover { filter: brightness(1.15); color: #fff; }
.btn.gold { background: var(--accent); color: var(--navy); } .btn.gold:hover { color: var(--navy); }
.btn.ghost { background: transparent; color: var(--brand); border-color: currentColor; } .btn.ghost:hover { color: var(--accent); }
.btn.light { background: #fff; color: var(--navy); border-color: var(--line); }
.btn.danger { background: var(--bad); } .btn.sm { padding: .3rem .85rem; min-height: 34px; font-size: .9rem; }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }
.linkbtn { background: none; border: 0; color: var(--navy-3); font: inherit; cursor: pointer; padding: 0; }

/* بطاقات */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.kpi { display: flex; flex-direction: column; gap: .2rem; }
.kpi .v { font-size: 1.9rem; font-weight: 800; color: var(--navy); line-height: 1.1; }
.kpi .l { color: var(--muted); font-size: .92rem; }
.kpi.gold { border-top: 4px solid var(--gold); }
.badge { display: inline-block; padding: .1rem .6rem; border-radius: 999px; font-size: .82rem; font-weight: 700; background: var(--info-bg); color: var(--navy-3); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); } .badge.gold { background: var(--gold-pale); color: #7a5520; }
.alert { border-radius: var(--radius-sm); padding: .8rem 1rem; margin-bottom: 1rem; background: var(--info-bg); border-inline-start: 4px solid var(--navy-3); }
.alert.success { background: var(--ok-bg); border-color: var(--ok); } .alert.error { background: var(--bad-bg); border-color: var(--bad); }
.alert.warning { background: var(--warn-bg); border-color: var(--warn); }
.progress { height: 9px; background: #ECE8E0; border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-soft)); border-radius: 99px; }

/* نماذج */
label { display: block; font-weight: 700; margin-bottom: .25rem; font-size: .95rem; }
.field { margin-bottom: .9rem; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], input[type=search], input[type=tel], input[type=file], input[type=color], select, textarea {
  width: 100%; font: inherit; padding: .6rem .8rem; border: 1px solid #CFCAC0; border-radius: var(--radius-sm); background: #fff; color: var(--ink); min-height: 44px; }
input[type=color] { padding: .2rem; width: 80px; }
textarea { min-height: 110px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 3px solid var(--gold-soft); outline-offset: 1px; }
.check { display: flex; gap: .5rem; align-items: flex-start; font-weight: 500; }
.check input { width: 20px; height: 20px; margin-top: .25rem; flex: none; }
.help { color: var(--muted); font-size: .85rem; margin-top: .2rem; }
.errorlist { color: var(--bad); margin: .2rem 0; padding: 0; list-style: none; font-size: .9rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem; margin: 0 0 1rem; }
legend { font-weight: 800; padding: 0 .4rem; color: var(--navy); }
.inline-form { display: inline; }

/* جداول */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table.t { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.t th { background: var(--navy); color: #fff; font-weight: 700; text-align: start; padding: .6rem .7rem; white-space: nowrap; position: sticky; top: 0; }
table.t td { padding: .55rem .7rem; border-top: 1px solid var(--line); vertical-align: top; }
table.t tr:hover td { background: #FBF9F5; }
table.t td.num { white-space: nowrap; }

/* الموقع العام */
.site-header { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 30; }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 72px; }
.brand { display: flex; align-items: center; gap: .7rem; color: #fff; }
.brand img { height: 52px; width: auto; }
.brand .t { line-height: 1.2; } .brand .t b { display: block; font-size: 1.05rem; } .brand .t small { color: var(--gold-soft); letter-spacing: .08em; font-size: .7rem; }
.site-nav { display: flex; gap: .2rem; align-items: center; flex-wrap: wrap; }
.site-nav a { color: #E9E6F2; padding: .45rem .7rem; border-radius: 999px; font-weight: 500; }
.site-nav a:hover, .site-nav a.on { color: var(--navy); background: var(--gold-soft); }
.nav-toggle { display: none; background: none; border: 1px solid #ffffff55; color: #fff; border-radius: 10px; padding: .4rem .7rem; font: inherit; }
.hero { background: radial-gradient(1200px 500px at 85% -10%, #2a2f6a 0%, transparent 60%), var(--navy); color: #fff; padding: 4.5rem 0 3.5rem; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset-inline-start: 0; top: 0; width: 34%; height: 100%; background: var(--gold-soft); opacity: .1; clip-path: polygon(0 0, 100% 0, 60% 100%, 0 100%); }
.hero h1 { color: #fff; font-size: clamp(1.8rem, 4vw, 2.8rem); }
.hero .tag { color: var(--gold-soft); font-size: 1.2rem; font-weight: 500; }
.hero .en { letter-spacing: .25em; color: #C9C6DA; font-size: .85rem; }
.section { padding: 3rem 0; }
.section.alt { background: #fff; }
.section-title { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.4rem; }
.section-title::before { content: ""; width: 34px; height: 4px; background: var(--gold); border-radius: 4px; }
.feature { border-top: 4px solid var(--gold); }
.feature .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--gold-pale); display: grid; place-items: center; color: var(--navy); font-weight: 800; margin-bottom: .6rem; }
.site-footer { background: var(--navy); color: #CFCDE0; padding: 2.5rem 0 1.5rem; margin-top: 3rem; }
.site-footer a { color: var(--gold-soft); } .site-footer h3 { color: #fff; }

/* التطبيق (لوحات) */
.app { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.side { background: var(--brand); color: #fff; padding: 1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand img { height: 44px; }
.side nav { margin-top: 1.2rem; display: flex; flex-direction: column; gap: .15rem; }
.side nav a { color: #DCDAEA; padding: .5rem .8rem; border-radius: 10px; }
.side nav a:hover, .side nav a.on { background: #ffffff18; color: #fff; }
.side nav .sep { color: var(--gold-soft); font-size: .78rem; margin: .9rem .8rem .2rem; letter-spacing: .05em; }
.main { padding: 1.5rem; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.topbar .who { color: var(--muted); font-size: .92rem; }
.app-menu-btn { display: none; }
.breadcrumbs { font-size: .9rem; color: var(--muted); margin-bottom: .4rem; }
.tabs { display: flex; gap: .3rem; border-bottom: 2px solid var(--line); margin-bottom: 1rem; flex-wrap: wrap; }
.tabs a { padding: .5rem .9rem; border-radius: 10px 10px 0 0; color: var(--muted); font-weight: 700; }
.tabs a.on { color: var(--navy); border-bottom: 3px solid var(--gold); margin-bottom: -2px; }

/* بوابة الجهة */
.portal-hero { min-height: 100vh; display: grid; place-items: center; padding: 2rem 16px; background: var(--brand); color: #fff; position: relative; background-size: cover; background-position: center; }
.portal-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,12,36,.55), rgba(10,12,36,.85)); }
.portal-card { position: relative; width: min(640px, 100%); text-align: center; }
.portal-card .org-logo { max-height: 110px; background: #fff; padding: .8rem; border-radius: 18px; margin-bottom: 1rem; }
.portal-card h1 { color: #fff; font-size: clamp(1.5rem, 4vw, 2.3rem); }
.portal-card .welcome { color: #ECEAF5; font-size: 1.08rem; white-space: pre-line; }
.portal-card .contact { margin-top: 1.4rem; color: #D5D2E6; font-size: .92rem; }
.portal-card .academy { margin-top: 2rem; display: flex; align-items: center; justify-content: center; gap: .6rem; color: #D5D2E6; font-size: .85rem; }
.portal-card .academy img { height: 44px; }
.preview-ribbon { position: fixed; top: 0; inset-inline: 0; z-index: 50; background: var(--warn); color: #fff; text-align: center; padding: .4rem; font-weight: 700; }

/* المشغّل */
.player { background: #000; border-radius: var(--radius); overflow: hidden; position: relative; }
.player video { width: 100%; display: block; max-height: 72vh; background: #000; }
.ctrls { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; padding: .6rem; background: var(--navy); color: #fff; }
.ctrls button { background: #ffffff1a; color: #fff; border: 0; border-radius: 8px; padding: .45rem .7rem; font: inherit; cursor: pointer; min-height: 40px; }
.ctrls button:hover { background: #ffffff33; }
.seek { flex: 1 1 200px; position: relative; height: 26px; display: flex; align-items: center; cursor: pointer; }
.seek .rail { position: absolute; inset-inline: 0; height: 8px; background: #ffffff33; border-radius: 9px; }
.seek .watched, .seek .lock, .seek .pos { position: absolute; height: 8px; border-radius: 9px; }
.seek .watched { background: var(--gold-soft); opacity: .55; }
.seek .lock { background: repeating-linear-gradient(45deg, #ffffff22 0 6px, transparent 6px 12px); }
.seek .pos { background: var(--gold); }
.seek .mark { position: absolute; width: 4px; height: 18px; background: #fff; border-radius: 2px; transform: translateX(50%); }
.seek .mark.passed { background: var(--ok); }
.ctrls input[type=range] { width: 90px; min-height: auto; padding: 0; }
.doc-viewer { background: #2b2d3d; border-radius: var(--radius); padding: .8rem; text-align: center; }
.doc-viewer img { max-height: 76vh; background: #fff; border-radius: 6px; }
.doc-viewer.zoom img { max-height: none; width: 100%; }
.locked-page { color: #fff; padding: 5rem 1rem; }
.quiz-modal { position: fixed; inset: 0; background: rgba(10,12,36,.72); display: none; place-items: center; z-index: 80; padding: 16px; }
.quiz-modal.open { display: grid; }
.quiz-box { background: #fff; border-radius: var(--radius); width: min(720px, 100%); max-height: 92vh; overflow-y: auto; padding: 1.4rem; }
.q { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .8rem; margin-bottom: .7rem; }
.q .opts { display: flex; gap: .6rem; margin-top: .4rem; }
.q .opts label { display: flex; gap: .4rem; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: .35rem .9rem; font-weight: 500; cursor: pointer; }
.q.right { border-color: var(--ok); background: var(--ok-bg); } .q.wrong { border-color: var(--bad); background: var(--bad-bg); }
body.big-text { --fs: 19px; }

/* شاشات صغيرة */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset-inline-start: 0; top: 0; width: 82%; max-width: 300px; z-index: 60; transform: translateX(110%); transition: transform .2s; }
  .side.open { transform: none; }
  .app-menu-btn { display: inline-flex; }
  .main { padding: 1rem; }
  .nav-toggle { display: inline-block; }
  .site-nav { display: none; position: absolute; top: 72px; inset-inline: 0; background: var(--navy); flex-direction: column; padding: .8rem 16px 1rem; align-items: stretch; }
  .site-nav.open { display: flex; }
  .brand .t b { font-size: .95rem; }
}
@media print {
  .side, .topbar .actions, .no-print, .site-header, .site-footer, .btn, form.filters { display: none !important; }
  .app { display: block; } .main { padding: 0; } body { background: #fff; font-size: 11pt; }
  .card { box-shadow: none; border: 0; padding: 0; } table.t th { background: #eee !important; color: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .table-wrap { overflow: visible; border: 0; }
  @page { size: A4 landscape; margin: 12mm; }
}

.lang-switch { display: inline-flex; align-items: center; border: 1px solid currentColor; border-radius: 999px; padding: .25rem .8rem; font-size: .88rem; font-weight: 700; color: inherit; white-space: nowrap; }
.site-nav .lang-switch { color: #E9E6F2; }
[dir="ltr"] .hero::after { clip-path: polygon(40% 0, 100% 0, 100% 100%, 0 100%); }
