:root {
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-deep: #1e3a8a;
  --accent-soft: #eff6ff;
  --accent-line: #d3e2fd;

  --success: #079455;
  --success-soft: #e7f6ef;
  --success-line: #b8e6cf;

  --ink: #101828;
  --ink-body: #344054;
  --ink-soft: #475467;
  --ink-muted: #667085;
  --ink-faint: #98a2b3;

  --bg-page: #f6f7f9;
  --surface: #ffffff;
  --surface-alt: #f9fafb;
  --surface-dim: #f2f4f7;

  --border: #e4e7ec;
  --border-soft: #eef1f4;
  --border-strong: #d0d5dd;

  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.07), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 12px 16px -4px rgba(16, 24, 40, 0.08), 0 4px 6px -2px rgba(16, 24, 40, 0.03);
  --shadow-xl: 0 20px 24px -4px rgba(16, 24, 40, 0.08), 0 8px 8px -4px rgba(16, 24, 40, 0.03);

  --radius-sm: 8px;
  --radius: 10px;
  --radius-md: 12px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  --wrap: 1240px;
  --wrap-course: 1520px;

  --font-body: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;

  --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.18);

  --t-fast: 130ms ease;
  --t-base: 200ms ease;
}

/* ---------- 02. BASE Y TIPOGRAFÍA ---------- */
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
html, body { height: 100%; }

body,
body.dashboard-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  background: var(--bg-page);
  color: var(--ink-body);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.65;
  text-align: left;
}

main { flex: 1 0 auto; }

h1, h2, h5 {
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

a { color: var(--accent-hover); }
a:hover { color: var(--accent-deep); }


.course-shell.container.wrap { max-width: var(--wrap-course); }

::selection { background: rgba(37, 99, 235, 0.15); }

/* ---------- 03. TOPBAR Y NAVEGACIÓN ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
  padding: 0.55rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  text-decoration: none;
}

.brand-logos {
  height: 34px;
  width: auto;
  display: block;
}

.brand .txt {
  min-width: 0;
  line-height: 1.25;
}
.brand .txt span {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--ink-muted);
}
.brand .txt b {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 520px;
}

.navbar-actions { flex-shrink: 0; }

.icon-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink-soft);
  text-decoration: none;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}
.icon-pill i { font-size: 1rem; }
.icon-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.55rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}
.user-pill:hover,
.user-pill.active {
  border-color: var(--accent);
  color: var(--accent-hover);
  background: var(--accent-soft);
}
.user-pill.dropdown-toggle::after { display: none; }

.user-pill .avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-dim);
  color: var(--ink-soft);
  overflow: hidden;
  flex-shrink: 0;
}
.user-pill:hover .avatar,
.user-pill.active .avatar {
  background: var(--accent);
  color: #fff;
}
.avatar i { font-size: 0.9rem; }
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.user-name { white-space: nowrap; }

.dropdown-menu {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0.35rem;
  font-size: 0.85rem;
  min-width: 230px;
}
.dropdown-item {
  border-radius: 6px;
  padding: 0.5rem 0.6rem;
  color: var(--ink-body);
  font-weight: 500;
  transition: background var(--t-fast), color var(--t-fast);
}
.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--surface-dim);
  color: var(--ink);
}
.dropdown-item:active {
  background: var(--accent-soft);
  color: var(--accent-hover);
}
.dropdown-item .item-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--surface-dim);
  color: var(--ink-soft);
  flex-shrink: 0;
}

/* ---------- 04. ENCABEZADO DEL CURSO / HERO ---------- */
.course-hero {
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.course-hero-banner {
  position: relative;
  padding: 1.25rem 1.5rem;
  min-height: 132px;
  display: flex;
  align-items: center;
  background-color: #e8eef5;
  background-size: cover;
  background-position: center right;
  background-repeat: no-repeat;
  overflow: hidden;
}

/* Vista pública */
.course-hero-banner--servidor {
  background-image:
    linear-gradient(
      90deg,
      rgba(248, 250, 252, 0.98) 0%,
      rgba(248, 250, 252, 0.9) 36%,
      rgba(248, 250, 252, 0.4) 58%,
      transparent 74%
    ),
    url("../cg/assets/img/hero-servidor.png");
}

.course-hero-banner--servidor .course-hero-title {
  color: var(--ink);
}

.course-hero-banner--servidor .course-hero-subtitle {
  color: var(--ink-soft);
}

.course-hero-banner::after {
  display: none;
}

.course-hero-banner-text {
  position: relative;
  z-index: 1;
  max-width: min(58%, 44rem);
  padding-right: 0.5rem;
}

.course-hero-title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.02rem, 1.7vw, 1.28rem);
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
}

.course-hero-subtitle {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.92);
  max-width: 68ch;
}

.course-hero-info {
  display: flex;
  align-items: stretch;
  background: var(--surface-alt);
  border-top: 1px solid var(--border-soft);
}

.course-hero-info-progress {
  flex: 1 1 65%;
  padding: 0.8rem 1.25rem;
  min-width: 0;
}

.course-hero-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.course-hero-progress-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
}

.course-hero-progress-hint {
  margin-top: 0.35rem;
  font-size: 0.74rem;
  color: var(--ink-muted);
  line-height: 1.4;
}

.course-hero-info-divider {
  width: 1px;
  background: var(--border);
  flex-shrink: 0;
}

.course-hero-info-meta {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.8rem 1.35rem;
  min-width: 10rem;
}

.course-hero-meta-line {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  color: var(--ink);
  line-height: 1.3;
}

.course-hero-meta-line i {
  color: var(--accent);
  font-size: 0.92rem;
  flex-shrink: 0;
}

.course-hero-meta-line strong {
  font-weight: 700;
  color: var(--ink);
}

/* ---------- 05. LAYOUT: sidebar + contenido ---------- */
.course-app {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: calc(100vh - 64px);
  flex: 1 0 auto;
}

.course-app-sidebar {
  flex: 0 0 280px;
  width: 280px;
  padding: 1.25rem 1rem 1.5rem;
  background: var(--surface) !important;
  border: 0 !important;
  border-right: 1px solid var(--border) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  position: sticky;
  top: 64px;
  align-self: flex-start;
  height: calc(100vh - 64px);
  overflow-x: hidden;
  overflow-y: auto;
}

.course-app-content {
  flex: 1 1 auto;
  min-width: 0;
  padding: 1.35rem 1.25rem 2.5rem 2rem;
  max-width: none;
}

.course-shell {
  padding: 0;
  margin: 0;
  max-width: none;
}

.course-shell.container.wrap { max-width: none; }

.glass-card,
.glass-sidebar:not(.course-app-sidebar) {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-sm) !important;
  backdrop-filter: none !important;
}

.glass-card-content {
  height: auto !important;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(1.35rem, 2.5vw, 2.25rem)
    clamp(1.35rem, 3.5vw, 3rem) !important;
}

#sectionContent {
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  padding-bottom: 0.5rem;
}

.content-block {
  width: 100%;
  max-width: 100%;
}

/* ---------- 06. SIDEBAR: PROGRESO + RUTA ---------- */
.sidebar-title {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 0.6rem;
}

.progress-percent {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-hover);
}

.progress.progress-bar-autogestivo,
.progress-autogestivo-h {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-dim);
  overflow: hidden;
}
.progress-bar-autogestivo .progress-bar {
  background: var(--accent);
  border-radius: var(--radius-pill);
  transition: width 400ms ease;
}

#modulesList {
  padding-top: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.module-button {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  gap: 0.75rem !important;
  border: 0 !important;
  border-radius: var(--radius-pill) !important;
  background: transparent;
  padding: 0.55rem 0.7rem 0.55rem 0.55rem !important;
  margin-bottom: 0 !important;
  cursor: pointer;
  color: var(--ink-body);
  transition: background var(--t-fast), color var(--t-fast);
}

.module-button i.bi {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.84rem;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  flex: 0 0 auto;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}

.module-button span {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}
.module-button .small {
  font-size: 0.8125rem;
  font-weight: 400;
  color: inherit;
  line-height: 1.35;
}
.module-button .text-truncate {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.module-button:hover {
  background: var(--surface-alt);
  color: var(--ink);
}
.module-button:hover i.bi {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Estado: visitado */
.module-button.completed:not(.active) i.bi {
  background: var(--success-soft);
  color: var(--success);
}
.module-button.completed::before {
  content: "✓";
  position: absolute;
  z-index: 2;
  left: calc(0.55rem + 24px);
  top: calc(50% - 16px);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.52rem;
  font-weight: 800;
  background: var(--success);
  color: #fff;
  border: 2px solid var(--surface);
  pointer-events: none;
}

/* Estado: activo */
.module-button.active {
  background: var(--accent-soft);
  color: var(--accent-hover);
  padding-right: 0.95rem !important;
}
.module-button.active::after {
  content: "";
  position: absolute;
  right: 0;
  top: 18%;
  bottom: 18%;
  width: 3px;
  border-radius: 3px 0 0 3px;
  background: var(--accent);
  pointer-events: none;
}
.module-button.active .small { font-weight: 500; }
.module-button.active i.bi {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ---------- 07. TARJETA DE CONTENIDO ---------- */
.content-header-block {
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-soft);
}

#currentSectionTitle {
  margin: 0;
  font-size: clamp(1.2rem, 1.8vw, 1.45rem);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

#currentSectionTitle::after {
  content: "";
  display: block;
  width: 52px;
  height: 4px;
  margin-top: 0.65rem;
  border-radius: var(--radius-pill);
  background: var(--accent);
}

/* ---------- 08. CONTENIDO INYECTADO ---------- */
.content-section {
  display: flex;
  flex-direction: column;
  font-size: 0.9375rem;
  color: var(--ink-body);
  line-height: 1.75;
}

.content-section h2 { font-size: 1.1rem; margin-bottom: 0.75rem; }
.content-section .h5,
.content-section h5 { font-size: 0.95rem; font-weight: 600; }

.content-section p {
  margin-bottom: 1rem;
  max-width: none;
  text-align: justify;
}
.content-section strong { color: var(--ink); font-weight: 600; }

.content-section ul {
  padding-left: 1.35rem;
  margin-bottom: 1rem;
  max-width: none;
}
.content-section li {
  margin-bottom: 0.35rem;
  text-align: justify;
}
.content-section li::marker { color: var(--ink-muted); }

.content-section a:not(.btn) {
  color: var(--accent-hover);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 2px;
  word-break: break-word;
  transition: color var(--t-fast), text-decoration-color var(--t-fast);
}
.content-section a:not(.btn):hover {
  color: var(--accent-deep);
  text-decoration-color: currentColor;
}

/* Bloques de contenido (sin cards anidadas) */
.content-block + .content-block,
.content-block + .accordion,
.content-block + .alert,
.content-block + .content-embed,
.accordion + .content-block,
.accordion + .alert,
.accordion + .content-embed,
.alert + .content-block,
.content-embed + .content-block {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-soft);
}

.content-section > .content-block:first-child,
.content-section > .accordion:first-child,
.content-section > .alert:first-child,
.content-section > .content-embed:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.content-embed {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-soft);
  background: var(--surface-alt);
}

.content-embed .ratio {
  margin: 0;
}

.content-embed iframe {
  display: block;
  border: 0;
}

/* Accordions */
.accordion-item {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  overflow: hidden;
  background: var(--surface);
  margin-bottom: 0.55rem;
}
.accordion-button {
  background: var(--surface);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ink);
  padding: 0.85rem 1rem;
  box-shadow: none !important;
}
.accordion-button::after { opacity: 0.6; }
.accordion-button:not(.collapsed) {
  background: var(--surface-alt);
  color: var(--accent-hover);
}
.accordion-button:focus { box-shadow: none !important; }
.accordion-body {
  font-size: 0.875rem;
  color: var(--ink-body);
  padding: 1rem 1.05rem;
}

/* Alertas */
.alert {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 0.875rem;
}

/* Tablas */

.table,
.tabla-calendario {
  font-size: 0.85rem;
  color: var(--ink-body);
  border-color: var(--border-soft);
}

.tabla-calendario {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.table thead th,
.tabla-calendario thead th {
  background: var(--surface-alt);
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  padding: 0.7rem 0.8rem;
  text-align: left;
  vertical-align: middle;
}

.table tbody td,
.tabla-calendario tbody td {
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
  background: var(--surface);
}
.tabla-calendario tbody tr:last-child td { border-bottom: 0; }

.tabla-calendario .td-sesion-num {
  font-weight: 600;
  color: var(--ink);
  text-align: center;
}
.tabla-calendario .td-tema { font-weight: 500; color: var(--ink); }
.tabla-calendario .td-fecha {
  font-weight: 600;
  color: var(--accent-hover);
  white-space: nowrap;
}

/* List group */
.list-group-item {
  border-color: var(--border-soft);
  font-size: 0.875rem;
  color: var(--ink-body);
  background: transparent;
}

/* Medios embebidos */
.ratio,
.content-section iframe,
.content-section img {
  border-radius: var(--radius);
}
.ratio iframe { border-radius: var(--radius); }

/* ---------- 09. BOTONERA DE NAVEGACIÓN ---------- */
.nav-botonera-autogestiva {
  border-top: 1px solid var(--border-soft) !important;
  margin-top: 2rem !important;
  padding-top: 1.35rem !important;
}

.btn-pill-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--ink-body);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-xs);
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.btn-pill-outline:hover:not(:disabled) {
  background: var(--surface-alt);
  border-color: var(--ink-faint);
  color: var(--ink);
}

.nav-botonera-autogestiva .btn-nav-prev {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: none;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.nav-botonera-autogestiva .btn-nav-prev:hover:not(:disabled) {
  background: var(--surface-alt);
  border-color: var(--border);
  color: var(--ink);
}
.btn-nav-prev:disabled,
.btn-pill-outline:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-glass,
.btn-nav-next,
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-pill);
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: background var(--t-fast), border-color var(--t-fast);
}
.btn-glass i, .btn-glass .bi, .btn-glass span,
.btn-nav-next i, .btn-nav-next .bi, .btn-nav-next span,
.btn-primary i, .btn-primary .bi, .btn-primary span { color: #fff; }

.btn-glass:hover:not(:disabled),
.btn-nav-next:hover:not(:disabled),
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}
.btn-glass:disabled,
.btn-nav-next:disabled,
.btn-primary:disabled {
  background: #b6ccf5;
  border-color: #b6ccf5;
  color: #fff;
  box-shadow: none;
  cursor: not-allowed;
}

/* ---------- 10. FLOTANTES ---------- */
.btn-subir-flotante {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 1040;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink-soft);
  font-size: 1.3rem;
  box-shadow: var(--shadow-sm);
  padding: 0;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}
.btn-subir-flotante:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* ---------- 11. MODALES, OFFCANVAS Y FORMULARIOS ---------- */
.modal-content {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
}
.modal-header { padding: 1rem 1.25rem; }
.modal-title { font-size: 1rem; font-weight: 600; color: var(--ink); }
.modal-body { padding: 1.25rem; }

.form-control {
  border-radius: var(--radius-sm);
  border-color: var(--border-strong);
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  color: var(--ink);
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}
.btn-outline-secondary {
  border-color: var(--border-strong);
  color: var(--ink-soft);
}
.btn-outline-secondary:hover {
  background: var(--surface-alt);
  border-color: var(--ink-faint);
  color: var(--ink);
}

/* ---------- 12. FOOTER ---------- */
.footer-unam {
  flex-shrink: 0;
  margin-top: 2.5rem;
  padding: 2.5rem 0 2rem;
  background: #0e1f3d;
  color: #b8c4d8;
  font-size: 0.82rem;
}

.footer-unam-logo {
  height: 30px;
  width: auto;
  opacity: 0.95;
}
.footer-unam-divider {
  width: 1px;
  height: 30px;
  background: rgba(255, 255, 255, 0.22);
}

.footer-aviso summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: #fff;
  margin-bottom: 0.5rem;
  list-style: none;
}
.footer-aviso summary::-webkit-details-marker { display: none; }
.footer-aviso-body p {
  font-size: 0.76rem;
  line-height: 1.6;
  color: #93a2bb;
  margin-bottom: 0.5rem;
}

.footer-unam-links a {
  display: inline-block;
  color: #b8c4d8;
  text-decoration: none;
  font-size: 0.8rem;
  margin: 0 0 0.4rem 1rem;
  transition: color var(--t-fast);
}
.footer-unam-links a:hover { color: #fff; }

.footer-unam-social { border-top: 1px solid rgba(255, 255, 255, 0.12); }
.footer-unam-heading {
  font-weight: 600;
  font-size: 0.8rem;
  color: #fff;
}
.footer-unam-social-icons {
  display: flex;
  gap: 0.5rem;
}
.footer-unam-social-icons a {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.footer-unam-social-icons a:hover {
  background: #fff;
  border-color: #fff;
  color: #0e1f3d;
}

/* ---------- 13. HELPERS ---------- */
.spinner-border { color: var(--accent); }

/* ---------- 14. RESPONSIVE Y ACCESIBILIDAD ---------- */
@media (max-width: 991.98px) {
  .course-app {
    flex-direction: column;
    min-height: 0;
  }

  .course-app-sidebar {
    position: static;
    top: auto;
    width: 100%;
    flex: none;
    height: auto;
    max-height: none;
    padding: 0 !important;
    overflow: hidden;
    border-right: 0 !important;
    border-bottom: 1px solid var(--border) !important;
  }

  .course-app-content {
    padding: 1rem 1rem 2rem;
  }

  .course-app-sidebar .sidebar-title[data-collapse-target] {
    padding: 0.9rem 1rem;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
  }

  .course-app-sidebar .sidebar-title[data-collapse-target] .bi-chevron-down {
    transition: transform var(--t-base);
  }

  .course-app-sidebar.is-open .sidebar-title[data-collapse-target] .bi-chevron-down {
    transform: rotate(180deg);
  }

  .course-app-sidebar .collapsible-body { display: none; }

  .course-app-sidebar.is-open .collapsible-body {
    display: block;
    padding: 0 0.75rem 0.9rem;
    max-height: 60vh;
    overflow-y: auto;
  }

  .topbar-inner { gap: 0.6rem; flex-wrap: nowrap; }
  .brand .txt b { max-width: 300px; }
}

@media (max-width: 576px) {
  .brand { gap: 0.5rem; }
  .brand .txt { display: none; }
  .brand-logos { height: 28px; }
  .course-hero-banner {
    padding: 1rem 1.1rem;
    min-height: 112px;
    background-position: 72% center;
  }

  .course-hero-banner-text {
    max-width: 100%;
  }

  .course-hero-info-progress,
  .course-hero-info-meta {
    padding: 0.85rem 1.1rem;
  }

  .course-hero-info {
    flex-direction: column;
  }

  .course-hero-info-divider {
    width: 100%;
    height: 1px;
  }

  .course-hero-info-meta {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    padding: 1rem 1.25rem;
  }

  .content-section h2 { font-size: 1rem; }
  .nav-botonera-autogestiva .d-flex { gap: 0.6rem !important; }
  .btn-nav-prev, .btn-nav-next { flex: 1 1 auto; justify-content: center; }
  .btn-subir-flotante { right: 0.75rem; bottom: 0.75rem; width: 40px; height: 40px; }
  .footer-unam { padding: 2rem 0 1.5rem; }
  .footer-unam-links a { margin-left: 0; margin-right: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-contrast: high) {
  :root {
    --border: #98a2b3;
    --border-soft: #b5bfcc;
    --ink-muted: #475467;
  }
}

@media (hover: hover) {
  *::-webkit-scrollbar { width: 10px; height: 10px; }
  *::-webkit-scrollbar-track { background: transparent; }
  *::-webkit-scrollbar-thumb {
    background: #cdd5e0;
    border-radius: 999px;
    border: 2.5px solid var(--bg-page);
  }
  *::-webkit-scrollbar-thumb:hover { background: #aeb9c9; }
}

