@font-face { font-family: 'IBM Plex Sans Arabic'; font-weight: 400; font-display: swap; src: url(/fonts/plex/ibm-plex-sans-arabic-arabic-400-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-weight: 400; font-display: swap; src: url(/fonts/plex/ibm-plex-sans-arabic-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-weight: 600; font-display: swap; src: url(/fonts/plex/ibm-plex-sans-arabic-arabic-600-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-weight: 600; font-display: swap; src: url(/fonts/plex/ibm-plex-sans-arabic-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Readex Pro'; font-weight: 600; font-display: swap; src: url(/fonts/readex/readex-pro-arabic-600-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Readex Pro'; font-weight: 600; font-display: swap; src: url(/fonts/readex/readex-pro-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  /* Mada Alhayat Digital identity: violet + mint ("learning and vitality"). */
  --ink: #3D3A57; --heading: #221E40; --soft: #5E5A78; --line: #E1DEF0; --bg: #F5F4FB; --card: #FFFFFF;
  --brand: #3E3496; --brand-2: #2F2775; --brand-soft: #ECEAF8;
  --accent: #2FB592; --on-accent: #06372A; --accent-text: #1A7A60; --accent-soft: #E3F5EF; --accent-line: #A8DFCD;
  --ok: #2E7D32; --bad: #A23B2C; --bad-soft: #F3E3E0; --focus: #5B51C4;
  --radius: 12px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font-family: 'IBM Plex Sans Arabic', Tahoma, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }
h1, h2, h3 { font-family: 'Readex Pro', 'IBM Plex Sans Arabic', Tahoma, sans-serif; font-weight: 600; line-height: 1.3; margin: 0 0 .5em; text-wrap: balance; color: var(--heading); }
h1 { font-size: 1.9rem; } h2 { font-size: 1.4rem; } h3 { font-size: 1.1rem; }
a { color: var(--brand); }
.top { display: flex; align-items: center; gap: 16px; padding: 12px 20px; background: var(--card); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-family: 'Readex Pro', sans-serif; font-weight: 600; font-size: 1.15rem; color: var(--brand); text-decoration: none; }
.nav { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.nav a, .nav button { padding: 6px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); background: none; border: 0; font: inherit; cursor: pointer; }
.nav a.on { background: var(--brand-soft); color: var(--brand); }
.lang { background: none; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font: inherit; cursor: pointer; }
.lang:hover { border-color: var(--brand); }
.view { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 28px 16px; outline: none; }
.foot { display: flex; gap: 16px; justify-content: center; padding: 16px; color: var(--soft); font-size: .9rem; border-top: 1px solid var(--line); flex-wrap: wrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.narrow { max-width: 460px; margin: 0 auto; }
.muted { color: var(--soft); }
.small { font-size: .88rem; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .95rem; }
input, select, textarea { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); width: 100%; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.check { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 400; }
.check input { width: auto; margin-top: 5px; }
.btn { font: inherit; font-weight: 600; padding: 10px 18px; border-radius: 8px; border: 1px solid var(--brand); background: var(--brand); color: #fff; cursor: pointer; }
.btn:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn.ghost { background: transparent; color: var(--brand); }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.accent:hover { background: #3FC4A0; border-color: #3FC4A0; }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.sm { padding: 5px 10px; font-size: .88rem; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); }
.tabs button { font: inherit; color: var(--ink); padding: 8px 14px; border: 0; background: none; cursor: pointer; border-bottom: 3px solid transparent; }
.tabs button.on { border-color: var(--brand); color: var(--brand); font-weight: 600; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: start; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--soft); font-weight: 600; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: .82rem; }
.pill.off { background: var(--bad-soft); color: var(--bad); }
.hero { display: grid; gap: 20px; padding: 36px 0 12px; }
.hero p { font-size: 1.1rem; color: var(--soft); max-width: 62ch; margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.tile h3 { color: var(--brand); }
.qr { width: 200px; height: 200px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.code { font-family: ui-monospace, Menlo, monospace; direction: ltr; unicode-bidi: embed; word-break: break-all; background: #EFEEF6; padding: 6px 10px; border-radius: 6px; }
.banner { background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--radius); padding: 14px 18px; }
.policy h3 { margin-top: 1em; }
.toasts { position: fixed; bottom: 16px; inset-inline-start: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 50; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; background: var(--heading); color: #fff; padding: 12px 14px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.toast.bad { background: var(--bad); }
.toast span { flex: 1; }
.toast button { background: none; border: 0; color: #fff; font-size: 1.1rem; cursor: pointer; line-height: 1; }
@media (max-width: 640px) { h1 { font-size: 1.5rem; } .card { padding: 16px; } }

/* Learning */
.course-card { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 6px; }
.course-card:hover { border-color: var(--brand); }
.outline { margin: 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 6px; }
.player { position: relative; background: #120F2A; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; max-width: 100%; }
.player video { width: 100%; height: 100%; display: block; }
.wm { position: absolute; top: 10%; left: 10%; color: rgba(255,255,255,.45); font-size: .85rem; pointer-events: none; user-select: none; transition: top 1.2s ease, left 1.2s ease; direction: ltr; text-shadow: 0 0 2px rgba(0,0,0,.6); }
.lesson-text p { max-width: 70ch; }
.bar { height: 8px; background: #E7E5F3; border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); width: 0; }
.bar .w10 { width: 10%; } .bar .w20 { width: 20%; } .bar .w30 { width: 30%; } .bar .w40 { width: 40%; } .bar .w50 { width: 50%; }
.bar .w60 { width: 60%; } .bar .w70 { width: 70%; } .bar .w80 { width: 80%; } .bar .w90 { width: 90%; } .bar .w100 { width: 100%; }

/* Studio */
.module { border-top: 1px solid var(--line); padding-top: 14px; }
.module h3 { display: flex; gap: 10px; align-items: center; }
details.lesson { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: #FAF9FD; }
details.lesson summary { cursor: pointer; font-weight: 600; }
details.lesson[open] summary { margin-bottom: 12px; }
.lesson-form textarea { resize: vertical; }
.file input { padding: 6px; }
input:disabled, select:disabled, textarea:disabled { background: #F1F0F7; color: var(--soft); }

/* Assessment */
fieldset.question { margin: 0; border: 1px solid var(--line); }
fieldset.question legend { font-size: .85rem; color: var(--soft); padding: 0 6px; }
.stem { font-weight: 600; margin: 0 0 6px; }
.option { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin-top: 6px; cursor: pointer; }
.option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.question.ok { border-inline-start: 4px solid var(--ok); }
.question.bad { border-inline-start: 4px solid var(--bad); }
.timer { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; align-self: flex-start; background: var(--heading); color: #fff; padding: 8px 14px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.big { font-size: 1.4rem; font-weight: 600; margin: 0; }
td.num { font-variant-numeric: tabular-nums; width: 4em; }
table.analysis td { vertical-align: middle; }
table.analysis td.bar-cell { width: 50%; min-width: 120px; }
.inline-list { display: inline; margin: 0; padding: 0; list-style: none; }
.inline-list li { display: inline; }
.inline-list li + li::before { content: ' · '; color: var(--soft); }

/* Certificate */
.cert-wrap { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; border: 2px solid var(--accent); }
.cert { flex: 1; min-width: 260px; text-align: center; display: flex; flex-direction: column; gap: 4px; }
.cert p { margin: 0; }
.cert-brand { font-family: 'Readex Pro', sans-serif; color: var(--brand); font-weight: 600; }
.cert-name, .cert-course { font-family: 'Readex Pro', sans-serif; font-size: 1.35rem; font-weight: 600; color: var(--brand); }
.cert-qr { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cert-qr img { width: 140px; height: 140px; }
@media print {
  .top, .foot, .toasts, .no-print { display: none !important; }
  body { background: #fff; }
  .view { max-width: none; padding: 0; }
  .card { border: 0; }
  .cert-wrap { border: 2px solid var(--accent); min-height: 90vh; }
}
.nowrap { white-space: nowrap; word-break: normal; }
.pill.ai { background: var(--accent-soft); color: #0F5E49; }
label.inline { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.num-in { width: 90px; }

/* Sales */
.price { font-family: 'Readex Pro', sans-serif; font-weight: 600; font-size: 1.2rem; color: var(--brand); }
.pill.mid { background: var(--accent-soft); color: var(--accent-text); }
fieldset.people { border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }
.btn.on { background: var(--brand-soft); }
.invoice table td, .invoice table th { padding: 8px; }
.inv-head { justify-content: space-between; align-items: flex-start; }
.inv-qr { width: 130px; height: 130px; }
.inv-parties { gap: 40px; align-items: flex-start; }
.inv-parties p { margin: 2px 0; }

/* Questions inside a lesson */
.checkpoint fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.checkpoint legend { padding: 0; }
.option.right { border-color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok); }
.player .cp-overlay { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(18, 15, 42, .88); overflow-y: auto; }
.cp-overlay .checkpoint { width: min(640px, 100%); max-height: 100%; overflow-y: auto; }
.cp-result:empty { display: none; }
/* Where "review the section" and the points to review lead to */
.sec-anchor { scroll-margin-top: 16px; }
.sec-anchor:focus, #reviewCard:focus { outline: none; }
h4 { margin: 0; font-size: 1rem; color: var(--heading); }
