/* AERONEX LMS custom styles (Tailwind handles most utility classes via CDN) */

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.spinner {
  border: 3px solid rgba(36, 81, 242, 0.15);
  border-top-color: #2451f2;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.fade-in {
  animation: fadeIn 0.25s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.course-cover-fallback {
  background:
    radial-gradient(circle at 78% 20%, rgba(255, 255, 255, 0.22), transparent 28%),
    linear-gradient(135deg, #152d84 0%, #2451f2 52%, #55a8ff 100%);
}

.learning-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1.5rem;
  align-items: start;
}

.learning-progress-panel {
  position: sticky;
  top: 5.5rem;
  max-height: calc(100vh - 7rem);
  overflow: hidden;
}

.learning-tree {
  max-height: calc(100vh - 18rem);
  overflow-y: auto;
}

.outline-chapter-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 1rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
  transition: background-color 160ms ease;
}

.outline-chapter-toggle:hover {
  background: #f8fafc;
}

.learning-tree-lesson {
  position: relative;
  padding-bottom: 0.5rem;
}

.learning-tree-lesson:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 1.08rem;
  top: 2.45rem;
  bottom: -0.1rem;
  width: 1px;
  background: #e2e8f0;
}

.learning-tree-item {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.68rem 0.7rem;
  border-left: 3px solid transparent;
  border-radius: 0.6rem;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.learning-tree-item:hover {
  background: #f8fafc;
}

.learning-tree-item.is-active {
  background: #f2f5ff;
  border-left-color: #2451f2;
}

.learning-tree-number {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  color: #475569;
  background: #fff;
  border: 1px solid #cbd5e1;
  font-size: 0.72rem;
  font-weight: 700;
}

.learning-tree-item.is-active .learning-tree-number {
  color: #fff;
  background: #2451f2;
  border-color: #2451f2;
}

.tree-video-status {
  color: #64748b;
  font-size: 0.85rem;
}

.learning-tree-item.is-active .tree-video-status {
  color: #2451f2;
}

.learning-tree-exam {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.55rem;
  margin: 0.12rem 0 0.35rem 2.7rem;
  padding: 0.52rem 0.65rem;
  border: 0;
  border-radius: 0.5rem;
  color: #64748b;
  background: #f8fafc;
  font-size: 0.8rem;
  font-weight: 600;
  transition: background-color 160ms ease, border-color 160ms ease;
}

a.learning-tree-exam:hover,
.learning-tree-exam.is-active {
  color: #2451f2;
  background: #f2f5ff;
}

.learning-tree-exam.is-complete {
  color: #334155;
  background: #f1f5f9;
}

.learning-tree-exam.is-locked,
.learning-tree-exam.is-unavailable {
  color: #94a3b8;
  background: #f8fafc;
}

@media (max-width: 1023px) {
  .learning-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .learning-progress-panel {
    position: static;
    max-height: none;
    grid-row: 1;
  }

  .learning-tree {
    max-height: none;
  }
}

@media (max-width: 520px) {
  .learning-tree-exam {
    margin-left: 2.4rem;
  }
}

.admin-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.admin-sidebar {
  position: sticky;
  top: 5.5rem;
}

.admin-section-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 3rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.75rem;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  transition: color 160ms ease, background-color 160ms ease;
}

.admin-section-link:hover {
  color: #2451f2;
  background: #f8fafc;
}

.admin-section-link.is-active {
  color: #fff;
  background: linear-gradient(135deg, #2147d5, #2451f2);
  box-shadow: 0 8px 20px rgba(36, 81, 242, 0.2);
}

.admin-section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 0.55rem;
  color: #2451f2;
  background: #eef3ff;
}

.admin-section-link.is-active .admin-section-icon {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}

.admin-dashboard-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  min-height: 12rem;
  padding: 1.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.admin-dashboard-card:hover {
  transform: translateY(-2px);
  border-color: #cbd8ff;
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.08);
}

.admin-dashboard-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 3rem;
  height: 3rem;
  border-radius: 0.85rem;
  font-size: 1.15rem;
}

.admin-dashboard-card-icon.is-brand { color: #2451f2; background: #eef3ff; }
.admin-dashboard-card-icon.is-amber { color: #b45309; background: #fffbeb; }
.admin-dashboard-card-icon.is-emerald { color: #047857; background: #ecfdf5; }
.admin-dashboard-card-icon.is-violet { color: #7c3aed; background: #f5f3ff; }
.admin-dashboard-card-icon.is-slate { color: #475569; background: #f1f5f9; }

@media (max-width: 900px) {
  .admin-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-sidebar {
    position: static;
    display: flex;
    overflow-x: auto;
  }

  .admin-section-link {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .admin-section-link > .fa-chevron-right {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Learner course details
   -------------------------------------------------------------------------- */

.course-detail-page { color: #0f172a; }
.course-breadcrumb { display: flex; align-items: center; gap: .65rem; margin-bottom: 1.5rem; color: #94a3b8; font-size: .78rem; }
.course-breadcrumb a { color: #64748b; }
.course-breadcrumb a:hover { color: #2451f2; }
.course-breadcrumb i { font-size: .55rem; }
.course-detail-hero { display: flex; justify-content: space-between; gap: 1.25rem; padding: 1.35rem 1.5rem; border: 1px solid #dbe4f0; border-radius: 1rem; background: linear-gradient(135deg, #fff 0%, #f6f9ff 100%); box-shadow: 0 8px 24px rgba(15, 23, 42, .05); }
.course-detail-hero > div:first-child { max-width: 48rem; }
.course-eyebrow { color: #2451f2; font-size: .68rem; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
.course-detail-hero h1 { margin-top: .38rem; font-size: clamp(1.4rem, 2.2vw, 1.85rem); font-weight: 750; line-height: 1.16; }
.course-detail-hero p:not(.course-eyebrow) { margin-top: .5rem; color: #64748b; font-size: .8rem; line-height: 1.5; }
.course-detail-meta { display: grid; grid-template-columns: repeat(2, minmax(7.25rem, 1fr)); align-self: center; min-width: 18rem; gap: .45rem; }
.course-detail-meta span { display: flex; align-items: center; gap: .45rem; padding: .55rem .7rem; border: 1px solid #e2e8f0; border-radius: .65rem; background: rgba(255,255,255,.82); color: #475569; font-size: .7rem; font-weight: 650; }
.course-detail-meta i { width: 1rem; color: #2451f2; text-align: center; }
.course-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1rem; margin-top: 1rem; align-items: start; }
.course-detail-outline, .course-progress-card { border: 1px solid #dbe4f0; border-radius: 1.15rem; background: #fff; box-shadow: 0 8px 28px rgba(15, 23, 42, .05); }
.course-detail-outline { overflow: hidden; }
.course-detail-outline-header { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1.15rem; border-bottom: 1px solid #e2e8f0; }
.course-detail-outline-header h2 { margin-top: .3rem; font-size: 1.15rem; font-weight: 750; }
.course-detail-outline-header > span { color: #64748b; font-size: .75rem; }
.course-detail-lesson { padding: 0; border-bottom: 1px solid #edf2f7; }
.course-detail-lesson:last-child { border-bottom: 0; }
.course-detail-lesson-heading { display: grid; grid-template-columns: 2.25rem minmax(0,1fr) auto; gap: .8rem; align-items: center; margin-bottom: .8rem; }
.course-detail-lesson-heading > span { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; border: 1px solid #cbd5e1; color: #475569; font-size: .72rem; font-weight: 750; }
.course-detail-lesson-heading h3 { font-size: .9rem; font-weight: 750; }
.course-detail-lesson-heading p { margin-top: .12rem; color: #94a3b8; font-size: .7rem; }
.course-detail-lesson-heading > i { color: #2451f2; }
.course-detail-lesson.is-locked .course-detail-lesson-heading > i { color: #94a3b8; }
.course-lesson-toggle { display: grid; grid-template-columns: 2rem minmax(0,1fr) auto 1rem 1rem; align-items: center; gap: .75rem; width: 100%; padding: .85rem 1.15rem; color: #1e293b; text-align: left; background: transparent; border: 0; cursor: pointer; transition: background .16s ease; }
.course-lesson-toggle:hover { background: #f8fafc; }
.course-lesson-toggle[aria-expanded="true"] { background: #f8fafc; }
.course-lesson-number { display: grid; place-items: center; width: 2rem; height: 2rem; border: 1px solid #cbd5e1; border-radius: 50%; color: #475569; font-size: .66rem; font-weight: 750; }
.course-lesson-summary { min-width: 0; }
.course-lesson-summary strong, .course-lesson-summary small, .course-lesson-meta strong, .course-lesson-meta small { display: block; }
.course-lesson-summary strong { font-size: .8rem; }
.course-lesson-summary small { margin-top: .12rem; overflow: hidden; color: #64748b; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.course-lesson-meta { min-width: 6rem; text-align: right; }
.course-lesson-meta strong { color: #475569; font-size: .68rem; font-weight: 650; }
.course-lesson-meta small { margin-top: .1rem; color: #94a3b8; font-size: .62rem; }
.course-lesson-status { color: #2451f2; font-size: .76rem; }
.course-detail-lesson.is-locked .course-lesson-status { color: #94a3b8; }
.course-lesson-chevron { color: #94a3b8; font-size: .65rem; transition: transform .18s ease; }
.course-lesson-chevron.is-open { transform: rotate(180deg); }
.course-detail-tasks { display: grid; gap: .45rem; margin-left: 3rem; }
.course-lesson-content { margin: 0; padding: 0 1.15rem .85rem 3.9rem; background: #f8fafc; }
.course-lesson-content.hidden { display: none; }
.course-detail-task { display: flex; align-items: center; gap: .8rem; min-height: 3.65rem; padding: .65rem .85rem; border: 1px solid #e2e8f0; border-radius: .78rem; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
a.course-detail-task:hover { transform: translateX(2px); border-color: #b9c8fb; background: #f7f9ff; }
.course-detail-task > span:nth-child(2) { flex: 1; min-width: 0; }
.course-detail-task strong { display: block; color: #1e293b; font-size: .82rem; }
.course-detail-task small { display: block; margin-top: .18rem; color: #94a3b8; font-size: .68rem; }
.course-task-icon { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; flex: 0 0 auto; border-radius: .65rem; color: #2451f2; background: #eef3ff; }
.course-detail-exam .course-task-icon { color: #475569; background: #f1f5f9; }
.course-task-arrow { color: #94a3b8; font-size: .65rem; }
.course-detail-task.is-locked { opacity: .58; background: #f8fafc; }
.course-progress-card { position: sticky; top: 5.5rem; padding: 1rem; }
.course-continue-button { display: flex; align-items: center; justify-content: center; gap: .6rem; width: 100%; padding: .9rem 1rem; border-radius: .8rem; color: #fff; background: #2451f2; font-size: .84rem; font-weight: 750; box-shadow: 0 10px 24px rgba(36,81,242,.2); }
.course-continue-button:hover { background: #1f46d4; }
.course-progress-heading { display: flex; align-items: center; justify-content: space-between; margin-top: 1.45rem; color: #475569; font-size: .78rem; }
.course-progress-heading strong { color: #0f172a; font-size: 1.05rem; }
.course-progress-track { height: .48rem; margin-top: .65rem; overflow: hidden; border-radius: 999px; background: #e9eef5; }
.course-progress-track span { display: block; height: 100%; border-radius: inherit; background: #2451f2; }
.course-progress-copy { margin-top: .55rem; color: #94a3b8; font-size: .68rem; }
.course-progress-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: 1.25rem; }
.course-progress-stats div { padding: .85rem; border-radius: .75rem; background: #f8fafc; }
.course-progress-stats span, .course-progress-stats small { display: block; }
.course-progress-stats span { color: #1e293b; font-size: .9rem; font-weight: 750; }
.course-progress-stats small { margin-top: .18rem; color: #94a3b8; font-size: .62rem; }
.course-completion-rule { display: flex; gap: .65rem; margin-top: 1rem; padding: .85rem; border: 1px solid #e2e8f0; border-radius: .75rem; color: #64748b; background: #fbfdff; }
.course-completion-rule i { margin-top: .12rem; color: #2451f2; }
.course-completion-rule strong { display: block; color: #334155; font-size: .72rem; }
.course-completion-rule p { margin-top: .2rem; font-size: .65rem; line-height: 1.5; }
.course-detail-empty { padding: 4rem 1rem; color: #94a3b8; text-align: center; }
.course-detail-empty i { margin-bottom: .7rem; font-size: 2rem; }

/* --------------------------------------------------------------------------
   Dark learning workspace
   -------------------------------------------------------------------------- */

.learning-player-loading, .learning-access-error { min-height: 100vh; display: grid; place-content: center; background: #071225; color: #dbe7ff; text-align: center; }
.learning-access-error { gap: .7rem; padding: 2rem; }
.learning-access-error > i { color: #7996d9; font-size: 2rem; }
.learning-access-error h1 { color: #fff; font-size: 1.5rem; font-weight: 750; }
.learning-access-error p { color: #91a3c5; }
.learning-access-error a { margin-top: .7rem; padding: .7rem 1rem; border-radius: .65rem; background: #2451f2; color: #fff; }
.dark-learning-shell { min-height: 100vh; display: grid; grid-template-columns: 330px minmax(0, 1fr); background: #071225; color: #dbe7ff; }
.dark-learning-sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 1px solid rgba(148,163,184,.15); background: #0b1830; box-shadow: 15px 0 40px rgba(0,0,0,.12); z-index: 30; }
.learning-sidebar-top { display: flex; align-items: center; justify-content: space-between; height: 4.5rem; padding: 0 1.2rem; border-bottom: 1px solid rgba(148,163,184,.13); }
.learning-return { display: flex; align-items: center; gap: .55rem; color: #b7c5df; font-size: .75rem; font-weight: 650; }
.learning-return:hover { color: #fff; }
#close-learning-sidebar { display: none; color: #94a3b8; }
.learning-sidebar-course { padding: 1.35rem 1.2rem 1.25rem; border-bottom: 1px solid rgba(148,163,184,.13); }
.learning-sidebar-course > p { color: #6f8bd0; font-size: .62rem; font-weight: 750; letter-spacing: .15em; text-transform: uppercase; }
.learning-sidebar-course h1 { margin-top: .5rem; color: #fff; font-size: 1rem; font-weight: 700; line-height: 1.4; }
.learning-sidebar-progress-copy { display: flex; justify-content: space-between; margin-top: 1.1rem; color: #8193b3; font-size: .67rem; }
.learning-sidebar-progress-copy strong { color: #cbd7ed; }
.learning-sidebar-progress { height: .35rem; margin-top: .5rem; overflow: hidden; border-radius: 999px; background: #1b2a45; }
.learning-sidebar-progress span { display: block; height: 100%; border-radius: inherit; background: #4d76ff; }
.learning-sidebar-section { padding-bottom: 1rem; }
#learning-section-toggle { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 1.15rem 1.2rem .85rem; text-align: left; }
#learning-section-toggle small, #learning-section-toggle strong { display: block; }
#learning-section-toggle small { color: #62779d; font-size: .58rem; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
#learning-section-toggle strong { margin-top: .25rem; color: #e7edfa; font-size: .82rem; }
#learning-section-toggle > i { color: #62779d; font-size: .65rem; }
.learning-outline-list { padding: 0 .65rem; }
.learning-outline-lesson { position: relative; padding-bottom: .45rem; }
.learning-outline-lesson:not(:last-child)::after { content: ""; position: absolute; left: 1.65rem; top: 2.9rem; bottom: -.15rem; width: 1px; background: #263653; }
.learning-outline-video { position: relative; z-index: 1; display: flex; align-items: center; gap: .72rem; min-height: 4.25rem; padding: .65rem .7rem; border-left: 3px solid transparent; border-radius: .7rem; color: #becae0; transition: background .16s ease, border-color .16s ease; }
a.learning-outline-video:hover { background: #12233f; }
.learning-outline-video.is-active { border-left-color: #4d76ff; background: #14294d; }
.learning-outline-video.is-locked { opacity: .48; }
.learning-outline-index { display: grid; place-items: center; flex: 0 0 auto; width: 2.05rem; height: 2.05rem; border: 1px solid #3a4c6c; border-radius: 50%; color: #9aacca; font-size: .67rem; font-weight: 750; background: #0b1830; }
.learning-outline-video.is-active .learning-outline-index { border-color: #4d76ff; color: #fff; background: #315fe7; }
.learning-outline-copy { min-width: 0; flex: 1; }
.learning-outline-copy strong, .learning-outline-copy small { display: block; }
.learning-outline-copy strong { color: inherit; font-size: .74rem; line-height: 1.4; }
.learning-outline-copy small { margin-top: .2rem; color: #62779d; font-size: .62rem; }
.learning-outline-status { color: #7184a7; font-size: .72rem; }
.learning-outline-video.is-active .learning-outline-status, .learning-outline-exam.is-complete .fa-circle-check { color: #6f91ff; }
.learning-outline-exam { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; margin: .05rem 0 .25rem 2.9rem; padding: .58rem .7rem; border-radius: .52rem; color: #91a3c2; background: #101f38; font-size: .68rem; font-weight: 650; }
a.learning-outline-exam:hover, .learning-outline-exam.is-active { color: #fff; background: #18305a; }
.learning-outline-exam.is-locked { opacity: .45; }
.dark-learning-main { min-width: 0; min-height: 100vh; background: radial-gradient(circle at 70% 0%, rgba(39,72,138,.2), transparent 34%), #071225; }
.dark-learning-toolbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; min-height: 4.5rem; padding: .7rem 1.35rem; border-bottom: 1px solid rgba(148,163,184,.14); background: rgba(7,18,37,.92); backdrop-filter: blur(12px); }
.learning-toolbar-title { display: flex; align-items: center; gap: .8rem; min-width: 0; }
#open-learning-sidebar { display: none; width: 2.25rem; height: 2.25rem; border: 1px solid #273957; border-radius: .55rem; color: #a8b7d3; }
.learning-toolbar-title span { min-width: 0; }
.learning-toolbar-title small, .learning-toolbar-title strong { display: block; }
.learning-toolbar-title small { color: #61779f; font-size: .58rem; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.learning-toolbar-title strong { margin-top: .2rem; overflow: hidden; color: #edf3ff; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.learning-toolbar-actions { display: flex; gap: .5rem; }
.learning-toolbar-actions button { display: inline-flex; align-items: center; gap: .5rem; padding: .55rem .8rem; border: 1px solid #2b3d5d; border-radius: .55rem; color: #b6c4dd; font-size: .68rem; font-weight: 650; background: #0d1b33; }
.learning-toolbar-actions button:hover:not(:disabled) { border-color: #4d76ff; color: #fff; }
.learning-toolbar-actions button:disabled { opacity: .34; cursor: not-allowed; }
.learning-stage-wrap { width: 100%; max-width: 1500px; margin: 0 auto; padding: clamp(1rem, 2.3vw, 2rem); }
.learning-task-panel { overflow: hidden; border: 1px solid #1f304f; border-radius: 1rem; background: #0b172c; box-shadow: 0 24px 70px rgba(0,0,0,.28); }
.learning-video-stage { position: relative; aspect-ratio: 16/9; overflow: hidden; background: #000; }
.learning-video-wrapper, .learning-video { width: 100%; height: 100%; }
.learning-video-wrapper { display: flex; align-items: center; justify-content: center; }
.learning-video { display: block; object-fit: contain; background: #000; }
.video-credit-status { position: absolute; top: 1rem; right: 1rem; z-index: 5; display: flex; align-items: center; gap: .55rem; padding: .55rem .75rem; border: 1px solid rgba(255,255,255,.13); border-radius: .55rem; color: #dce6f8; background: rgba(4,10,20,.78); backdrop-filter: blur(9px); font-size: .68rem; box-shadow: 0 8px 24px rgba(0,0,0,.25); pointer-events: none; }
.video-credit-status i { color: #f5b942; }
.video-credit-status strong { color: #f5b942; font-weight: 750; }
.learning-video-overlay { position: absolute; inset: 0; z-index: 12; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem; color: #fff; text-align: center; background: rgba(4,10,20,.92); backdrop-filter: blur(8px); }
.learning-video-overlay.hidden, .learning-task-panel.hidden, .learning-outline-list.hidden { display: none; }
.learning-video-overlay > i { margin-bottom: .9rem; color: #7794d9; font-size: 2rem; }
.learning-video-overlay h3 { max-width: 38rem; font-size: clamp(1.05rem,2vw,1.5rem); font-weight: 750; }
.learning-video-overlay p { margin-bottom: .35rem; color: #c1cee4; font-size: .78rem; }
.learning-video-overlay > p + h3 { margin-top: .2rem; }
.learning-video-overlay small { margin-top: .55rem; color: #91a3c5; }
.learning-video-overlay button { margin-top: 1.2rem; padding: .75rem 1.15rem; border-radius: .65rem; color: #fff; background: #315fe7; font-size: .76rem; font-weight: 750; }
.completion-check { display: grid; place-items: center; width: 3.4rem; height: 3.4rem; margin-bottom: 1rem; border: 1px solid #5f82e9; border-radius: 50%; color: #fff; background: #315fe7; box-shadow: 0 0 0 8px rgba(49,95,231,.14); }
.learning-video-footer { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; color: #7186aa; font-size: .67rem; }
.learning-video-footer span { display: flex; align-items: center; gap: .45rem; }
.learning-video-footer i { color: #6f91ff; }
.learning-video-error { display: flex; flex-direction: column; align-items: center; color: #cbd7ed; }
.learning-video-error i { margin-bottom: .7rem; color: #f59e0b; font-size: 2rem; }
.learning-video-error small { margin-top: .3rem; color: #8193b3; }
.learning-exam-panel { padding: clamp(1rem, 3vw, 2.4rem); }
.learning-exam-heading { margin-bottom: 1.5rem; }
.learning-exam-heading > p { color: #6f91ff; font-size: .62rem; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.learning-exam-heading h2 { margin-top: .45rem; color: #f3f7ff; font-size: 1.35rem; font-weight: 750; }
.learning-exam-heading > span { display: block; margin-top: .45rem; color: #7186aa; font-size: .68rem; }
.learning-quiz-form { display: grid; gap: 1rem; }
.learning-quiz-form fieldset { padding: 1.15rem; border: 1px solid #223552; border-radius: .8rem; background: #0e1d35; }
.learning-quiz-form legend { display: flex; gap: .75rem; width: 100%; color: #e6edfb; font-size: .82rem; font-weight: 650; line-height: 1.5; }
.learning-quiz-form legend > span { display: grid; place-items: center; flex: 0 0 auto; width: 1.85rem; height: 1.85rem; border-radius: 50%; color: #9fb4df; background: #182b4b; font-size: .62rem; }
.learning-quiz-form fieldset > div { display: grid; gap: .5rem; margin-top: 1rem; margin-left: 2.6rem; }
.learning-question-heading { display: flex !important; align-items: flex-start; gap: .75rem !important; width: 100%; min-width: 0; margin: 0 !important; color: #e6edfb; font-size: .82rem; font-weight: 650; line-height: 1.5; }
.learning-question-heading > span:first-child { display: grid; place-items: center; flex: 0 0 1.85rem; width: 1.85rem; height: 1.85rem; border-radius: 50%; color: #9fb4df; background: #182b4b; font-size: .62rem; }
.learning-question-heading .question-text-content { flex: 1; width: auto; min-width: 0; }
.learning-question-options { display: grid; gap: .5rem; width: auto; margin: 1rem 0 0 2.6rem !important; }
.learning-quiz-form label { display: flex; align-items: center; gap: .65rem; padding: .7rem .8rem; border: 1px solid #263957; border-radius: .6rem; color: #aebdd6; font-size: .75rem; cursor: pointer; transition: border-color .16s ease, background .16s ease; }
.learning-quiz-form label:hover { border-color: #476bcf; background: #122541; }
.learning-quiz-form label:has(input:checked) { border-color: #4d76ff; color: #fff; background: #173363; }
.learning-quiz-form input { accent-color: #4d76ff; }
.learning-primary-button, .learning-secondary-button, .learning-text-button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border-radius: .6rem; font-size: .72rem; font-weight: 700; }
.learning-primary-button { padding: .72rem 1rem; color: #fff; background: #315fe7; }
.learning-primary-button:hover { background: #2753d6; }
.learning-secondary-button { padding: .7rem 1rem; border: 1px solid #2e4263; color: #b9c7df; background: #101f38; }
.learning-text-button { margin-bottom: 1.2rem; color: #91a6cc; }
.learning-submit-exam { width: 100%; margin-top: .35rem; padding: .9rem; }
.learning-exam-state { min-height: 26rem; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #91a3c2; text-align: center; }
.learning-exam-state > i { margin-bottom: 1rem; color: #7088b7; font-size: 2.3rem; }
.learning-exam-state.is-success > i { color: #6f91ff; }
.learning-exam-state h2 { color: #f0f5ff; font-size: 1.25rem; font-weight: 750; }
.learning-exam-state p { margin: .45rem 0 1.2rem; font-size: .75rem; }
.learning-exam-state > div { display: flex; gap: .55rem; }
.learning-exam-result { padding: 2rem 1rem; text-align: center; }
.learning-exam-result > i { color: #6f91ff; font-size: 2.7rem; }
.learning-exam-result.is-failed > i { color: #f87171; }
.learning-exam-result > p { margin-top: .7rem; color: #91a3c5; font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; }
.learning-exam-result h2 { margin-top: .25rem; color: #fff; font-size: 2.5rem; font-weight: 750; }
.learning-exam-result > span { display: block; color: #8093b5; font-size: .72rem; }
.learning-exam-result > div { margin-top: 1.2rem; }
.dark-learning-main #quiz-section > .border-t { border-color: #263957 !important; }
.dark-learning-main #quiz-section .text-slate-700, .dark-learning-main #quiz-section .text-slate-800 { color: #e5edfb !important; }
.dark-learning-main #quiz-section .text-slate-500, .dark-learning-main #quiz-section .text-slate-600 { color: #91a3c2 !important; }
.dark-learning-main #quiz-section details { color: #91a3c2; }
.dark-learning-main #quiz-section .bg-emerald-50\/50 { background: rgba(16,185,129,.08) !important; }
.dark-learning-main #quiz-section .bg-rose-50\/50 { background: rgba(244,63,94,.08) !important; }

/* The course shell remains dark while every exam step uses a calm light workspace. */
.dark-learning-main.is-exam-view { background: #f4f6f9; }
.dark-learning-main.is-exam-view .learning-stage-wrap { min-height: calc(100vh - 4.5rem); max-width: none; background: #f4f6f9; }
#quiz-panel { min-height: calc(100vh - 8.5rem); border-color: #dce4ee; background: #fff; box-shadow: 0 18px 55px rgba(15,23,42,.12); }
#quiz-panel #quiz-section { width: 100%; max-width: 1120px; margin: 0 auto; color: #1e293b; }
#quiz-panel .learning-exam-state { color: #64748b; }
#quiz-panel .learning-exam-state h2 { color: #0f172a; }
#quiz-panel .learning-exam-state > i { color: #64748b; }
#quiz-panel .learning-primary-button { color: #fff; background: #2451f2; }
#quiz-panel .learning-primary-button:hover { background: #1f46d4; }
#quiz-panel .learning-secondary-button { border: 1px solid #cbd5e1; color: #334155; background: #fff; }
#quiz-panel .learning-secondary-button:hover { border-color: #94a3b8; background: #f8fafc; }
#quiz-panel .learning-text-button { color: #475569; }
.exam-overview { padding: clamp(.4rem, 1vw, .8rem); }
.exam-overview-title { text-align: center; }
.exam-overview-title > span { display: grid; place-items: center; width: 3rem; height: 3rem; margin: 0 auto .8rem; border-radius: .8rem; color: #2451f2; background: #edf2ff; font-size: 1.15rem; }
.exam-overview-title > p, .exam-light-header > p { color: #2451f2; font-size: .65rem; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.exam-overview-title h2 { margin-top: .35rem; color: #0f172a; font-size: clamp(1.35rem,2.3vw,1.8rem); font-weight: 750; }
.exam-overview-title small { display: block; margin-top: .35rem; color: #64748b; font-size: .75rem; }
.exam-info-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0; margin-top: 1.6rem; overflow: hidden; border: 1px solid #e2e8f0; border-radius: .85rem; background: #fff; }
.exam-info-item { display: flex; align-items: center; gap: .75rem; min-height: 4.6rem; padding: .85rem 1rem; border-bottom: 1px solid #edf1f5; }
.exam-info-item:nth-child(odd) { border-right: 1px solid #edf1f5; }
.exam-info-item:nth-last-child(-n+2) { border-bottom: 0; }
.exam-info-item:last-child:nth-child(odd) { border-bottom: 0; }
.exam-info-item > i { display: grid; place-items: center; width: 2rem; height: 2rem; flex: 0 0 auto; border-radius: .55rem; color: #475569; background: #f1f5f9; font-size: .75rem; }
.exam-info-item span, .exam-info-item small, .exam-info-item strong { display: block; }
.exam-info-item small { color: #94a3b8; font-size: .64rem; }
.exam-info-item strong { margin-top: .15rem; color: #1e293b; font-size: .78rem; font-weight: 700; }
.question-text-content, .question-text-intro, .question-statements, .question-statements > span { display: block; }
.question-text-content { flex: 1; min-width: 0; }
.question-statements { display: grid; gap: .38rem; margin-top: .55rem; color: #475569; font-weight: 500; }
.question-statements > span { padding: .42rem .55rem; border-left: 2px solid #cbd5e1; background: #f8fafc; line-height: 1.45; }
.exam-instructions { display: flex; gap: .7rem; margin-top: 1rem; padding: .85rem 1rem; border: 1px solid #dbe5ff; border-radius: .7rem; color: #334155; background: #f7f9ff; }
.exam-instructions > i { margin-top: .08rem; color: #2451f2; }
.exam-instructions strong { font-size: .72rem; }
.exam-instructions p { margin-top: .2rem; color: #64748b; font-size: .68rem; line-height: 1.5; }
.exam-start-button { display: flex; width: min(100%, 15rem); margin: 1.35rem auto 0; padding: .85rem 1rem; }
.exam-light-header { margin-bottom: 1.15rem; padding-bottom: 1rem; border-bottom: 1px solid #e2e8f0; }
.exam-light-header h2 { margin-top: .35rem; color: #0f172a; font-size: 1.35rem; font-weight: 750; }
.exam-light-header > span { display: block; margin-top: .35rem; color: #64748b; font-size: .7rem; }
.exam-light-header .learning-text-button { margin-bottom: 1rem; }
#quiz-panel .learning-quiz-form { gap: .8rem; }
#quiz-panel .learning-quiz-form fieldset { padding: 1rem; border-color: #dce4ee; background: #fff; }
#quiz-panel .learning-quiz-form legend { color: #1e293b; }
#quiz-panel .learning-quiz-form legend > span { color: #2451f2; background: #edf2ff; }
#quiz-panel .learning-question-heading { color: #1e293b; }
#quiz-panel .learning-question-heading > span:first-child { color: #2451f2; background: #edf2ff; }
#quiz-panel .learning-quiz-form label { border-color: #e2e8f0; color: #475569; background: #fff; }
#quiz-panel .learning-quiz-form label:hover { border-color: #b8c7f6; background: #f8faff; }
#quiz-panel .learning-quiz-form label:has(input:checked) { border-color: #2451f2; color: #1e293b; background: #eef3ff; }
#quiz-panel .learning-submit-exam:disabled { opacity: .65; cursor: wait; }
.exam-result-page { display: grid; gap: 1rem; }
.exam-result-card { display: grid; grid-template-columns: auto minmax(0,1fr) minmax(19rem,.85fr); align-items: center; gap: 1.2rem; padding: 1.35rem; border: 1px solid #dce4ee; border-radius: .9rem; background: #fff; }
.exam-result-icon { display: grid; place-items: center; width: 3.3rem; height: 3.3rem; border-radius: 50%; color: #059669; background: #ecfdf5; font-size: 1.35rem; }
.exam-result-card.is-failed .exam-result-icon { color: #dc2626; background: #fef2f2; }
.exam-result-card > div > p { color: #64748b; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.exam-result-card > div > h2 { margin-top: .1rem; color: #0f172a; font-size: 2.2rem; font-weight: 750; }
.exam-result-card > div > small { color: #64748b; font-size: .68rem; }
.exam-result-card dl { display: grid; grid-template-columns: repeat(3,1fr); overflow: hidden; border: 1px solid #e2e8f0; border-radius: .7rem; }
.exam-result-card dl div { padding: .7rem; border-right: 1px solid #e2e8f0; }
.exam-result-card dl div:last-child { border-right: 0; }
.exam-result-card dt { color: #94a3b8; font-size: .6rem; }
.exam-result-card dd { margin-top: .2rem; color: #1e293b; font-size: .74rem; font-weight: 700; }
.exam-result-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .55rem; padding: .9rem; border: 1px solid #dce4ee; border-radius: .8rem; background: #fff; }
.answer-sheet { overflow: hidden; border: 1px solid #dce4ee; border-radius: .9rem; background: #fff; }
.answer-sheet-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.1rem; border-bottom: 1px solid #e2e8f0; }
.answer-sheet-heading p { color: #2451f2; font-size: .62rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.answer-sheet-heading h3 { margin-top: .2rem; color: #0f172a; font-size: .95rem; font-weight: 750; }
.answer-sheet-heading > span { color: #475569; font-size: .7rem; font-weight: 700; }
.answer-sheet-list { display: grid; }
.answer-sheet-item { display: grid; grid-template-columns: 2rem minmax(0,1fr) auto; align-items: start; gap: .8rem; padding: 1rem 1.1rem; border-bottom: 1px solid #edf1f5; }
.answer-sheet-item:last-child { border-bottom: 0; }
.answer-sheet-number { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; color: #475569; background: #f1f5f9; font-size: .62rem; font-weight: 750; }
.answer-sheet-item h4 { color: #1e293b; font-size: .78rem; font-weight: 700; line-height: 1.45; }
.answer-sheet-item p { margin-top: .35rem; color: #334155; font-size: .7rem; }
.answer-sheet-item p span { color: #94a3b8; }
.answer-sheet-item > strong { display: inline-flex; align-items: center; gap: .35rem; color: #059669; font-size: .68rem; }
.answer-sheet-item.is-incorrect > strong { color: #dc2626; }

@media (max-width: 1023px) {
  .course-detail-hero { flex-direction: column; }
  .course-detail-meta { min-width: 0; }
  .course-detail-grid { grid-template-columns: minmax(0,1fr); }
  .course-progress-card { position: static; grid-row: 1; }
  .dark-learning-shell { grid-template-columns: minmax(0,1fr); }
  .dark-learning-sidebar { position: fixed; left: 0; top: 0; width: min(88vw, 330px); transform: translateX(-105%); transition: transform .2s ease; }
  .dark-learning-sidebar.is-open { transform: translateX(0); }
  #open-learning-sidebar, #close-learning-sidebar { display: grid; place-items: center; }
  body.learning-sidebar-open::after { content: ""; position: fixed; inset: 0; z-index: 25; background: rgba(0,0,0,.55); }
  .exam-result-card { grid-template-columns: auto minmax(0,1fr); }
  .exam-result-card dl { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .course-detail-hero { padding: 1.3rem; }
  .course-detail-meta { grid-template-columns: 1fr 1fr; }
  .course-detail-grid { gap: 1rem; }
  .course-detail-outline-header { padding-left: 1rem; padding-right: 1rem; }
  .course-detail-lesson { padding: 0; }
  .course-lesson-toggle { grid-template-columns: 1.9rem minmax(0,1fr) 1rem 1rem; gap: .55rem; padding: .8rem 1rem; }
  .course-lesson-meta { display: none; }
  .course-lesson-content { margin-left: 0; padding: 0 1rem .8rem; }
  .learning-toolbar-actions button span { display: none; }
  .learning-toolbar-actions button { width: 2.2rem; height: 2.2rem; padding: 0; justify-content: center; }
  .learning-stage-wrap { padding: .7rem; }
  .learning-task-panel { border-radius: .75rem; }
  .video-credit-status { top: .55rem; right: .55rem; max-width: calc(100% - 1.1rem); font-size: .58rem; }
  .learning-video-footer { align-items: flex-start; flex-direction: column; }
  .learning-quiz-form fieldset > div { margin-left: 0; }
  .learning-question-options { margin-left: 0 !important; }
  .exam-info-grid { grid-template-columns: 1fr; }
  .exam-info-item:nth-child(odd) { border-right: 0; }
  .exam-info-item:nth-last-child(2) { border-bottom: 1px solid #edf1f5; }
  .exam-result-card { grid-template-columns: 1fr; text-align: center; }
  .exam-result-icon { margin: 0 auto; }
  .exam-result-card dl { grid-column: auto; }
  .exam-result-actions { justify-content: stretch; }
  .exam-result-actions > * { width: 100%; }
  .answer-sheet-item { grid-template-columns: 2rem minmax(0,1fr); }
  .answer-sheet-item > strong { grid-column: 2; }
}
