/* =====================================================================
   custom.css - Retoques suaves sobre el tema Eduport (se carga después del tema).
   Usa las variables del tema, así que funciona igual en modo claro y oscuro.
   ===================================================================== */

/* --- .text-body-secondary es de Bootstrap 5.3 y el tema no la trae: sin esto, en un .badge el texto sale blanco --- */
.text-body-secondary {
	--bs-text-opacity: 1;
	color: var(--bs-secondary-color, rgba(var(--bs-secondary-rgb), var(--bs-text-opacity))) !important;
}

/* --- Emails como imagen (anti-spam, ver email_img() en helpers.php) ---
   El PNG es solo una máscara: se pinta con el color del texto, así que vale en modo claro y oscuro.
   Alto = ascendente + descendente de la fuente (1.12em) y bajado 0.21em para alinear la línea base. */
.email-img {
	display: inline-block;
	height: 1.12em;
	vertical-align: -0.21em;
	max-width: 100%;
	background-color: currentColor;
	-webkit-mask: no-repeat center / contain;
	mask: no-repeat center / contain;
}
.email-img-info { aspect-ratio: 1270 / 112; -webkit-mask-image: url(../images/email/info.png); mask-image: url(../images/email/info.png); }
.email-img-estudiantes { aspect-ratio: 1625 / 112; -webkit-mask-image: url(../images/email/estudiantes.png); mask-image: url(../images/email/estudiantes.png); }
.email-img-empresas { aspect-ratio: 1551 / 112; -webkit-mask-image: url(../images/email/empresas.png); mask-image: url(../images/email/empresas.png); }

/* --- Buscador de la cabecera (Nav Search de Eduport): ancho fijo en escritorio para no empujar el menú --- */
@media (min-width: 1200px) {
	.buscador-cabecera { width: 230px; flex-shrink: 0; }
}
@media (min-width: 1400px) {
	.buscador-cabecera { width: 280px; }
}

/* --- Texto: algo más de interlineado en descripciones y párrafos largos --- */
.card-body p,
.lead {
	line-height: 1.7;
}

/* --- Tarjetas de curso: imágenes del mismo tamaño y ligera elevación al pasar el ratón --- */
.card-curso {
	transition: transform .2s ease, box-shadow .2s ease;
}
.card-curso:hover {
	transform: translateY(-4px);
	box-shadow: 0 .75rem 1.5rem rgba(var(--bs-primary-rgb), .12) !important;
}
.card-curso .card-img-top,
.card-curso-img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}
.card-curso .card-title a {
	color: inherit;
}
.card-curso .card-title a:hover {
	color: var(--bs-primary);
}
/* En escritorio el precio va en su propia línea, centrado */
@media (min-width: 992px) {
	.card-curso .card-curso-precio {
		width: 100%;
		justify-items: center;
	}
}
/* Precio y botón "Añadir a la cesta" superpuestos en la misma celda: al pasar el ratón
   por el precio se oculta y aparece el botón, sin que la tarjeta cambie de alto */
.card-curso .card-curso-precio {
	display: grid;
	align-items: center;
}
.card-curso .card-curso-precio > * {
	grid-area: 1 / 1;
	transition: opacity .2s ease, visibility .2s ease;
}
.card-curso .card-curso-precio-boton {
	opacity: 0;
	visibility: hidden;
}
@media (hover: hover) {
	.card-curso .card-curso-precio:hover .card-curso-precio-importe,
	.card-curso .card-curso-precio:focus-within .card-curso-precio-importe {
		opacity: 0;
		visibility: hidden;
	}
	.card-curso .card-curso-precio:hover .card-curso-precio-boton,
	.card-curso .card-curso-precio:focus-within .card-curso-precio-boton {
		opacity: 1;
		visibility: visible;
	}
}

/* --- Botones: transición suave y estado al pulsar --- */
.btn {
	transition: color .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.btn:active:not(:disabled) {
	transform: translateY(1px);
}

/* --- Accesibilidad: foco visible al navegar con teclado --- */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.nav-link:focus-visible,
.dropdown-item:focus-visible,
[role="button"]:focus-visible {
	outline: 2px solid var(--bs-primary);
	outline-offset: 2px;
	box-shadow: none;
}

/* --- Formularios: foco más claro --- */
.form-control:focus,
.form-select:focus {
	border-color: rgba(var(--bs-primary-rgb), .5);
	box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .15);
}

/* --- Cabecera fija: sombra sutil en lugar de solo la línea inferior --- */
.navbar-sticky-on {
	box-shadow: 0 .25rem 1rem rgba(0, 0, 0, .06);
}
[data-theme="dark"] .navbar-sticky-on {
	box-shadow: 0 .25rem 1rem rgba(0, 0, 0, .35);
}

/* --- Menús desplegables: elementos más cómodos de pulsar --- */
.dropdown-menu .dropdown-item {
	padding-top: .45rem;
	padding-bottom: .45rem;
}

/* --- Pestañas de categorías en la portada: que no se corten en móvil --- */
#course-pills-tab {
	row-gap: .5rem;
}

/* --- Selector de avatar del perfil (radios ocultos + etiquetas con imagen) --- */
.avatar-option {
	cursor: pointer;
	border-radius: 50%;
}
.avatar-option img {
	border-color: var(--bs-body-bg) !important;
	transition: transform .15s ease, border-color .15s ease;
}
.avatar-option:hover img {
	transform: scale(1.06);
}
.avatar-option .uploadremove {
	display: none;
	width: 1.4rem;
	height: 1.4rem;
	border-radius: 50%;
	align-items: center;
	justify-content: center;
	border: 2px solid var(--bs-body-bg);
}
.avatar-option .avatar-google {
	width: 1.4rem;
	height: 1.4rem;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: .7rem;
	color: #4285f4;
	background-color: #fff;
	border: 2px solid var(--bs-body-bg);
	box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}
.btn-check:checked + .avatar-option img {
	border-color: var(--bs-primary) !important;
}
.btn-check:checked + .avatar-option .uploadremove {
	display: flex;
}
.btn-check:focus-visible + .avatar-option {
	outline: 2px solid var(--bs-primary);
	outline-offset: 3px;
}

/* --- Temario del reproductor: el tema actual se distingue mejor --- */
#temarioLateral .btn-success.btn-round {
	box-shadow: 0 0 0 .25rem rgba(12, 188, 135, .2);
}
/* Icono siempre centrado en el círculo (en móvil el botón crece y el line-height del tema lo dejaba arriba).
   El triángulo de "play" se desplaza un poco a la derecha para que se vea ópticamente centrado. */
#temarioLateral .btn-round {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	line-height: 1;
}
#temarioLateral .btn-round .fa-play {
	display: block;
	line-height: 1;
	margin-left: .06em;
}

/* --- Toolbar del reproductor: logo, curso actual y cuenta (siempre oscura, como el reproductor) --- */
:root {
	--curso-toolbar-h: 56px;
}

/* Burbuja de emails sin leer sobre la foto de perfil (patrón «Positioned» de Bootstrap).
   Letra algo menor para que la mitad que sobresale quepa en el margen de la barra (avatar de 40px en barra de 56px). */
.correo-burbuja-avatar {
	font-size: .6rem;
	pointer-events: none;
}
.curso-toolbar {
	position: sticky;
	top: 0;
	z-index: 1035;
	height: var(--curso-toolbar-h);
	display: flex;
	align-items: center;
	gap: 1.5rem;
	padding: 0 1rem;
	background-color: #212529;
	border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.curso-toolbar-marca {
	display: inline-flex;
	align-items: center;
	gap: .6rem;
	flex-shrink: 0;
	color: #fff;
	font-family: Roboto, sans-serif;
	font-weight: 700;
	font-size: 1.15rem;
}
.curso-toolbar-marca img {
	height: 36px;
	width: auto;
}
.curso-toolbar-marca:hover {
	color: #fff;
	opacity: .85;
}
.curso-toolbar-centro {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 1.5rem;
}
.curso-toolbar-progreso {
	flex: 0 1 240px;
	min-width: 90px;
	padding-left: 1.5rem;
	border-left: 1px solid rgba(255, 255, 255, .15);
	color: rgba(255, 255, 255, .7);
	font-size: .8rem;
	line-height: 1.2;
}
.curso-toolbar-progreso .progress {
	background-color: rgba(255, 255, 255, .12) !important;
}
.curso-toolbar-curso {
	min-width: 0;
	padding-left: 1.5rem;
	border-left: 1px solid rgba(255, 255, 255, .15);
	color: rgba(255, 255, 255, .7);
	font-size: .9rem;
}
.curso-toolbar-curso:hover {
	color: #fff;
}
.curso-toolbar-enlace {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	padding: .35rem .75rem;
	border-radius: 2rem;
	color: rgba(255, 255, 255, .75);
	font-size: .9rem;
	white-space: nowrap;
}
.curso-toolbar-enlace:hover {
	color: #fff;
	background-color: rgba(255, 255, 255, .08);
}
.curso-toolbar .avatar-img {
	box-shadow: 0 0 0 2px rgba(255, 255, 255, .15);
}

/* --- Reproductor del curso: contenido + temario lateral plegable --- */
/* Alturas con 100dvh: en iPhone/Android 100vh incluye la barra del navegador y tapaba los botones de abajo */
.curso-layout {
	display: flex;
	min-height: calc(100vh - var(--curso-toolbar-h));
	min-height: calc(100dvh - var(--curso-toolbar-h));
	position: relative;
	overflow-x: hidden;
}
.curso-principal {
	flex: 1 1 auto;
	min-width: 0;
}
.curso-temario {
	flex: 0 0 400px;
	width: 400px;
	transition: margin-right .3s ease, transform .3s ease, visibility .3s;
}
.curso-temario-panel {
	height: calc(100vh - var(--curso-toolbar-h));
	height: calc(100dvh - var(--curso-toolbar-h));
	display: flex;
	flex-direction: column;
	border: 0;
	border-left: 1px solid var(--bs-border-color);
}
.curso-temario-panel .card-body {
	flex: 1 1 auto;
	overflow-y: auto;
}
.curso-temario-cerrar {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	padding: .3rem .7rem;
	border-radius: 2rem;
	font-size: .8rem;
	white-space: nowrap;
	flex-shrink: 0;
}
.curso-layout.temario-oculto .curso-temario {
	margin-right: -400px;
	visibility: hidden;
}
/* Pestaña "Temario" pegada al borde derecho cuando el panel está oculto */
.curso-temario-abrir {
	position: fixed;
	top: calc(var(--curso-toolbar-h) + 1rem);
	right: 0;
	z-index: 1030;
	display: inline-flex;
	align-items: center;
	gap: .45rem;
	padding: .55rem .9rem .55rem 1rem;
	border-radius: 2rem 0 0 2rem;
	opacity: 0;
	visibility: hidden;
	transform: translateX(100%);
	transition: transform .3s ease, opacity .3s ease, visibility .3s;
}
.curso-layout.temario-oculto .curso-temario-abrir {
	opacity: 1;
	visibility: visible;
	transform: none;
}
/* "Pregúntale al tutor" flotante, justo debajo de la pestaña "Temario" */
.curso-temario-abrir.curso-tutor-flotante {
	top: calc(var(--curso-toolbar-h) + 4.25rem);
}
.curso-temario-fondo {
	display: none;
}
.curso-layout.sin-transicion .curso-temario,
.curso-layout.sin-transicion .curso-temario-abrir {
	transition: none;
}
/* Móvil y tablet: el temario se abre por encima del contenido */
@media (max-width: 991.98px) {
	.curso-temario {
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		width: min(400px, 90vw);
		z-index: 1045;
		margin-right: 0 !important;
		box-shadow: -.5rem 0 2rem rgba(0, 0, 0, .3);
	}
	.curso-layout.temario-oculto .curso-temario {
		transform: translateX(100%);
	}
	.curso-temario-panel {
		height: 100%;
	}
	/* El botón "Temario" va en el toolbar: la pestaña flotante taparía el texto */
	.curso-temario-abrir {
		display: none !important;
	}
	.curso-toolbar,
	.curso-toolbar-centro {
		gap: .75rem;
	}
	.curso-toolbar {
		padding: 0 .75rem;
	}
	.curso-toolbar .dropdown.ms-3 {
		margin-left: .5rem !important;
	}
	/* Temas solo de vídeo: vídeo a su tamaño natural y, debajo, el tema y los botones */
	.fullscreen-video .plyr--video {
		height: auto;
	}
	.curso-principal {
		background-color: var(--bs-body-bg);
	}
	/* Botones más fáciles de pulsar con el dedo */
	#temarioLateral .btn-round {
		width: 2.4rem;
		height: 2.4rem;
	}
	.btn-avance {
		padding: .55rem;
	}
	.curso-temario-fondo {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 1040;
		background: rgba(0, 0, 0, .5);
		transition: opacity .3s ease;
	}
	.curso-layout.temario-oculto .curso-temario-fondo {
		opacity: 0;
		pointer-events: none;
	}
}
@media (prefers-reduced-motion: reduce) {
	.curso-temario,
	.curso-temario-abrir {
		transition: none;
	}
}

/* Títulos de los temas: hasta 2 líneas en vez de cortarse a un ancho fijo */
.temario-tema-titulo {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-width: 0;
	line-height: 1.35;
}
a.temario-tema-enlace {
	color: inherit;
	text-decoration: none;
	cursor: pointer;
}
a.temario-tema-enlace:hover,
a.temario-tema-enlace:focus-visible {
	text-decoration: underline;
}

/* Icono "visto" del temario: se puede pulsar para marcar/desmarcar */
.btn-avance {
	position: relative;
	z-index: 2; /* por encima del enlace del tema (stretched-link) */
	background: none;
	border: 0;
	padding: .25rem;
	line-height: 1;
	border-radius: 50%;
	cursor: pointer;
	transition: transform .15s ease, background-color .15s ease;
}
.btn-avance:hover {
	transform: scale(1.2);
	background-color: rgba(var(--bs-primary-rgb), .1);
}
.btn-avance:disabled {
	opacity: .5;
	cursor: progress;
}

/* --- Temas de texto en el reproductor del curso --- */
/* Columna a toda la altura: el artículo ocupa el espacio libre y empuja los botones al fondo
   aunque el tema sea corto; si es largo, los botones flotan (sticky) al hacer scroll */
.contenido-tema {
	display: flex;
	flex-direction: column;
	height: calc(100vh - var(--curso-toolbar-h));
	height: calc(100dvh - var(--curso-toolbar-h));
}
.fullscreen-video .plyr--video {
	height: calc(100vh - var(--curso-toolbar-h));
	height: calc(100dvh - var(--curso-toolbar-h));
}
.contenido-tema-articulo {
	flex: 1 0 auto;
	width: 100%;
	max-width: 920px;
}
/* Botones "Anterior" y "Marcar como visto y continuar": barra fija abajo (como la barra de compra móvil),
   sticky dentro de la zona de lectura para no tapar el temario lateral */
.contenido-tema-nav {
	position: sticky;
	bottom: 0;
	z-index: 5;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	padding: .75rem 1rem;
	padding-bottom: calc(.75rem + env(safe-area-inset-bottom));
	background-color: var(--bs-body-bg);
	border-top: 1px solid var(--bs-border-color);
	box-shadow: 0 -.5rem 1.5rem rgba(0, 0, 0, .15);
}
@media (min-width: 576px) {
	.contenido-tema-nav {
		padding-left: 1.5rem;
		padding-right: 1.5rem;
	}
}
/* «Abrir simulador»: justo en el centro de la barra. Con el temario oculto aparecen los iconos de temario
   y tutor, y entonces pasa a ser un botón más de la fila (si no, se montaría encima de ellos) */
.contenido-tema-nav-sim {
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
}
.curso-layout.temario-oculto .contenido-tema-nav-sim {
	position: static;
	transform: none;
}
/* Iconos de temario y tutor: forman parte de la barra como dos botones más, con el mismo espacio entre los cuatro */
.contenido-tema-nav-centro {
	display: contents;
}
.curso-layout:not(.temario-oculto) .contenido-tema-nav-centro {
	display: none;
}
/* Los botones no se encogen: al encogerse, el texto se salía por la derecha y quedaba descentrado */
.contenido-tema-nav > *,
.contenido-tema-nav .btn {
	flex-shrink: 0;
}
@media (max-width: 575.98px) {
	.contenido-tema-nav {
		gap: .5rem;
	}
	.contenido-tema-nav .btn {
		padding-left: .85rem;
		padding-right: .85rem;
	}
}
/* Respuestas nuevas del tutor en la barra: solo un punto rojo en la esquina del botón (sin número) */
.tutor-punto {
	position: absolute;
	top: .35rem;
	right: .35rem;
	width: .55rem;
	height: .55rem;
	border-radius: 50%;
	background-color: var(--bs-danger);
	box-shadow: 0 0 0 2px var(--bs-body-bg);
	font-size: 0;
	line-height: 0;
	overflow: hidden;
}
/* Filas de tema del temario: icono según tipo (vídeo / lectura / bloqueado) y tema actual resaltado */
.temario-tema {
	padding: .55rem .6rem .55rem .75rem;
	border-radius: .5rem;
	border-left: 3px solid transparent;
	transition: background-color .15s ease;
}
.temario-tema:not(.bloqueado):hover {
	background-color: rgba(var(--bs-emphasis-color-rgb), .05);
}
.temario-tema-icono {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border-radius: .45rem;
	font-size: .9rem;
	color: var(--bs-secondary-color);
	background-color: rgba(var(--bs-emphasis-color-rgb), .06);
}
.temario-tema.bloqueado .temario-tema-icono {
	opacity: .6;
}
.temario-tema.activo {
	background-color: rgba(var(--bs-success-rgb), .14);
	border-left-color: var(--bs-success);
}
.temario-tema.activo .temario-tema-icono {
	color: #fff;
	background-color: var(--bs-success);
}
.temario-tema.activo .temario-tema-titulo {
	color: var(--bs-emphasis-color);
}
.temario-tema-ahora {
	display: block;
	font-size: .68rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--bs-success);
	line-height: 1.2;
	margin-bottom: .1rem;
}
.temario-tema .temario-tema-enlace:hover,
.temario-tema .temario-tema-enlace:focus-visible {
	text-decoration: none;
}
.contenido-html {
	font-size: 1.02rem;
	line-height: 1.75;
	color: var(--bs-body-color);
	overflow-wrap: anywhere;
}
.contenido-html p {
	margin-bottom: .9rem;
}
.contenido-html h4 {
	font-size: 1.2rem;
	margin: 2rem 0 .75rem;
}
.contenido-html h5 {
	font-size: 1.05rem;
	margin: 1.75rem 0 .6rem;
	padding-left: .6rem;
	border-left: 3px solid var(--bs-primary);
}
.contenido-html img {
	max-width: 100%;
	height: auto;
	margin: .35rem;
	border-radius: .35rem;
	vertical-align: middle;
}
.contenido-html .table-responsive {
	margin: 1rem 0 1.5rem;
}
.contenido-html table {
	font-size: .9rem;
	line-height: 1.45;
}
.contenido-html table p {
	margin-bottom: .25rem;
}
.contenido-html table img {
	max-width: 260px;
}
.contenido-html ul,
.contenido-html ol {
	padding-left: 1.4rem;
	margin-bottom: 1rem;
}
[data-theme="dark"] .contenido-html img {
	background-color: #fff; /* capturas con fondo transparente legibles en modo oscuro */
}

/* Bloques del contenido redactado de los cursos: objetivos, esquemas, avisos, código y resumen */
.contenido-html .objetivos,
.contenido-html .resumen {
	border: 1px solid var(--bs-border-color);
	border-radius: .6rem;
	padding: 1rem 1.25rem .4rem;
	margin: 1.25rem 0 1.75rem;
	background-color: rgba(var(--bs-primary-rgb), .04);
}
.contenido-html .resumen {
	background-color: rgba(var(--bs-success-rgb), .05);
}
.contenido-html .objetivos > strong,
.contenido-html .resumen > strong {
	display: block;
	margin-bottom: .4rem;
}
.contenido-html figure.esquema {
	margin: 1.5rem 0 1.75rem;
	text-align: center;
}
.contenido-html figure.esquema img {
	width: 100%;
	max-width: 760px;
	margin: 0;
	border: 1px solid var(--bs-border-color);
	border-radius: .6rem;
}
/* Capturas de pantalla y fotos pequeñas: a su tamaño natural, sin ampliarlas */
.contenido-html figure.esquema.captura img {
	width: auto;
}
/* Iconos y símbolos dentro del texto o de las tablas */
.contenido-html img.icono {
	height: 1.8em;
	width: auto;
	margin: 0 .3rem 0 0;
	border-radius: .2rem;
}
.contenido-html figure.esquema figcaption {
	font-size: .85rem;
	color: var(--bs-secondary-color, #6c757d);
	margin-top: .5rem;
}
.contenido-html .aviso {
	border-left: 4px solid var(--bs-info);
	background-color: rgba(var(--bs-info-rgb), .07);
	border-radius: 0 .5rem .5rem 0;
	padding: .75rem 1rem;
	margin: 1.25rem 0;
}
.contenido-html .aviso > :last-child {
	margin-bottom: 0;
}
.contenido-html .aviso-seguridad {
	border-left-color: var(--bs-danger);
	background-color: rgba(var(--bs-danger-rgb), .07);
}
.contenido-html .aviso-consejo {
	border-left-color: var(--bs-success);
	background-color: rgba(var(--bs-success-rgb), .07);
}
.contenido-html .aviso-atencion {
	border-left-color: var(--bs-warning);
	background-color: rgba(var(--bs-warning-rgb), .1);
}
.contenido-html pre {
	background-color: #1e2430;
	color: #e6e9ef;
	border-radius: .5rem;
	padding: .9rem 1rem;
	font-size: .86rem;
	line-height: 1.55;
	overflow-x: auto;
	overflow-wrap: normal;
	margin: 1rem 0 1.25rem;
}
.contenido-html pre code {
	color: inherit;
}
.contenido-html :not(pre) > code {
	font-size: .9em;
	padding: .1em .35em;
	border-radius: .25rem;
	background-color: rgba(var(--bs-primary-rgb), .08);
	color: inherit;
}
.contenido-html dl dt {
	margin-top: .6rem;
}

/* --- Cuestionario del capítulo (al final del tema) --- */
.cuestionario-pregunta {
	border: 1px solid var(--bs-border-color);
	border-radius: .6rem;
	padding: 1rem 1.1rem .75rem;
	margin-bottom: 1rem;
	transition: border-color .2s ease, background-color .2s ease;
}
.cuestionario-enunciado {
	/* float + width 100%: el enunciado va dentro del recuadro, no montado sobre el borde superior */
	float: left;
	width: 100%;
	padding: 0;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.45;
	margin-bottom: .75rem;
	display: flex;
	gap: .6rem;
}
.cuestionario-numero {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.6rem;
	height: 1.6rem;
	border-radius: 50%;
	font-size: .8rem;
	background-color: rgba(var(--bs-primary-rgb), .12);
	color: var(--bs-primary);
}
.cuestionario-opcion {
	clear: both;
	padding: .4rem .5rem .4rem 2.1rem;
	margin-bottom: .25rem;
	border-radius: .4rem;
}
.cuestionario-explicacion {
	clear: both;
}
/* Móvil: menos márgenes laterales para que las preguntas ocupen más ancho y haya que deslizar menos */
@media (max-width: 575.98px) {
	.cuestionario > .card-header,
	.cuestionario > .card-body,
	.cuestionario > .card-footer {
		padding-left: .75rem;
		padding-right: .75rem;
	}
	.cuestionario-pregunta {
		padding: .75rem .6rem .5rem;
	}
	.cuestionario-enunciado {
		margin-bottom: .5rem;
	}
	.cuestionario-opcion {
		padding-left: 1.85rem;
		padding-right: .35rem;
	}
}
.cuestionario-opcion .form-check-label {
	display: block; /* toda la fila se puede pulsar, no solo el texto (importante en móvil) */
	cursor: pointer;
}
@media (pointer: coarse) {
	.cuestionario-opcion {
		padding-top: .4rem;
		padding-bottom: .4rem;
		margin-bottom: .1rem;
	}
	.cuestionario-opcion .form-check-input {
		margin-top: .2rem;
	}
	/* iOS amplía la página al escribir en campos de menos de 16px */
	.form-control,
	.form-select {
		font-size: 1rem;
	}
}

/* --- Ficha del curso en móvil: barra fija con el precio y el botón de compra --- */
.barra-compra-movil {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 1020;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: .75rem 1rem;
	padding-bottom: calc(.75rem + env(safe-area-inset-bottom));
	background-color: var(--bs-body-bg);
	border-top: 1px solid var(--bs-border-color);
	box-shadow: 0 -.5rem 1.5rem rgba(0, 0, 0, .15);
}
@media (max-width: 1199.98px) {
	body:has(.barra-compra-movil) footer {
		padding-bottom: 5rem;
	}
	/* Menú desplegado en móvil/tablet: pegado a la izquierda y títulos largos en varias líneas en vez de cortados */
	.navbar-expand-xl .navbar-collapse .navbar-nav .nav-item {
		padding-left: 12px;
		padding-right: 12px;
	}
	.navbar-expand-xl .navbar-collapse .navbar-nav .dropdown-toggle::after {
		right: 12px;
	}
	.navbar-expand-xl .navbar-collapse .navbar-nav .dropdown-menu {
		padding-left: 0;
		padding-right: 0;
		margin-left: 0;
		margin-right: 0;
	}
	.navbar-expand-xl .navbar-collapse .navbar-nav .dropdown-item {
		padding-left: .75rem;
		padding-right: .5rem;
		white-space: normal;
	}
}

/* --- Cabecera general en móvil: menú, nombre, moneda, carrito y avatar en una sola línea --- */
@media (max-width: 575.98px) {
	.navbar-nombre {
		font-size: .875rem;
	}
	header.navbar-sticky .dropdown.ms-3 {
		margin-left: .5rem !important;
	}
	/* Portada: el subrayado amarillo de "futuro" a escala del texto */
	.subrayado-futuro {
		margin-left: -.6rem !important;
	}
	.subrayado-futuro svg {
		width: 150px;
		height: auto;
	}
}
.cuestionario-opcion:hover {
	background-color: rgba(var(--bs-primary-rgb), .05);
}
.cuestionario-pregunta.es-correcta {
	border-color: var(--bs-success);
}
.cuestionario-pregunta.es-incorrecta {
	border-color: var(--bs-danger);
}
.cuestionario-opcion.opcion-correcta {
	background-color: rgba(var(--bs-success-rgb), .12);
	font-weight: 600;
}
.cuestionario-opcion.opcion-incorrecta {
	background-color: rgba(var(--bs-danger-rgb), .1);
}
/* Tras corregir: acertada = radio verde (bloqueado, sin aspecto apagado); fallada = radio rojo */
.cuestionario-opcion.opcion-correcta .form-check-input,
.cuestionario-opcion.opcion-correcta .form-check-input:disabled {
	background-color: var(--bs-success);
	border-color: var(--bs-success);
	opacity: 1;
}
.cuestionario-opcion.opcion-correcta .form-check-input:disabled ~ .form-check-label {
	opacity: 1;
	cursor: default;
}
.cuestionario-pregunta.es-correcta .form-check-input:disabled ~ .form-check-label {
	cursor: default;
}
.cuestionario-opcion.opcion-incorrecta .form-check-input {
	background-color: var(--bs-danger);
	border-color: var(--bs-danger);
}
.cuestionario-opcion.opcion-incorrecta .form-check-input:focus {
	box-shadow: 0 0 0 .25rem rgba(var(--bs-danger-rgb), .25);
}
.cuestionario-explicacion {
	font-size: .9rem;
	margin-top: .6rem;
	padding: .6rem .8rem;
	border-radius: .4rem;
	background-color: rgba(var(--bs-info-rgb), .08);
}
.cuestionario-explicacion.es-error {
	background-color: rgba(var(--bs-danger-rgb), .08);
	color: var(--bs-danger-text-emphasis);
}

/* --- Área de alumno: cabecera compacta en móvil --- */
.cuenta-datos,
.cuenta-datos-texto {
	min-width: 0;
}
@media (max-width: 1199.98px) {
	section.cuenta-cabecera {
		padding-bottom: 1rem;
	}
}
/* Desde md el nombre y los datos quedan encima del banner azul: texto claro en ambos temas */
@media (min-width: 768px) {
	.cuenta-datos h1,
	.cuenta-datos .h6 {
		color: #fff;
	}
	.cuenta-datos .text-body {
		color: rgba(255, 255, 255, .75) !important;
	}
	.cuenta-datos .btn-outline-primary {
		--bs-btn-color: #fff;
		--bs-btn-border-color: rgba(255, 255, 255, .6);
		--bs-btn-hover-color: var(--bs-primary);
		--bs-btn-hover-bg: #fff;
		--bs-btn-hover-border-color: #fff;
		--bs-btn-active-color: var(--bs-primary);
		--bs-btn-active-bg: #fff;
		--bs-btn-active-border-color: #fff;
	}
}
@media (max-width: 575.98px) {
	.cuenta-avatar {
		width: 4.5rem;
		height: 4.5rem;
	}
	.cuenta-datos h1 {
		font-size: 1.15rem !important;
	}
	.cuenta-datos .h6,
	.cuenta-datos .text-body {
		font-size: .85rem;
	}
}

/* --- Mis cursos: contadores (en móvil, los tres en una fila) --- */
.mis-stat {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: .35rem;
	height: 100%;
	padding: .75rem .35rem;
	text-align: center;
}
.mis-stat-icono {
	font-size: 1.25rem;
	line-height: 1;
}
.mis-stat-texto {
	font-size: .75rem;
	line-height: 1.25;
}
@media (min-width: 768px) {
	.mis-stat {
		flex-direction: row;
		justify-content: center;
		gap: 1rem;
		padding: 1.25rem 1rem;
		text-align: left;
	}
	.mis-stat-icono {
		font-size: 2rem;
	}
	.mis-stat-texto {
		font-size: .9rem;
	}
}

/* --- Mis cursos: lista adaptable (en móvil, imagen y título arriba; estado y botón debajo) --- */
.mis-curso {
	display: grid;
	grid-template-columns: 84px minmax(0, 1fr);
	grid-template-areas:
		"img info"
		"estado estado"
		"accion accion";
	gap: .75rem;
	padding: 1rem 0;
	border-bottom: 1px solid var(--bs-border-color);
}
.mis-curso:first-child {
	padding-top: 0;
}
.mis-curso:last-child {
	padding-bottom: 0;
	border-bottom: 0;
}
.mis-curso-img {
	grid-area: img;
}
.mis-curso-img img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}
.mis-curso-info {
	grid-area: info;
	min-width: 0;
}
.mis-curso-info h3 {
	line-height: 1.35;
}
.mis-curso-subtitulo {
	display: none;
}
.mis-curso-estado {
	grid-area: estado;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .5rem;
}
.mis-curso-accion {
	grid-area: accion;
}
.mis-curso-accion .btn {
	display: block;
	width: 100%;
}
@media (min-width: 768px) {
	.mis-curso {
		grid-template-columns: 100px minmax(0, 1fr) auto 130px;
		grid-template-areas: "img info estado accion";
		align-items: center;
		gap: 1rem;
	}
	.mis-curso-subtitulo {
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}
	.mis-curso-estado {
		flex-direction: column;
		align-items: flex-start;
		justify-content: center;
		gap: .25rem;
	}
}

/* --- Tablas del área de alumno --- */
.table-hover > tbody > tr {
	transition: background-color .15s ease;
}

/* --- Aviso de cookies: por encima de todo y con esquinas como el resto --- */
#cookiesdiv {
	z-index: 1080;
	border-radius: .75rem !important;
}

/* --- Usuarios que prefieren menos animaciones --- */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition-duration: .01ms !important;
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
	}
	.card-curso:hover {
		transform: none;
	}
}

/* ---------- Tutorías: modal "Pregúntale al tutor" y chat (aula y panel) ---------- */
.tutor-modal .modal-content {
	border: 1px solid rgba(0, 0, 0, .12);
	box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, .35);
}
.tutor-chat {
	background-color: #f3f5f8;
}
/* Modal del aula: lista de conversaciones del curso a la izquierda y chat a la derecha */
.tutor-cuerpo {
	display: flex;
	height: min(62vh, 580px);
}
.tutor-cuerpo .tutor-chat {
	flex: 1 1 auto;
	min-width: 0;
	overflow-y: auto;
	padding: 1rem 1.25rem;
}
.tutor-salas {
	width: 290px;
	flex-shrink: 0;
	overflow-y: auto;
	background-color: #fff;
	border-right: 1px solid #e3e7ee;
}
.tutor-salas-cab {
	position: sticky;
	top: 0;
	z-index: 1;
	padding: .75rem 1rem .5rem;
	background-color: inherit;
	color: #6b7079;
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}
.tutor-sala {
	display: block;
	width: 100%;
	padding: .6rem 1rem;
	text-align: left;
	color: inherit;
	background: transparent;
	border: 0;
	border-left: 3px solid transparent;
	border-bottom: 1px solid rgba(0, 0, 0, .05);
}
.tutor-sala:hover {
	background-color: rgba(6, 106, 201, .06);
}
.tutor-sala.active {
	background-color: rgba(6, 106, 201, .12);
	border-left-color: #066ac9;
}
.tutor-sala-titulo {
	font-size: .88rem;
	font-weight: 600;
	line-height: 1.3;
}
.tutor-sala-aqui {
	padding: .05rem .45rem;
	border-radius: 1rem;
	background-color: rgba(6, 106, 201, .12);
	color: #066ac9;
	font-size: .68rem;
	font-weight: 600;
	white-space: nowrap;
}
.tutor-sala-estado {
	display: block;
	margin-top: .15rem;
	color: #6b7079;
	font-size: .75rem;
}
@media (max-width: 767.98px) {
	/* Móvil (modal a pantalla completa): la lista arriba y el chat debajo */
	.tutor-cuerpo {
		flex-direction: column;
		height: auto;
		flex: 1 1 auto;
		min-height: 0;
	}
	.tutor-salas {
		width: 100%;
		max-height: 28vh;
		border-right: 0;
		border-bottom: 1px solid #e3e7ee;
	}
	.tutor-cuerpo .tutor-chat {
		min-height: 35vh;
	}
}
body.tutor-abierto .modal-backdrop.show {
	opacity: .8;
}
.tutor-burbuja {
	max-width: 85%;
	padding: .6rem .9rem;
	border-radius: .9rem;
	line-height: 1.5;
}
.tutor-meta {
	font-size: .78rem;
	font-weight: 700;
	margin-bottom: .2rem;
}
.tutor-meta span {
	font-weight: 400;
	margin-left: .4rem;
	opacity: .8;
}
.tutor-texto {
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}
.tutor-de-alumno {
	background-color: #066ac9;
	color: #fff;
}
.tutor-de-tutor {
	background-color: #fff;
	color: #1b1e21;
	border: 1px solid #d9dee6;
	border-left: 4px solid #0cbc87;
}
.tutor-de-tutor .tutor-meta i {
	color: #0cbc87;
}
/* Modo oscuro: modal más claro que la página, borde visible y burbujas con contraste */
html[data-theme=dark] .tutor-modal .modal-content {
	background-color: #2b3036;
	border-color: rgba(255, 255, 255, .25);
	box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 1.5rem 4rem rgba(0, 0, 0, .85);
}
html[data-theme=dark] .tutor-modal .modal-header,
html[data-theme=dark] .tutor-modal .modal-footer {
	border-color: rgba(255, 255, 255, .15);
}
html[data-theme=dark] .tutor-modal .modal-title,
html[data-theme=dark] .tutor-modal .modal-footer .small {
	color: #f1f3f5;
}
html[data-theme=dark] .tutor-chat {
	background-color: #1e2226;
}
html[data-theme=dark] .tutor-salas {
	background-color: #262b30;
	border-color: rgba(255, 255, 255, .15);
}
html[data-theme=dark] .tutor-salas-cab,
html[data-theme=dark] .tutor-sala-estado {
	color: #b3b9c0;
}
html[data-theme=dark] .tutor-sala {
	color: #f1f3f5;
	border-bottom-color: rgba(255, 255, 255, .07);
}
html[data-theme=dark] .tutor-sala:hover {
	background-color: rgba(255, 255, 255, .06);
}
html[data-theme=dark] .tutor-sala.active {
	background-color: rgba(26, 127, 224, .25);
	border-left-color: #1a7fe0;
}
html[data-theme=dark] .tutor-sala-aqui,
html[data-theme=dark] #tutorIrTema {
	color: #8ec2ff;
}
html[data-theme=dark] .tutor-sala-aqui {
	background-color: rgba(26, 127, 224, .25);
}
html[data-theme=dark] .tutor-modal textarea.form-control {
	background-color: #1e2226;
	color: #f1f3f5;
	border-color: rgba(255, 255, 255, .3);
}
html[data-theme=dark] .tutor-modal textarea.form-control::placeholder {
	color: rgba(255, 255, 255, .55);
}
html[data-theme=dark] .tutor-de-alumno {
	background-color: #1a7fe0;
}
html[data-theme=dark] .tutor-de-tutor {
	background-color: #3a4148;
	color: #f5f6f7;
	border-color: #4f5861;
	border-left-color: #0cbc87;
}


/* Menú de perfil: opciones de administrador en otro color */
.dropdown-menu .dropdown-item.menu-admin { color: #e8590c; }
.dropdown-menu .dropdown-item.menu-admin:hover,
.dropdown-menu .dropdown-item.menu-admin:focus,
.dropdown-menu .dropdown-item.menu-admin.active { color: #d9480f; background-color: rgba(232, 89, 12, .1); }
[data-theme="dark"] .dropdown-menu .dropdown-item.menu-admin { color: #ff922b; }
[data-theme="dark"] .dropdown-menu .dropdown-item.menu-admin:hover,
[data-theme="dark"] .dropdown-menu .dropdown-item.menu-admin:focus,
[data-theme="dark"] .dropdown-menu .dropdown-item.menu-admin.active { color: #ffa94d; background-color: rgba(255, 146, 43, .14); }
/* --- Panel de administración: estilo común de botones, tablas y formularios --- */
/* Botones de acción solo con icono: cuadrados y del mismo tamaño en todas las secciones
   (gris claro = acción normal, azul = principal, borde de color = activar / pausar / borrar) */
.btn.btn-icono {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	padding: 0;
	margin-bottom: 0;
	font-size: .95rem;
	line-height: 1;
	vertical-align: middle;
}
.btn.btn-icono > i { margin: 0 !important; }
.btn.btn-icono.btn-icono-lg { width: 2.5rem; height: 2.5rem; font-size: 1.15rem; }
/* Celda de acciones de las tablas: a la derecha, en una línea y con la misma separación */
.admin-acciones { text-align: end; white-space: nowrap; }
.admin-acciones > .btn,
.admin-acciones > form { margin-left: .25rem; }
.admin-acciones > form { display: inline; }
/* Cabeceras de tabla del panel: mismo aspecto en todas las secciones */
.admin-tabla > thead th {
	font-size: .75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .03em;
	color: var(--bs-secondary-color);
	white-space: nowrap;
}
