/* ==========================================================================
   Design tokens
   ========================================================================== */
@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: optional; /* never swap fonts after first paint: no text jumping */
  font-weight: 100 900;
  src: url(/vendor/inter.woff2) format('woff2-variations');
}

:root {
  --wm-guard: 1; /* the video player stops if this stylesheet is removed */
  --font: 'Inter Variable', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e5e9f0;
  --line-strong: #cfd6e1;
  --bg: #f6f7fa;
  --surface: #ffffff;
  --surface-2: #f9fafc;

  --primary: #1f4fd1;
  --primary-hover: #1941b0;
  --primary-soft: #eaf0fe;
  --primary-ink: #173a9a;

  --navy: #0b1a33;
  --navy-2: #12284c;
  --teal: #2dd4bf;

  --success: #0d7a55;
  --success-soft: #e6f5ee;
  --warning: #a35a07;
  --warning-soft: #fdf4e3;
  --danger: #c0352a;
  --danger-soft: #fdeceb;
  --info: #1f4fd1;
  --info-soft: #eaf0fe;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 20px rgba(15, 23, 42, .06);
  --shadow-lg: 0 12px 40px rgba(11, 26, 51, .16);

  --container: 1180px;
  --header-h: 68px;
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-gutter: stable; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; letter-spacing: -0.015em; color: var(--ink); }
h1 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); font-weight: 700; }
h2 { font-size: 1.45rem; font-weight: 650; }
h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0 0 1em; }
small { font-size: .85em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
:focus-visible { outline: 3px solid rgba(31, 79, 209, .45); outline-offset: 2px; border-radius: 6px; }
.icon { flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; }
.tabular { font-variant-numeric: tabular-nums; }
.pre-line { white-space: pre-line; }
.text-right { text-align: end; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.grow { flex: 1; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink);
  --btn-border: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  height: 42px; padding: 0 18px;
  font: inherit; font-weight: 600; font-size: .95rem; line-height: 1;
  color: var(--btn-fg); background: var(--btn-bg);
  border: 1px solid var(--btn-border); border-radius: 10px;
  cursor: pointer; white-space: nowrap; user-select: none;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { --btn-bg: var(--surface-2); color: var(--btn-fg); border-color: var(--faint); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn-primary { --btn-bg: var(--primary); --btn-fg: #fff; --btn-border: var(--primary); box-shadow: 0 1px 2px rgba(31, 79, 209, .3); }
.btn-primary:hover { --btn-bg: var(--primary-hover); border-color: var(--primary-hover); }
.btn-success { --btn-bg: var(--success); --btn-fg: #fff; --btn-border: var(--success); }
.btn-success:hover { --btn-bg: #0a6648; border-color: #0a6648; }
.btn-danger { --btn-bg: var(--surface); --btn-fg: var(--danger); --btn-border: #efc2be; }
.btn-danger:hover { --btn-bg: var(--danger-soft); border-color: var(--danger); }
.btn-ghost { --btn-bg: transparent; --btn-border: transparent; --btn-fg: var(--ink-2); }
.btn-ghost:hover { --btn-bg: rgba(15, 23, 42, .05); border-color: transparent; }
.btn-light { --btn-bg: #fff; --btn-fg: var(--navy); --btn-border: #fff; }
.btn-light:hover { --btn-bg: #eef2fb; border-color: #eef2fb; color: var(--navy); }
.btn-outline-light { --btn-bg: transparent; --btn-fg: #fff; --btn-border: rgba(255, 255, 255, .35); }
.btn-outline-light:hover { --btn-bg: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .6); }
.btn-lg { height: 50px; padding: 0 24px; font-size: 1rem; border-radius: 12px; }
.btn-danger-solid { --btn-bg: var(--danger); --btn-fg: #fff; --btn-border: var(--danger); }
.btn-danger-solid:hover { --btn-bg: #a32b22; border-color: #a32b22; color: #fff; }
.btn-sm { height: 34px; padding: 0 12px; font-size: .85rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-link { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; font-weight: 600; }
.btn-link:hover { color: var(--primary-hover); text-decoration: underline; }
.inline-form { display: inline; margin: 0; }

/* ==========================================================================
   Forms
   ========================================================================== */
.field { margin-bottom: 1.1rem; }
.field label, .label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .4rem; color: var(--ink); }
.field .hint { font-size: .82rem; color: var(--muted); margin-top: .35rem; }
.field .error { font-size: .84rem; color: var(--danger); margin-top: .35rem; display: flex; gap: .35rem; align-items: center; }
.input, select.input, textarea.input {
  display: block; width: 100%;
  height: 44px; padding: 0 14px;
  font: inherit; color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 120px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.input::placeholder { color: var(--faint); }
.input:hover { border-color: var(--faint); }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(31, 79, 209, .14); }
.input.has-error { border-color: var(--danger); }
.input.has-error:focus { box-shadow: 0 0 0 4px rgba(192, 53, 42, .14); }
.input-code { font-size: 1.6rem; letter-spacing: .5em; text-align: center; height: 58px; font-variant-numeric: tabular-nums; }
.input-prefix { position: relative; }
.input-prefix > span { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; }
.input-prefix > .input { padding-inline-start: 52px; }
.password-field { position: relative; }
.password-field .input { padding-inline-end: 52px; }
.password-toggle {
  position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 40px; display: grid; place-items: center;
  background: none; border: 0; border-radius: 8px; color: var(--muted); cursor: pointer;
}
.password-toggle:hover { color: var(--ink); background: rgba(15, 23, 42, .05); }
.password-toggle[aria-pressed="true"] { color: var(--primary); }
.checkbox { display: flex; gap: .6rem; align-items: flex-start; cursor: pointer; font-weight: 500; }
.checkbox input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   Alerts, badges
   ========================================================================== */
.alert {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: 12px 16px; border-radius: 10px; border: 1px solid transparent;
  font-size: .93rem; line-height: 1.5;
}
.alert .icon { margin-top: 2px; }
.alert-success { background: var(--success-soft); color: #075e41; border-color: #bfe6d4; }
.alert-error { background: var(--danger-soft); color: #962217; border-color: #f4c7c3; }
.alert-warning { background: var(--warning-soft); color: #7c4405; border-color: #f2d9a8; }
.alert-info { background: var(--info-soft); color: var(--primary-ink); border-color: #cddafb; }
.alert-close { margin-inline-start: auto; background: none; border: 0; color: inherit; opacity: .6; cursor: pointer; padding: 2px; border-radius: 6px; }
.alert-close:hover { opacity: 1; }
.flash-stack { display: grid; gap: .6rem; margin: 20px auto 0; }

.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  height: 26px; padding: 0 10px;
  font-size: .78rem; font-weight: 600; line-height: 1;
  border-radius: 999px; white-space: nowrap;
  background: #eef1f6; color: var(--ink-2);
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--primary-ink); }
.badge-dark { background: rgba(11, 26, 51, .78); color: #fff; backdrop-filter: blur(6px); }
.badge-glass-success { background: rgba(6, 95, 70, .88); color: #fff; backdrop-filter: blur(6px); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ==========================================================================
   Header & footer
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); min-width: 0; }
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 40px; height: 40px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--navy-2), var(--primary));
  color: #fff; font-weight: 700; font-size: .95rem; letter-spacing: .02em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-name { font-weight: 700; font-size: 1rem; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: .76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.nav-link {
  display: inline-flex; align-items: center; gap: .45rem;
  height: 38px; padding: 0 12px; border-radius: 9px;
  color: var(--ink-2); font-weight: 550; font-size: .93rem;
  transition: background-color .18s ease, color .18s ease;
}
.nav-link:hover { background: rgba(15, 23, 42, .05); color: var(--ink); }
.nav-link.is-active { color: var(--primary); background: var(--primary-soft); }
/* Sliding highlight behind the active tab (created by nav.js) */
.nav { position: relative; }
.nav-link { position: relative; }
.nav-pill { position: absolute; left: 0; top: 0; border-radius: 9px; pointer-events: none; background: var(--primary-soft); }
.nav-pill.is-moving { transition: transform .35s cubic-bezier(.4, 0, .2, 1), width .35s cubic-bezier(.4, 0, .2, 1), height .35s cubic-bezier(.4, 0, .2, 1); }
.nav.has-pill .nav-link.is-active, .nav-pill-pending .nav .nav-link.is-active { background: transparent; }
.nav-sep { width: 1px; height: 24px; background: var(--line); margin: 0 8px; }
.nav .btn { height: 38px; }
.nav-toggle { display: none; }

/* Language buttons (EN / FR / عربي) */
.lang-switch { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); flex: none; }
.lang-switch a { display: inline-grid; place-items: center; min-width: 36px; height: 30px; padding: 0 8px; border-radius: 7px; color: var(--muted); font-size: .8rem; font-weight: 650; transition: background-color .18s ease, color .18s ease; }
.lang-switch a:hover { color: var(--ink); background: rgba(15, 23, 42, .05); }
.lang-switch a[aria-current] { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
.lang-switch a:lang(ar) { font-size: .86rem; }
.user-chip { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .9rem; color: var(--ink-2); padding: 0 8px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary-ink);
  font-size: .75rem; font-weight: 700;
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .lang-switch { margin-inline-start: auto; }
  .lang-switch a { min-width: 32px; padding: 0 6px; }
  .site-header .container { gap: 12px; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: var(--header-h);
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 12px 16px 16px; background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .nav.is-open { display: flex; }
  .nav .nav-pill { display: none; }
  .nav.has-pill .nav-link.is-active { background: var(--primary-soft); }
  .nav-sep { width: auto; height: 1px; margin: 8px 0; }
  .nav .btn, .nav form, .nav form .btn { width: 100%; }
  .user-chip { padding: 8px 12px; }
}

.site-footer { margin-top: 80px; border-top: 1px solid var(--line); background: var(--surface); }
.site-footer .container { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; padding-top: 28px; padding-bottom: 28px; font-size: .88rem; color: var(--muted); }
.footer-secure { display: inline-flex; align-items: center; gap: .45rem; }

/* ==========================================================================
   Cards, tables, layout helpers
   ========================================================================== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 18px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; font-size: 1.02rem; display: flex; align-items: center; gap: .5rem; }
.card-body { padding: 22px; }
.card-foot { padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th {
  text-align: start; font-size: .74rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); background: var(--surface-2);
  padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fbfcfe; }
.table .num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .cell-title { font-weight: 600; color: var(--ink); }
.table .cell-sub { font-size: .8rem; color: var(--muted); }
.table a.cell-title:hover { color: var(--primary); }
.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty .icon { margin: 0 auto 12px; color: var(--faint); }
.empty h3 { color: var(--ink); }

.page-head { padding: 40px 0 24px; }
.page-head p { color: var(--muted); margin: 0; }
.section { padding: 56px 0 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 24px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head p { margin: 0; color: var(--muted); }
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-size: .8rem; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--primary); }

/* ==========================================================================
   Home / hero
   ========================================================================== */
.hero {
  position: relative; overflow: hidden; color: #dbe5f7;
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(45, 212, 191, .18), transparent 60%),
    radial-gradient(700px 500px at 0% 120%, rgba(31, 79, 209, .45), transparent 60%),
    linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%);
}
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .9), transparent 85%);
}
.hero-inner { position: relative; display: grid; grid-template-columns: 1.25fr .9fr; gap: 56px; align-items: center; padding-top: 72px; padding-bottom: 80px; }
.hero .eyebrow { color: var(--teal); }
.hero h1 { color: #fff; font-size: clamp(2.1rem, 1.3rem + 3vw, 3.4rem); letter-spacing: -0.03em; margin: 14px 0 12px; }
.hero .lead { font-size: 1.2rem; color: #fff; opacity: .92; font-weight: 500; margin-bottom: .6rem; }
.hero .bio { max-width: 560px; color: #b9c7e0; font-size: 1.02rem; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero-panel {
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius-lg); padding: 26px; backdrop-filter: blur(8px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
.hero-panel h2 { color: #fff; font-size: 1.05rem; margin-bottom: 18px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.steps li { display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; }
.step-num {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(45, 212, 191, .14); color: var(--teal); font-weight: 700;
}
.steps strong { display: block; color: #fff; font-weight: 600; }
.steps span { font-size: .9rem; color: #a9b8d3; }
.hero-trust { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 34px; font-size: .88rem; color: #a9b8d3; }
.hero-trust span { display: inline-flex; align-items: center; gap: .45rem; }
.hero-trust .icon { color: var(--teal); }
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; gap: 36px; padding-top: 48px; padding-bottom: 56px; }
}

/* ==========================================================================
   Lecture cards
   ========================================================================== */
.lecture-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 24px; }
.lecture-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  color: var(--ink); box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.lecture-card:hover { color: var(--ink); transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.thumb { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(140deg, #dbe4f5, #eef2f9); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.lecture-card:hover .thumb img { transform: scale(1.03); }
.thumb-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: #8ea0c2; }
.thumb .badge { position: absolute; top: 12px; inset-inline-start: 12px; }
.thumb .duration { position: absolute; inset-inline-end: 10px; bottom: 10px; background: rgba(11, 26, 51, .82); color: #fff; font-size: .75rem; font-weight: 600; padding: 3px 8px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.thumb-play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(11, 26, 51, .0); opacity: 0; transition: opacity .2s, background-color .2s;
}
.thumb-play span { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .95); color: var(--primary); box-shadow: var(--shadow-lg); }
.thumb-play .icon { margin-left: 3px; }
.lecture-card:hover .thumb-play { opacity: 1; background: rgba(11, 26, 51, .25); }
.lecture-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.lecture-body h3 { font-size: 1.04rem; margin-bottom: 6px; }
.lecture-body p { color: var(--muted); font-size: .9rem; margin: 0 0 16px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lecture-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 14px; border-top: 1px solid var(--line); }
.price { font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; color: var(--ink); }
.price-sub { font-size: .78rem; color: var(--muted); font-weight: 500; }
.lecture-cta { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; font-size: .88rem; color: var(--primary); }
.lecture-cta.is-unlocked { color: var(--success); }

/* ==========================================================================
   Lecture page / player
   ========================================================================== */
.watch { padding-top: 28px; }
.back-link { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; font-size: .9rem; color: var(--muted); margin-bottom: 18px; }
.back-link:hover { color: var(--ink); }
.watch-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; }
@media (max-width: 980px) { .watch-grid { grid-template-columns: 1fr; } }
.watch-title { margin-top: 22px; }
.watch-meta { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: .9rem; margin-bottom: 18px; }
.watch-meta span { display: inline-flex; align-items: center; gap: .4rem; }
.description { color: var(--ink-2); font-size: .98rem; line-height: 1.7; }

.player-shell {
  position: relative; border-radius: var(--radius-lg); overflow: hidden; background: #000;
  aspect-ratio: 16 / 9; box-shadow: var(--shadow-lg);
  -webkit-user-select: none; user-select: none;
}
.player-shell video { width: 100%; height: 100%; background: #000; }
.player-shell .plyr { height: 100%; --plyr-color-main: var(--primary); --plyr-font-family: var(--font); }
.player-shell .plyr--video { border-radius: var(--radius-lg); }
.player-blocked {
  position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; text-align: center;
  background: radial-gradient(circle at 50% 40%, rgba(18, 40, 76, .96), rgba(11, 26, 51, .99)); color: #dbe5f7; padding: 24px;
}
.player-blocked h3 { color: #fff; }
.player-blocked .icon { margin: 0 auto 12px; color: var(--teal); }

.locked-poster { position: relative; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 16 / 9; background: var(--navy); box-shadow: var(--shadow-lg); }
.locked-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(14px) brightness(.55) saturate(1.1); transform: scale(1.12); }
.locked-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 24px; color: #e2e9f6;
  background: linear-gradient(180deg, rgba(11, 26, 51, .35), rgba(11, 26, 51, .75));
}
.lock-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); color: #fff; margin-bottom: 16px; }
.locked-overlay h2 { color: #fff; margin-bottom: 6px; font-size: 1.35rem; }
.locked-overlay p { color: #c3cfe4; max-width: 420px; margin-bottom: 20px; }

.side-card { position: sticky; top: calc(var(--header-h) + 20px); }
.side-price { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.feature-list { list-style: none; padding: 0; margin: 18px 0 22px; display: grid; gap: 12px; }
.feature-list li { display: flex; gap: .65rem; align-items: flex-start; font-size: .92rem; color: var(--ink-2); }
.feature-list .icon { color: var(--success); margin-top: 3px; }
.countdown-box { background: var(--success-soft); border: 1px solid #bfe6d4; border-radius: var(--radius); padding: 16px 18px; }
.countdown-box .big { font-size: 1.5rem; font-weight: 700; color: var(--success); font-variant-numeric: tabular-nums; }
.secure-note { display: flex; gap: .5rem; align-items: center; font-size: .82rem; color: var(--muted); margin-top: 14px; justify-content: center; }

/* ==========================================================================
   Auth pages
   ========================================================================== */
.auth-wrap { min-height: calc(100vh - var(--header-h) - 200px); display: grid; place-items: center; padding: 48px 16px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card .card-pad { padding: 34px; }
.auth-card h1 { font-size: 1.6rem; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); margin-bottom: 26px; }
.auth-alt { text-align: center; margin-top: 20px; font-size: .92rem; color: var(--muted); }
.setup-steps { padding-inline-start: 1.2rem; margin: 0 0 14px; color: var(--ink-2); font-size: .95rem; }
.setup-steps li { margin-bottom: 12px; }
.qr-box { display: flex; justify-content: center; margin: 14px 0 10px; }
.qr-box img { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 8px; width: 220px; height: 220px; }
.totp-key { display: inline-block; margin-top: 4px; letter-spacing: .08em; user-select: all; word-break: break-all; }
.auth-details { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; font-size: .92rem; }
.auth-details summary { cursor: pointer; color: var(--muted); font-weight: 600; text-align: center; }
.auth-details[open] summary { margin-bottom: 4px; }
.auth-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); margin-bottom: 18px; }

/* ==========================================================================
   Library / payment status
   ========================================================================== */
.access-list { display: grid; gap: 14px; }
.access-item { display: grid; grid-template-columns: 160px 1fr auto; gap: 18px; align-items: center; padding: 14px; }
.access-item .thumb { border-radius: 10px; }
.access-item h3 { margin-bottom: 4px; }
@media (max-width: 640px) { .access-item { grid-template-columns: 1fr; } }
.status-card { max-width: 560px; margin: 56px auto 0; text-align: center; }
.status-icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 18px; }
.status-icon.is-success { background: var(--success-soft); color: var(--success); }
.status-icon.is-pending { background: var(--info-soft); color: var(--primary); }
.status-icon.is-failed { background: var(--danger-soft); color: var(--danger); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(31, 79, 209, .2); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.summary-list { list-style: none; padding: 0; margin: 22px 0; text-align: start; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.summary-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: .92rem; }
.summary-list li:last-child { border-bottom: 0; }
.summary-list span:first-child { color: var(--muted); }
.summary-list span:last-child { font-weight: 600; text-align: end; }
.mock-checkout { max-width: 480px; margin: 56px auto 0; }
.mock-checkout .card-head { background: repeating-linear-gradient(135deg, #fffbeb, #fffbeb 10px, #fef3c7 10px, #fef3c7 20px); }

.error-page { text-align: center; padding: 96px 0 40px; }
.error-page .row { justify-content: center; }
.error-code { font-size: 4.5rem; font-weight: 800; letter-spacing: -0.04em; color: var(--line-strong); line-height: 1; margin-bottom: 12px; }

/* ==========================================================================
   Admin
   ========================================================================== */
.admin-body { background: #f3f5f9; }
.admin-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.admin-side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
  background: var(--navy); color: #b6c3da; padding: 20px 14px;
}
.admin-side .brand { color: #fff; padding: 4px 8px 22px; }
.admin-side .brand-sub { color: #8394b4; }
.admin-nav { display: grid; gap: 2px; }
.admin-nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: #6c7fa3; font-weight: 650; padding: 16px 12px 6px; }
.admin-nav a {
  position: relative; z-index: 0;
  display: flex; align-items: center; gap: .7rem; height: 40px; padding: 0 12px; border-radius: 9px;
  color: #c3cee2; font-weight: 550; font-size: .92rem;
  transition: background-color .18s ease, color .18s ease;
}
.admin-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.admin-nav a.is-active { color: #fff; }
/* The active tab's highlight; admin.css slides it between pages. */
.admin-pill { position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: rgba(255, 255, 255, .1); box-shadow: inset 3px 0 0 var(--teal); pointer-events: none; }
.admin-nav .count { margin-left: auto; background: rgba(255, 255, 255, .12); color: #fff; font-size: .72rem; padding: 2px 8px; border-radius: 999px; }
.admin-side-foot { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid rgba(255, 255, 255, .08); }
.admin-side-foot .user-chip { color: #dbe5f7; padding: 0 0 12px; }
.admin-side-foot .avatar { background: rgba(255, 255, 255, .12); color: #fff; }
.admin-side-foot .btn { --btn-bg: transparent; --btn-fg: #c3cee2; --btn-border: rgba(255, 255, 255, .15); width: 100%; }
.admin-side-foot .btn:hover { --btn-bg: rgba(255, 255, 255, .06); color: #fff; }
.admin-main { min-width: 0; }
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 26px 36px 0; flex-wrap: wrap; }
.admin-top h1 { font-size: 1.55rem; margin: 0; }
.admin-top p { margin: 4px 0 0; color: var(--muted); font-size: .92rem; }
.admin-content { padding: 22px 36px 48px; }
.admin-content .flash-stack { margin: 0 0 18px; }
.admin-mobile-bar { display: none; }
@media (max-width: 960px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: fixed; z-index: 60; left: 0; top: 0; bottom: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .admin-side.is-open { transform: none; box-shadow: var(--shadow-lg); }
  .admin-mobile-bar { display: flex; align-items: center; gap: 12px; padding: 12px 18px; background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 40; }
  .admin-mobile-bar .btn { --btn-bg: transparent; --btn-fg: #fff; --btn-border: rgba(255, 255, 255, .2); }
  .admin-top, .admin-content { padding-left: 18px; padding-right: 18px; }
}

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .kpi-grid { grid-template-columns: 1fr; } }
.kpi { padding: 18px 20px; }
.kpi-label { display: flex; align-items: center; gap: .5rem; font-size: .84rem; color: var(--muted); font-weight: 550; }
.kpi-label .icon { color: var(--faint); }
.kpi-value { font-size: 1.75rem; font-weight: 650; letter-spacing: -0.02em; margin-top: 6px; line-height: 1.15; }
.kpi-delta { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.kpi-delta.up { color: var(--success); }
.kpi-delta.down { color: var(--danger); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }

.chart { position: relative; height: 260px; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .grid-line { stroke: #e9edf3; stroke-width: 1; shape-rendering: crispEdges; }
.chart .baseline { stroke: #cfd6e1; stroke-width: 1; shape-rendering: crispEdges; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--primary); transition: fill .12s; }
.chart .bar.is-hover { fill: #3b6ef0; }
.chart .hit { fill: transparent; cursor: pointer; outline: none; }
.chart .hit:focus-visible { fill: rgba(31, 79, 209, .06); }
.chart .peak-label { fill: var(--ink-2); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-tip {
  position: absolute; z-index: 5; pointer-events: none; min-width: 120px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
  padding: 8px 12px; font-size: .82rem; transform: translate(-50%, calc(-100% - 10px));
}
.chart-tip strong { display: block; font-size: .98rem; font-variant-numeric: tabular-nums; }
.chart-tip span { color: var(--muted); }
.chart-empty { height: 260px; display: grid; place-items: center; text-align: center; color: var(--muted); }
details.table-view { margin-top: 14px; font-size: .88rem; }
details.table-view summary { cursor: pointer; color: var(--muted); font-weight: 550; }
details.table-view .table-wrap { margin-top: 10px; max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }

.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 12px 22px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.list-plain li:last-child { border-bottom: 0; }
.rank { width: 24px; height: 24px; border-radius: 7px; background: var(--primary-soft); color: var(--primary-ink); font-size: .75rem; font-weight: 700; display: inline-grid; place-items: center; flex: none; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .input { height: 40px; width: auto; min-width: 240px; }
.toolbar select.input { min-width: 160px; }
.search-input { position: relative; }
.search-input .icon { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search-input .input { padding-inline-start: 38px; }

/* Lecture search on the home page */
.lecture-search { display: flex; gap: 10px; margin: -8px 0 22px; }
.lecture-search .search-input { flex: 1; max-width: 460px; }
.lecture-search .input { height: 46px; }
.lecture-search .search-input .icon { inset-inline-start: 14px; }
.lecture-search .search-input .input { padding-inline-start: 42px; }
.lecture-card[hidden] { display: none; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 14px 22px; border-top: 1px solid var(--line); font-size: .86rem; color: var(--muted); }
.pagination .row { gap: 6px; }

.video-cell { display: flex; align-items: center; gap: 14px; min-width: 260px; }
.video-cell .thumb { width: 104px; border-radius: 8px; flex: none; }
.progress { height: 6px; background: #e6ebf3; border-radius: 999px; overflow: hidden; margin-top: 6px; width: 140px; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: 999px; width: 0; transition: width .3s; }
.progress-lg { height: 10px; width: 100%; }

.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px;
  padding: 36px 20px; border: 2px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-2);
  cursor: pointer; transition: border-color .15s, background-color .15s;
}
.dropzone:hover, .dropzone.is-drag { border-color: var(--primary); background: var(--primary-soft); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone .icon { color: var(--primary); }
.dropzone strong { font-size: 1rem; }
.dropzone .file-name { font-weight: 600; color: var(--ink); }
.dropzone-sm { padding: 20px; }

.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }
.def-list { display: grid; grid-template-columns: auto 1fr; gap: 10px 20px; margin: 0; font-size: .92rem; }
.def-list dt { color: var(--muted); }
.def-list dd { margin: 0; font-weight: 550; text-align: end; overflow-wrap: anywhere; }
.danger-zone { border-color: #f1cfcb; }
.danger-zone .card-head { background: #fff8f7; border-radius: var(--radius) var(--radius) 0 0; }
.secret-box { background: var(--warning-soft); border: 1px solid #f2d9a8; border-radius: var(--radius); padding: 18px 20px; }
.secret-box code { display: inline-block; font-size: 1.25rem; font-weight: 700; letter-spacing: .06em; background: #fff; border: 1px solid #f2d9a8; border-radius: 8px; padding: 6px 12px; margin: 8px 0; user-select: all; }
.event-details { font-size: .8rem; color: var(--muted); display: flex; gap: 4px 12px; flex-wrap: wrap; margin-top: 2px; }
.event-details b { color: var(--ink-2); font-weight: 600; }
.level-alert td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.level-warn td:first-child { box-shadow: inset 3px 0 0 #e0a23b; }
.leak-result { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.leak-result .alert { margin-bottom: 10px; }
.text-danger { color: var(--danger); }
.fingerprint-note { display: flex; gap: .5rem; align-items: flex-start; margin-top: 12px; font-size: .84rem; color: var(--muted); }
.fingerprint-note .icon { color: var(--success); margin-top: 2px; }
.grant-form { display: grid; grid-template-columns: 1fr 140px auto; gap: 10px; align-items: end; }
@media (max-width: 640px) { .grant-form { grid-template-columns: 1fr; } }

/* ==========================================================================
   Confirmation pop-up (public/js/app.js)
   ========================================================================== */
.confirm-dialog {
  width: calc(100% - 32px); max-width: 440px; padding: 0; border: 0; border-radius: var(--radius-lg);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg);
}
.confirm-dialog[open] { animation: confirm-in .16s ease-out; }
.confirm-dialog::backdrop { background: rgba(11, 26, 51, .45); backdrop-filter: blur(2px); }
.confirm-body { padding: 26px 26px 6px; }
.confirm-body h2 { font-size: 1.15rem; margin: 0 0 8px; }
.confirm-body p { margin: 0; color: var(--ink-2); line-height: 1.55; }
.confirm-actions { display: flex; justify-content: flex-end; gap: .6rem; padding: 20px 26px 24px; }
@media (max-width: 480px) { .confirm-actions { flex-direction: column-reverse; } .confirm-actions .btn { width: 100%; } }
@keyframes confirm-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .confirm-dialog[open] { animation: none; } }

/* ==========================================================================
   Right-to-left (Arabic)
   ========================================================================== */
/* Inter has no Arabic letters: use the system's Arabic font (Segoe UI, SF Arabic, Noto). */
html[lang="ar"] { --font: system-ui, -apple-system, 'Segoe UI', Tahoma, 'Noto Sans Arabic', 'Geeza Pro', Arial, sans-serif; }
/* Letter spacing breaks the joins between Arabic letters. */
html[lang="ar"] body * { letter-spacing: normal; }
html[lang="ar"] body .input-code { letter-spacing: .5em; }
/* Arrows point the way the page reads. */
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }
/* Emails and phone numbers are typed left-to-right even on an Arabic page. */
[dir="rtl"] input[type="email"], [dir="rtl"] input[type="tel"] { direction: ltr; text-align: right; }
