:root {
  font-family: "IBM Plex Sans Arabic", "Segoe UI", "Noto Sans Arabic", Tahoma, system-ui, sans-serif;
  color: #2b3137;
  background: #f4f7f8;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #2b3137;
  --muted: #718191;
  --teal: #e85d04;
  --teal-dark: #c2410c;
  --line: #e2e9eb;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 42px 24px;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse at 12% 12%, rgba(255, 228, 205, .42), transparent 32%),
    #f4f7f8;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid rgba(232, 93, 4, .26);
  outline-offset: 3px;
}
.ambient { position: fixed; z-index: -1; border-radius: 50%; filter: blur(1px); pointer-events: none; }
.ambient-one { width: 350px; height: 350px; top: -170px; left: 11%; background: rgba(255, 222, 196, .35); }
.ambient-two { width: 230px; height: 230px; right: -110px; bottom: -80px; background: rgba(214, 231, 238, .55); }
.page-shell {
  width: min(1040px, 100%);
  min-height: 650px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border: 1px solid rgba(222, 232, 233, .85);
  border-radius: 25px;
  background: #fff;
  box-shadow: 0 26px 80px rgba(26, 54, 69, .12), 0 2px 8px rgba(26, 54, 69, .04);
}
.welcome-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 650px;
  padding: 42px 44px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(ellipse at 95% 10%, rgba(255, 140, 60, .26), transparent 40%),
    linear-gradient(145deg, #2b3137 0%, #3a2c24 59%, #7a2e06 100%);
}
.brand { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 11px; color: #fffaf6; font-size: 15px; font-weight: 700; text-decoration: none; }
.brand-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; background: #ff7a1a; color: white; font-size: 18px; font-weight: 800; box-shadow: 0 8px 22px rgba(255, 122, 26, .2); }
.welcome-copy { position: relative; z-index: 1; margin-top: auto; margin-bottom: auto; padding: 70px 0 62px; }
.eyebrow { display: inline-block; color: #e85d04; font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.welcome-panel .eyebrow { color: #ffc89a; }
.welcome-copy h1 { margin: 20px 0 18px; font-size: clamp(36px, 4.4vw, 53px); line-height: 1.35; letter-spacing: -.045em; }
.welcome-copy p { max-width: 370px; margin: 0; color: rgba(239, 248, 248, .72); font-size: 16px; line-height: 1.9; }
.welcome-note { position: relative; z-index: 1; display: flex; align-items: flex-start; gap: 12px; max-width: 390px; color: rgba(239, 248, 248, .78); font-size: 12px; line-height: 1.9; }
.note-mark { display: grid; width: 24px; height: 24px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(255, 200, 154, .4); border-radius: 50%; color: #ffc89a; }
.welcome-orbit { position: absolute; border: 1px solid rgba(255, 214, 180, .11); border-radius: 50%; }
.orbit-one { width: 450px; height: 450px; top: 41%; left: -265px; }
.orbit-two { width: 570px; height: 570px; top: 31%; left: -325px; }
.login-panel { display: grid; place-items: center; padding: 48px 56px; }
.login-content { width: min(100%, 360px); }
.mobile-brand { display: none; align-items: center; gap: 9px; margin-bottom: 42px; color: var(--ink); font-size: 14px; font-weight: 750; }
.login-content h2 { margin: 10px 0 6px; color: var(--ink); font-size: 31px; line-height: 1.4; letter-spacing: -.035em; }
.intro { margin: 0 0 29px; color: var(--muted); font-size: 14px; }
.login-form { display: grid; gap: 10px; }
.login-form label { margin-top: 5px; color: #344c5e; font-size: 12px; font-weight: 700; }
.login-form input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: #fbfcfc;
  font-size: 14px;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.login-form input::placeholder { color: #a2adb5; }
.login-form input:focus { border-color: #ff9f5a; background: #fff; box-shadow: 0 0 0 4px rgba(232, 93, 4, .08); outline: none; }
.password-wrap { position: relative; }
.password-wrap input { padding-inline-end: 70px; }
.reveal-button { position: absolute; inset-inline-end: 11px; top: 50%; transform: translateY(-50%); padding: 6px 5px; border: 0; color: #668092; background: transparent; cursor: pointer; font-size: 11px; font-weight: 700; }
.message { min-height: 0; color: #b63b3b; font-size: 12px; line-height: 1.7; }
.message:empty { display: none; }
.message.success { color: #168065; }
.primary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  margin-top: 5px;
  padding: 0 17px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(100deg, #e85d04, #ff7a1a);
  box-shadow: 0 8px 18px rgba(232, 93, 4, .19);
  cursor: pointer;
  font-size: 14px;
  font-weight: 750;
  transition: transform .16s, box-shadow .16s, opacity .16s;
}
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 11px 23px rgba(232, 93, 4, .25); }
.primary-button:disabled { cursor: wait; opacity: .65; transform: none; }
.button-arrow { direction: ltr; font-size: 18px; font-weight: 400; }
.text-button { display: block; margin: 17px auto 0; padding: 5px 8px; border: 0; color: #d4520a; background: none; cursor: pointer; font-size: 12px; font-weight: 700; }
.text-button:hover { text-decoration: underline; }
.device-note { display: flex; align-items: flex-start; gap: 9px; margin-top: 28px; padding: 12px 13px; border: 1px solid #e7eff0; border-radius: 10px; color: #758591; background: #f8faf9; font-size: 10px; line-height: 1.8; }
.demo-warning { margin: 0 0 18px; border-color: #d6eee4; color: #376454; background: #fff7f0; }
.lock-icon { color: #80a599; font-size: 10px; }
.admin-link { display: block; width: fit-content; margin: 22px auto 0; color: #99a5ac; font-size: 11px; text-decoration: none; }
.admin-link:hover { color: var(--teal-dark); }

/* Student dashboard */
.dashboard-shell { display: block; width: min(1040px, 100%); min-height: 650px; padding: 0; background: #f5f8f8; border: 0; box-shadow: none; overflow: visible; }
.dashboard-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 26px; padding: 22px 26px; border: 1px solid #e4ebec; border-radius: 17px; background: #fff; box-shadow: 0 5px 20px rgba(26, 54, 69, .04); }
.dashboard-header .brand { color: var(--ink); }
.dashboard-user { display: flex; align-items: center; gap: 12px; }
.user-avatar { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 14px; color: #c2410c; background: #dcf3eb; font-weight: 800; }
.user-meta { display: grid; gap: 1px; }
.user-meta strong { color: var(--ink); font-size: 13px; }
.user-meta span { color: var(--muted); font-size: 11px; }
.logout-button { padding: 8px 13px; border: 1px solid var(--line); border-radius: 9px; color: #536777; background: #fff; cursor: pointer; font-size: 12px; font-weight: 700; }
.logout-button:hover { border-color: #c8d6d8; background: #f9fbfb; }
.dashboard-intro { margin: 25px 4px; }
.dashboard-intro .eyebrow { margin-bottom: 8px; }
.dashboard-intro h1 { margin: 0 0 8px; color: var(--ink); font-size: clamp(27px, 4vw, 37px); letter-spacing: -.03em; }
.dashboard-intro p { margin: 0; color: var(--muted); font-size: 14px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 32px 4px 14px; }
.section-heading h2 { margin: 0; color: var(--ink); font-size: 19px; }
.section-heading span { color: var(--muted); font-size: 11px; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 15px; }
.teacher-group { margin-top: 20px; }
.teacher-group-heading { display: flex; align-items: center; gap: 9px; margin: 0 4px 11px; }
.teacher-group-heading h3 { margin: 0; color: #254456; font-size: 14px; }
.teacher-group-heading > span:last-child { margin-inline-start: auto; color: var(--muted); font-size: 10px; }
.teacher-mark { width: 8px; height: 24px; border-radius: 8px; background: #ff7a1a; }
.course-card { min-height: 176px; padding: 20px; border: 1px solid #e4ebec; border-radius: 15px; background: #fff; box-shadow: 0 5px 18px rgba(26, 54, 69, .035); }
.course-icon { display: grid; width: 37px; height: 37px; place-items: center; margin-bottom: 16px; border-radius: 12px; color: #c2410c; background: #e5f5ef; font-size: 16px; }
.course-card h3 { margin: 0 0 5px; color: var(--ink); font-size: 16px; }
.course-card p { min-height: 20px; margin: 0 0 15px; color: var(--muted); font-size: 12px; }
.course-card .course-description { min-height: 0; margin: -1px 0 12px; color: #718191; font-size: 11px; line-height: 1.7; }
.course-open { padding: 7px 11px; border: 0; border-radius: 8px; color: #c2410c; background: #fff1e6; cursor: pointer; font-size: 11px; font-weight: 800; }
.course-open:hover { background: #ffe2cc; }
.course-open:disabled, .lesson-prerequisite-link:disabled { cursor: not-allowed; color: #91a0a5; background: #edf0f0; }
.empty-state, .loading-state { padding: 34px 20px; border: 1px dashed #d5e1e3; border-radius: 14px; color: var(--muted); background: rgba(255,255,255,.65); text-align: center; font-size: 13px; line-height: 1.9; }
.student-guide { display: flex; align-items: flex-start; gap: 15px; margin: 18px 0 26px; padding: 17px 19px; border: 1px solid #dcece5; border-radius: 14px; background: linear-gradient(105deg, #edf8f3, #fffaf6); }
.guide-index { flex: 0 0 auto; padding: 6px 9px; border-radius: 7px; color: #c2410c; background: #d9f0e6; font-size: 10px; font-weight: 800; }
.student-guide h2 { margin: 0 0 4px; color: #244354; font-size: 13px; }
.student-guide p { margin: 0; color: #647b85; font-size: 11px; line-height: 1.85; }
.back-button { display: inline-flex; align-items: center; gap: 7px; margin: 2px 3px 18px; padding: 6px 0; border: 0; color: #527083; background: none; cursor: pointer; font-size: 12px; font-weight: 700; }
.lessons-list { display: grid; gap: 10px; }
.lesson-card { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid #e4ebec; border-radius: 13px; background: #fff; }
.lesson-number { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 12px; color: #c2410c; background: #fff1e6; font-size: 12px; font-weight: 800; }
.lesson-info { min-width: 0; flex: 1; }
.lesson-info h3 { margin: 0 0 4px; color: var(--ink); font-size: 14px; }
.lesson-info p { margin: 0; color: var(--muted); font-size: 11px; }
.lesson-action { flex: 0 0 auto; color: #09856d; font-size: 11px; font-weight: 800; text-decoration: none; }
.lesson-action:hover { text-decoration: underline; }
.lesson-action.disabled { color: #a0abb2; }
.lesson-done { color: #c2410c; }
.dashboard-message { margin-top: 12px; color: #b63b3b; font-size: 12px; }
.dashboard-message:empty { display: none; }
.dashboard-message.success { color: #c2410c; }
.dashboard-footer { margin-top: 38px; padding: 16px 4px; color: #96a3aa; font-size: 10px; text-align: center; }

.course-section-heading { margin-top: 15px; }
.course-tabs { display: flex; gap: 7px; margin: 0 4px 17px; padding: 4px; border: 1px solid #e5ecec; border-radius: 12px; background: #edf3f2; }
.course-tab { display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border: 0; border-radius: 9px; color: #6b7e88; background: transparent; cursor: pointer; font-size: 12px; font-weight: 750; }
.course-tab span { display: inline-grid; min-width: 21px; height: 21px; place-items: center; padding: 0 5px; border-radius: 7px; color: #5e7781; background: rgba(255,255,255,.8); font-size: 10px; }
.course-tab.active { color: #c2410c; background: #fff; box-shadow: 0 2px 7px rgba(26, 54, 69, .08); }
.lesson-card { align-items: flex-start; }
.lesson-info { padding-top: 2px; }
.lesson-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 12px; }
.handout-button { display: flex; min-width: 0; align-items: center; gap: 8px; padding: 8px 9px; border: 1px solid #e6eded; border-radius: 9px; color: #526b78; background: #fbfdfc; cursor: pointer; text-align: start; }
.handout-button:hover { border-color: #a6d8c8; background: #fff8f2; }
.handout-button:disabled { cursor: wait; opacity: .62; }
.handout-icon { flex: 0 0 auto; padding: 4px 5px; border-radius: 5px; color: #b54d4d; background: #fff0ee; font-size: 8px; font-weight: 900; letter-spacing: .04em; }
.handout-title { min-width: 0; flex: 1; overflow: hidden; font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.handout-size { flex: 0 0 auto; color: #97a5aa; font-size: 9px; }
.handout-download { flex: 0 0 auto; color: #d4520a; font-size: 14px; }
.lesson-prerequisite-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 7px; padding: 6px 9px; border: 1px solid #cfe9df; border-radius: 8px; color: #c2410c; background: #f2faf6; cursor: pointer; font-size: 10px; font-weight: 750; }
.lesson-prerequisite-link:hover { border-color: #88cbb5; background: #eaf7f1; }
.lesson-play-button { display: inline-flex; align-items: center; gap: 5px; padding: 8px 11px; border: 0; border-radius: 8px; color: #fff; background: #c2410c; cursor: pointer; }
.lesson-play-button:hover { color: #fff; background: #066b57; text-decoration: none; }
.lesson-player { width: 100%; margin-top: 14px; overflow: hidden; border: 1px solid #dce9e5; border-radius: 12px; background: #fffaf6; }
.lesson-player-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #2b3137; }
.lesson-player-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lesson-player-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; }
.lesson-watch-status { margin: 0; color: #607784; font-size: 10px; line-height: 1.7; }
.lesson-complete-button { flex: 0 0 auto; min-height: 34px; }
.quiz-list { display: grid; gap: 10px; }
.quiz-card { display: flex; align-items: center; gap: 13px; padding: 15px; border: 1px solid #e4ebec; border-radius: 13px; background: #fff; box-shadow: 0 3px 12px rgba(26, 54, 69, .025); }
.quiz-card-icon { display: grid; width: 39px; height: 39px; flex: 0 0 auto; place-items: center; border-radius: 12px; color: #c2410c; background: #fff1e6; font-size: 16px; font-weight: 800; }
.quiz-card-copy { min-width: 0; flex: 1; }
.quiz-card-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.quiz-card-title-row h3 { margin: 0; color: var(--ink); font-size: 14px; }
.quiz-kind { padding: 3px 7px; border-radius: 6px; color: #6c7487; background: #f0f2f6; font-size: 9px; font-weight: 800; }
.quiz-card-copy p { margin: 4px 0 3px; color: var(--muted); font-size: 10px; }
.quiz-attempt-status { color: #158268; font-size: 10px; font-weight: 700; }
.quiz-attempt-status.is-muted { color: #929fa6; }
.quiz-start:disabled { cursor: not-allowed; color: #91a0a5; background: #edf0f0; }
.quiz-taking-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 5px 3px 8px; }
.quiz-taking-header h2 { margin: 6px 0 0; color: var(--ink); font-size: clamp(22px, 3vw, 29px); }
.quiz-countdown { min-width: 84px; padding: 9px 12px; border: 1px solid #cde7dc; border-radius: 10px; color: #c2410c; background: #eef9f4; font-size: 17px; font-variant-numeric: tabular-nums; font-weight: 850; text-align: center; direction: ltr; }
.quiz-countdown.no-timer { font-size: 10px; direction: rtl; }
.quiz-instructions { margin: 0 3px 17px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.questions-list { display: grid; gap: 13px; }
.question-card { padding: 17px; border: 1px solid #e4ebec; border-radius: 13px; background: #fff; }
.question-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: #82919a; font-size: 10px; font-weight: 700; }
.quiz-question-body { color: var(--ink); font-size: 14px; font-weight: 700; line-height: 1.9; white-space: pre-wrap; }
.quiz-question-image { display: block; max-width: min(100%, 560px); max-height: 340px; margin: 13px auto; border-radius: 10px; object-fit: contain; }
.quiz-options { display: grid; gap: 8px; margin-top: 15px; }
.quiz-option { display: flex; align-items: center; gap: 10px; min-height: 43px; padding: 8px 11px; border: 1px solid #e8eeee; border-radius: 9px; color: #506675; background: #fbfcfc; cursor: pointer; font-size: 12px; }
.quiz-option:has(input:checked) { border-color: #85ccb5; color: #c2410c; background: #fff7f0; }
.quiz-option input { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; accent-color: #e85d04; }
.option-index { display: inline-grid; width: 23px; height: 23px; flex: 0 0 auto; place-items: center; border-radius: 7px; color: #81929b; background: #edf1f1; font-size: 10px; font-weight: 800; }
.essay-label { display: block; margin-top: 13px; color: #607784; font-size: 11px; font-weight: 750; }
.essay-answer { width: 100%; min-height: 125px; margin-top: 7px; padding: 11px 12px; border: 1px solid #e1e9e9; border-radius: 9px; color: var(--ink); background: #fcfdfd; font: inherit; font-size: 12px; resize: vertical; }
.essay-answer:focus { border-color: #ff9f5a; outline: 3px solid rgba(232, 93, 4, .1); }
.quiz-submit-bar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 15px; padding: 15px; border: 1px solid #e4ebec; border-radius: 12px; background: #fff; }
.quiz-submit-bar > span { color: var(--muted); font-size: 11px; }
.quiz-submit-bar .primary-button { min-width: 190px; }
.quiz-result { display: grid; justify-items: center; gap: 9px; max-width: 540px; margin: 35px auto; padding: 34px 25px; border: 1px solid #e3ece9; border-radius: 18px; background: #fff; text-align: center; box-shadow: 0 8px 25px rgba(26, 54, 69, .04); }
.result-check { display: grid; width: 55px; height: 55px; place-items: center; margin-bottom: 8px; border-radius: 18px; color: #c2410c; background: #e3f5ed; font-size: 24px; font-weight: 900; }
.quiz-result h2 { margin: 0; color: var(--ink); font-size: 25px; }
.result-title { margin: 0; color: var(--muted); font-size: 12px; }
.result-score { margin: 6px 0; color: #c2410c; font-size: 32px; font-weight: 900; direction: ltr; }
.result-score span { color: #9aa7ac; font-size: 19px; }
.quiz-result > p:last-of-type { max-width: 350px; margin: 0 0 9px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.quiz-result .primary-button { width: min(100%, 290px); }

@media (max-width: 760px) {
  body { display: block; padding: 18px 14px; }
  .page-shell { display: block; min-height: auto; border-radius: 20px; }
  .welcome-panel { display: none; }
  .login-panel { padding: 34px 25px 30px; }
  .login-content h2 { font-size: 28px; }
  .mobile-brand { display: flex; }
  .dashboard-shell { padding: 0; }
  .dashboard-header { align-items: flex-start; padding: 15px; }
  .dashboard-header .brand { font-size: 12px; }
  .dashboard-header .brand-icon { width: 31px; height: 31px; }
  .dashboard-user { gap: 8px; }
  .user-avatar { width: 35px; height: 35px; }
  .user-meta strong { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .user-meta span { display: none; }
  .logout-button { padding: 7px 9px; font-size: 10px; }
  .dashboard-intro { margin: 22px 3px; }
  .course-grid { grid-template-columns: 1fr; }
  .student-guide { gap: 10px; padding: 13px; }
  .guide-index { padding: 6px 7px; font-size: 9px; }
  .lesson-card { align-items: flex-start; gap: 10px; padding: 13px; }
  .lesson-action { align-self: center; }
  .lesson-play-button { padding: 8px; font-size: 10px; }
  .lesson-player-controls { align-items: stretch; flex-direction: column; }
  .lesson-complete-button { width: 100%; }
  .course-tabs { display: grid; grid-template-columns: 1fr 1fr; }
  .course-tab { justify-content: center; padding-inline: 8px; text-align: center; font-size: 10px; }
  .lesson-files { grid-template-columns: 1fr; }
  .quiz-card { align-items: flex-start; flex-wrap: wrap; gap: 10px; }
  .quiz-card-icon { width: 34px; height: 34px; }
  .quiz-card-copy { flex-basis: calc(100% - 48px); }
  .quiz-start { margin-inline-start: 44px; }
  .question-card { padding: 13px; }
  .quiz-submit-bar { align-items: stretch; flex-direction: column; }
  .quiz-submit-bar .primary-button { width: 100%; }
  .handout-button { width: 100%; }
}

.brand-icon { overflow: hidden; background: #2b3137; }
.brand-icon img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.32); display: block; }

/* platform catalog */
body.catalog-body { display: block; padding: 28px 20px; }
.catalog-page { width: min(1120px, 100%); margin: 0 auto; }
.catalog-account { padding: 9px 16px; font-size: 13px; text-decoration: none; }
.catalog-hero { position: relative; overflow: hidden; margin-bottom: 26px; padding: 40px 34px; border-radius: 22px; color: #fff;
  background: radial-gradient(90% 120% at 0% 0%, rgba(255,122,26,.55), transparent 55%), linear-gradient(145deg, #2b3137 0%, #3a2c24 59%, #7a2e06 100%); }
.catalog-hero .eyebrow { color: #ffc89a; }
.catalog-hero h1 { margin: 8px 0 10px; font-size: clamp(26px, 4vw, 38px); line-height: 1.35; letter-spacing: -.02em; }
.catalog-hero p { margin: 0 0 22px; color: rgba(255,255,255,.78); font-size: 15px; }
.catalog-search input { width: min(520px, 100%); padding: 14px 18px; border: 0; border-radius: 14px; background: #fff; color: var(--ink); font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.catalog-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.catalog-filters:empty { display: none; }
.catalog-filter { padding: 7px 14px; border: 1px solid rgba(255,255,255,.25); border-radius: 99px; background: rgba(255,255,255,.08); color: #fff; cursor: pointer; font-size: 12px; font-weight: 700; }
.catalog-filter.active { background: #ff7a1a; border-color: #ff7a1a; }
.catalog-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.catalog-grid > .empty-state, .catalog-grid > .loading-state { grid-column: 1 / -1; }
.catalog-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid #e4ebec; border-radius: 18px; background: #fff; box-shadow: 0 10px 30px rgba(26, 54, 69, .06); transition: transform .18s, box-shadow .18s; }
.catalog-card:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(232, 93, 4, .14); }
.catalog-cover { position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center; background: linear-gradient(135deg, #2b3137, #7a2e06 70%, #ff7a1a); }
.catalog-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.catalog-cover > span[aria-hidden] { color: rgba(255,255,255,.9); font-size: 44px; font-weight: 800; }
.catalog-chip { position: absolute; top: 12px; inset-inline-start: 12px; padding: 4px 11px; border-radius: 99px; background: rgba(20,24,28,.72); color: #fff; font-size: 11px; font-weight: 700; }
.catalog-card-body { display: flex; flex: 1; flex-direction: column; gap: 8px; padding: 18px; }
.catalog-card-body h2 { margin: 0; color: var(--ink); font-size: 17px; line-height: 1.45; }
.catalog-teacher { margin: 0; color: #c2410c; font-size: 12px; font-weight: 700; }
.catalog-desc { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.catalog-meta { display: flex; gap: 14px; color: var(--muted); font-size: 12px; }
.catalog-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 12px; border-top: 1px solid #edf0f0; }
.catalog-price { color: var(--ink); font-size: 18px; }
.catalog-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.catalog-cta { width: auto; min-height: 0; margin: 0; padding: 9px 14px; font-size: 12px; text-decoration: none; }
.catalog-code { padding: 9px 12px; font-size: 12px; text-decoration: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.catalog-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; color: #c2410c; font-size: 13px; font-weight: 800; text-decoration: none; }
.catalog-link:hover { text-decoration: underline; }
.redeem-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; padding: 18px 20px; border: 1px solid #ffd9bd; border-radius: 16px; background: linear-gradient(90deg, #fff7f0, #fff); }
.redeem-card h2 { margin: 0 0 2px; color: var(--ink); font-size: 16px; }
.redeem-card p { margin: 0; color: var(--muted); font-size: 12px; }
.redeem-card form { display: flex; gap: 8px; flex: 1; min-width: 260px; justify-content: flex-end; }
.redeem-card input { flex: 1; max-width: 260px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; letter-spacing: .12em; text-transform: uppercase; direction: ltr; }
.redeem-card .primary-button { width: auto; min-height: 0; margin: 0; padding: 10px 16px; font-size: 13px; }
.redeem-msg { flex-basis: 100%; font-size: 12px; font-weight: 700; }
.redeem-msg:empty { display: none; }
.redeem-msg.ok { color: #166534; }
.redeem-msg.bad { color: #b63b3b; }
@media (max-width: 640px) { .catalog-hero { padding: 28px 20px; } body.catalog-body { padding: 16px 12px; } }

/* Arabic letters must stay joined: no letter-spacing on Arabic text */
h1, h2, h3, p, span, label, button, a, input, strong { letter-spacing: normal !important; }

/* lesson details and media uploaded from the admin panel */
.lesson-player-frame video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }
.lesson-details { margin-top: 6px !important; color: var(--ink) !important; font-size: 13px !important; line-height: 1.8; white-space: pre-line; }
.lesson-image { display: block; max-width: 100%; max-height: 320px; margin-top: 10px; border-radius: 12px; }
.nivex-credit { margin: 12px 0 0; text-align: center; font-size: 12px; color: #96a3aa; }
.nivex-credit a { color: #c2410c; font-weight: 700; }

/* ---------- student dashboard ---------- */
body.in-app { display: block; padding: 0; background: #f4f6f8; }
body.in-app .ambient { display: none; }
body.no-scroll { overflow: hidden; }
#app.dashboard-shell { width: 100%; max-width: none; min-height: 100vh; padding: 0; background: none; }
.page-wrap { width: min(1120px, 100%); margin: 0 auto; padding: 22px 16px 10px; }
.in-app a { text-decoration: none; }

.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .94); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.topbar-in { display: flex; align-items: center; gap: 22px; width: min(1120px, 100%); margin: 0 auto; padding: 10px 16px; }
.topbar .brand { color: var(--ink); font-size: 16px; font-weight: 700; }
.topnav { display: flex; gap: 4px; flex: 1; }
.topnav a { padding: 8px 12px; border-radius: 10px; color: #55636f; font-size: 14px; font-weight: 600; }
.topnav a:hover { color: var(--teal-dark); background: #fff1e6; }
.topbar .dashboard-user { display: flex; align-items: center; gap: 10px; }

.home-hero { display: flex; align-items: center; justify-content: space-between; gap: 22px; flex-wrap: wrap; padding: 30px 28px; border-radius: 24px; color: #fff; background: linear-gradient(115deg, #a8440c, #4a2f22 48%, #23282d); }
.home-hello span { color: #ffc89a; font-size: 13px; font-weight: 600; }
.home-hello h1 { margin: 6px 0 6px; font-size: 30px; line-height: 1.3; }
.home-hello p { margin: 0; color: rgba(255, 255, 255, .78); font-size: 15px; }
.home-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.home-stat { min-width: 104px; padding: 12px 16px; border: 1px solid rgba(255, 255, 255, .16); border-radius: 16px; background: rgba(255, 255, 255, .1); }
.home-stat strong { display: block; font-size: 20px; }
.home-stat span { color: rgba(255, 255, 255, .75); font-size: 12.5px; }

.in-app .redeem-card { margin: 16px 0 0; border-radius: 18px; }
.in-app .redeem-card h2 { font-size: 17px; }
.in-app .redeem-card p { font-size: 13.5px; }
.in-app .redeem-card a { color: var(--teal-dark); font-weight: 700; }
.in-app .section-heading { margin: 28px 2px 14px; }
.in-app .section-heading h2 { font-size: 21px; }
.in-app .section-heading span { font-size: 13px; }

.c-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.c-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid #e4e9ee; border-radius: 20px; color: var(--ink); background: #fff; box-shadow: 0 6px 20px rgba(26, 38, 48, .05); transition: transform .18s, box-shadow .18s; }
.c-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(26, 38, 48, .11); }
.c-cover { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #e9edf1; }
.c-cover img { position: relative; z-index: 1; display: block; width: 100%; height: 100%; object-fit: cover; }
.c-initial { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, .9); font-size: 46px; font-weight: 700; }
.grad-0 { background: linear-gradient(120deg, #ea5a0c, #f59e0b); }
.grad-1 { background: linear-gradient(120deg, #c2410c, #7c2d12); }
.grad-2 { background: linear-gradient(120deg, #334155, #e85d04); }
.grad-3 { background: linear-gradient(120deg, #f97316, #b45309); }
.c-body { display: flex; flex: 1; flex-direction: column; gap: 4px; padding: 16px 18px 16px; }
.c-teacher { color: var(--teal-dark); font-size: 12.5px; font-weight: 600; }
.c-body strong { font-size: 18px; line-height: 1.45; }
.c-desc { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 13.5px; line-height: 1.7; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.c-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 12px; }
.c-exp { padding: 4px 10px; border-radius: 99px; color: #15803d; background: #e8f6ee; font-size: 12px; font-weight: 600; }
.c-open { color: var(--teal-dark); font-size: 13.5px; font-weight: 700; }

.crumbs { display: flex; align-items: center; gap: 8px; margin: 0 2px 14px; color: #93a1ad; font-size: 14px; flex-wrap: wrap; }
.crumbs a { color: #4f5f6c; font-weight: 600; }
.crumbs a:hover { color: var(--teal-dark); }

.course-hero { position: relative; display: flex; align-items: flex-end; min-height: 250px; overflow: hidden; border-radius: 24px; color: #fff; background-color: #23282d; }
.course-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.course-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 10%, rgba(0, 0, 0, .82)); }
.course-hero-copy { position: relative; z-index: 1; width: 100%; padding: 26px 26px 22px; }
.hero-chip { display: inline-block; padding: 4px 12px; border-radius: 99px; background: rgba(255, 255, 255, .18); font-size: 12.5px; font-weight: 600; }
.course-hero-copy h1 { margin: 8px 0 4px; font-size: 28px; line-height: 1.35; }
.course-hero-copy p { margin: 0 0 12px; color: rgba(255, 255, 255, .82); font-size: 14.5px; }
.hero-progress { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; max-width: 420px; margin-top: 12px; font-size: 13.5px; }
.progress-track { grid-column: 1 / -1; height: 7px; overflow: hidden; border-radius: 99px; background: rgba(255, 255, 255, .25); }
.progress-track i { display: block; height: 100%; border-radius: 99px; background: #fb923c; }

.in-app .course-tabs { display: flex; gap: 6px; margin: 16px 0; padding: 5px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.in-app .course-tab { flex: 1; padding: 11px 10px; border: 0; border-radius: 12px; color: #5b6a76; background: none; font-size: 14.5px; font-weight: 700; text-align: center; }
.in-app .course-tab span { display: inline-block; min-width: 22px; margin-inline-start: 4px; padding: 0 6px; border-radius: 99px; color: inherit; background: rgba(0, 0, 0, .07); font-size: 12px; }
.in-app .course-tab.active { color: #fff; background: linear-gradient(120deg, #f97316, #e85d04); box-shadow: 0 6px 14px rgba(232, 93, 4, .25); }
.in-app .course-tab.active span { background: rgba(255, 255, 255, .25); }

.l-list { display: grid; gap: 12px; }
.l-row { display: flex; align-items: center; gap: 14px; padding: 15px 16px; border: 1px solid #e4e9ee; border-radius: 18px; color: var(--ink); background: #fff; transition: border-color .15s, transform .15s; }
a.l-row:hover { border-color: #fdba74; transform: translateY(-1px); }
.l-row.is-locked { background: #f8fafb; }
.l-mark { display: grid; flex: 0 0 auto; width: 46px; height: 46px; place-items: center; border-radius: 50%; font-size: 16px; }
.l-open { color: #fff; background: linear-gradient(120deg, #f97316, #e85d04); }
.l-done { color: #fff; background: #16a34a; }
.l-locked { color: #8a98a4; background: #e9eef2; font-size: 15px; }
.l-copy { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.l-copy small { color: var(--teal-dark); font-size: 12.5px; font-weight: 600; }
.l-copy strong { font-size: 16.5px; line-height: 1.45; }
.l-meta { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; margin-top: 3px; }
.l-status { color: var(--muted); font-size: 13px; }
.l-status-done { color: #15803d; font-weight: 600; }
.l-status-open { color: var(--teal-dark); font-weight: 600; }
.mini-pill { display: inline-block; padding: 3px 10px; border-radius: 99px; color: #5b6a76; background: #eff3f6; font-size: 12px; }
.l-go { flex: 0 0 auto; padding: 9px 14px; border-radius: 12px; color: var(--teal-dark); background: #fff1e6; font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.l-go.is-off { color: #91a0a5; background: #edf0f0; }

.in-app .quiz-card { padding: 16px; border-radius: 18px; }
.in-app .quiz-card-icon { width: 46px; height: 46px; font-size: 16px; }
.in-app .quiz-card-title-row h3 { font-size: 16.5px; }
.in-app .quiz-kind, .in-app .quiz-attempt-status { font-size: 12px; }
.in-app .quiz-card-copy p { font-size: 13px; }

.player-box { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 20px; background: #000; }
.player-media iframe, .player-media video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-shield { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; border: 0; color: #fff; background: rgba(0, 0, 0, .9); cursor: pointer; font: inherit; font-size: 15px; font-weight: 600; }
.player-shield[hidden] { display: none; }
.shield-play { display: grid; width: 74px; height: 74px; place-items: center; border-radius: 50%; background: #e85d04; font-size: 26px; box-shadow: 0 8px 22px rgba(0, 0, 0, .4); }
.player-mark { position: absolute; z-index: 3; color: #fff; direction: ltr; font-size: 14px; font-weight: 600; opacity: .32; pointer-events: none; text-shadow: 0 0 3px #000; transition: top .9s, inset-inline-start .9s; white-space: nowrap; }
.player-exit { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 4; display: none; width: 44px; height: 44px; place-items: center; border: 0; border-radius: 50%; color: #fff; background: rgba(255, 255, 255, .22); cursor: pointer; font-size: 17px; }
.player-box.is-full { position: fixed; inset: 0; z-index: 1000; width: 100vw; height: 100vh; height: 100dvh; aspect-ratio: auto; border-radius: 0; }
.player-box.is-full .player-exit { display: grid; }
.player-bar { display: flex; justify-content: flex-end; margin-top: 10px; }
.player-full { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 0; border-radius: 12px; color: #fff; background: var(--ink); cursor: pointer; font: inherit; font-size: 14px; font-weight: 700; }
.player-full:hover { background: #1b2025; }

.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; margin-top: 16px; }
.lesson-main, .lesson-side { display: grid; gap: 14px; }
.lesson-side { position: sticky; top: 76px; }
.panel-card { padding: 18px; border: 1px solid #e4e9ee; border-radius: 20px; background: #fff; }
.panel-title { margin: 0 0 12px; color: var(--ink); font-size: 16px; }
.lesson-title { margin: 0 0 8px; color: var(--ink); font-size: 24px; line-height: 1.4; }
.lesson-text { margin: 12px 0 0; color: #4f5f6c; font-size: 15px; line-height: 1.9; white-space: pre-wrap; }
.in-app .lesson-image { display: block; width: 100%; max-height: 460px; margin: 0; border-radius: 20px; object-fit: contain; background: #fff; }
.in-app .lesson-files { display: grid; gap: 8px; margin: 0; }
.in-app .handout-button { width: 100%; padding: 11px 12px; border-radius: 14px; }
.in-app .handout-title { font-size: 14.5px; }
.in-app .handout-size { font-size: 12px; }
.watch-note { margin: 0 0 12px; color: #4f5f6c; font-size: 15px; font-weight: 600; text-align: center; }
.watch-note.is-done { color: #15803d; }
.primary-link { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 13px 16px; border: 0; border-radius: 14px; color: #fff; background: #16a34a; cursor: pointer; font: inherit; font-size: 15px; font-weight: 700; }
.primary-link:disabled { color: #8795a1; background: #e6ebef; cursor: not-allowed; }
.playlist { display: grid; gap: 4px; max-height: 300px; overflow-y: auto; }
.p-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; color: #40505c; font-size: 14px; }
a.p-item:hover { background: #f4f6f8; }
.p-item.is-current { color: var(--teal-dark); background: #fff1e6; font-weight: 700; }
.p-item.is-locked { color: #a3afb9; }
.p-mark { display: grid; flex: 0 0 auto; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: #eff3f6; font-size: 12px; }

.in-app .quiz-instructions { font-size: 14px; }
.in-app .quiz-taking-header h2 { font-size: 22px; }
.in-app .dashboard-message { font-size: 14px; }
.in-app .dashboard-footer { font-size: 12.5px; }

@media (max-width: 900px) {
  .lesson-layout { grid-template-columns: minmax(0, 1fr); }
  .lesson-side { position: static; order: -1; }
}
@media (max-width: 640px) {
  .topbar-in { gap: 10px; }
  .topnav, .topbar .user-meta { display: none; }
  .topbar .dashboard-user { margin-inline-start: auto; }
  .page-wrap { padding-top: 14px; }
  .home-hero { padding: 22px 18px; border-radius: 20px; }
  .home-hello h1 { font-size: 25px; }
  .home-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; }
  .home-stat { min-width: 0; padding: 10px 14px; }
  .home-stat.is-date { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .home-stat.is-date strong { font-size: 17px; white-space: nowrap; }
  .c-grid { grid-template-columns: minmax(0, 1fr); }
  .course-hero { min-height: 210px; border-radius: 20px; }
  .course-hero-copy { padding: 18px; }
  .course-hero-copy h1 { font-size: 23px; }
  .l-row { flex-wrap: wrap; }
  .l-go { width: 100%; text-align: center; }
  .player-stage { margin-inline: -16px; }
  .player-box { border-radius: 0; }
  .player-bar { padding-inline: 16px; }
  .player-full { width: 100%; justify-content: center; padding: 13px; font-size: 15px; }
  .in-app .quiz-card { flex-wrap: wrap; }
}
.c-plan { align-self: flex-start; margin-top: 4px; padding: 3px 10px; border-radius: 99px; color: #9a3412; background: #fff1e6; font-size: 12px; font-weight: 600; }
.top-search { flex: 0 1 260px; }
.top-search input { width: 100%; padding: 9px 14px; border: 1px solid var(--line); border-radius: 12px; background: #f4f6f8; font: inherit; font-size: 14px; }
.top-search input:focus { outline: 2px solid #fdba74; background: #fff; }
@media (max-width: 640px) {
  .topbar-in { flex-wrap: wrap; }
  .top-search { order: 3; flex: 1 1 100%; }
}
