/* Future Learn — front. Estilos mínimos y neutros: en Bricks se estiliza
   desde el constructor, así que aquí solo hay estructura.

   Esto no sustituye a Bricks: es la capa de seguridad para que la plantilla
   PHP de respaldo (public/templates/node.php) no se vea sin estilos si
   todavía no se ha montado una plantilla en el constructor para cursos,
   lecciones y temas. Con Bricks, estas reglas quedan por debajo y el
   constructor manda. */

:root {
	--fl-accent: #2271b1;
	--fl-border: rgba(0,0,0,.12);
	--fl-muted: rgba(0,0,0,.55);
	--fl-bg-soft: rgba(0,0,0,.035);
}

/* --- Página de un nodo (curso / lección / tema) ---------------------- */

.fl-single { max-width: 1140px; margin: 0 auto; padding: 2em 1.2em 4em; }

.fl-single__layout { display: grid; grid-template-columns: 280px minmax(0,1fr);
	gap: 2.5em; align-items: start; margin-top: 1.5em; }
@media (max-width: 780px) { .fl-single__layout { grid-template-columns: 1fr; } }

.fl-single__sidebar { position: sticky; top: 1.5em; display: flex;
	flex-direction: column; gap: 1.2em; }
@media (max-width: 780px) { .fl-single__sidebar { position: static; } }

.fl-single__main { min-width: 0; }
.fl-single__title { margin: 0 0 .6em; font-size: 1.7em; line-height: 1.25; }

.fl-locked-notice { max-width: 640px; margin: 3em auto; text-align: center;
	padding: 2.5em 2em; border: 1px solid var(--fl-border); border-radius: 10px; }
.fl-locked-notice h1 { margin-top: 0; }

/* --- Contenido principal y bloques ------------------------------------ */

.fl-content { line-height: 1.7; }
.fl-content > *:first-child { margin-top: 0; }
.fl-content img { max-width: 100%; height: auto; border-radius: 6px; }
.fl-content table { width: 100%; border-collapse: collapse; }
.fl-content table td, .fl-content table th { border: 1px solid var(--fl-border); padding: .5em .7em; }

/* --- Botones ------------------------------------------------------------ */

.fl-button { display: inline-flex; align-items: center; gap: .4em;
	padding: .65em 1.3em; border-radius: 6px; border: 0; cursor: pointer;
	background: var(--fl-accent); color: #fff; text-decoration: none;
	font-weight: 600; font-size: .95em; line-height: 1.2; }
.fl-button:hover, .fl-button:focus { filter: brightness(.92); color: #fff; }
.fl-complete { margin: 1.8em 0; background: #2e7d32; }
.fl-complete.is-done { background: rgba(0,0,0,.15); color: inherit; cursor: default; }

/* --- Migas de pan y navegación anterior/siguiente ---------------------- */

.fl-breadcrumb { font-size: .85em; color: var(--fl-muted); margin-bottom: 1.2em; }
.fl-breadcrumb a { color: inherit; }
.fl-breadcrumb__current { font-weight: 600; color: inherit; }

.fl-nav__prev, .fl-nav__next { display: inline-flex; align-items: center;
	gap: .4em; padding: .7em 1.1em; border: 1px solid var(--fl-border);
	border-radius: 6px; text-decoration: none; max-width: 46%; }
.fl-nav__next { margin-left: auto; text-align: right; }

.fl-progress__track { background: rgba(0,0,0,.08); border-radius: 999px;
	height: 8px; overflow: hidden; }
.fl-progress__fill { background: currentColor; height: 100%;
	transition: width .3s ease; }
.fl-progress__label { font-size: .85em; }
.fl-progress--circle .fl-progress__circle {
	width: 90px; height: 90px; border-radius: 50%;
	background: conic-gradient(currentColor var(--fl-deg, 0deg), rgba(0,0,0,.08) 0);
	display: grid; place-items: center; }
.fl-progress--circle .fl-progress__circle span {
	background: #fff; width: 70px; height: 70px; border-radius: 50%;
	display: grid; place-items: center; font-weight: 600; }

.fl-tree { list-style: none; margin: 0; padding: 0; display: flex;
	flex-direction: column; gap: .15em; background: #fff; }
.fl-tree__item a { display: flex; gap: .6em; align-items: center;
	padding: .55em .6em; text-decoration: none; border-radius: 4px;
	color: inherit; }
.fl-tree__item a:hover { background: var(--fl-bg-soft); }
.fl-tree__item--depth2 { padding-left: 1.25em; }
.fl-tree__item--depth3 { padding-left: 2.5em; }
.fl-tree__item--lesson > a { font-weight: 600; }
.fl-tree__state { flex: 0 0 auto; }
.fl-tree__item.is-completed .fl-tree__state { color: #2e7d32; }
.fl-tree__item.is-current > a { background: var(--fl-bg-soft); font-weight: 600; }

.fl-nav { display: flex; justify-content: space-between; gap: 1em;
	margin: 2em 0; }

.fl-tabs__nav { display: flex; flex-wrap: wrap; gap: .25em;
	border-bottom: 1px solid var(--fl-border); }
.fl-tabs__tab { background: none; border: 0; padding: .6em 1em;
	cursor: pointer; border-bottom: 2px solid transparent; font: inherit;
	color: inherit; opacity: .7; }
.fl-tabs__tab.is-active { border-bottom-color: currentColor; font-weight: 600;
	opacity: 1; }
.fl-tabs__panel { display: none; padding: 1.2em 0; }
.fl-tabs__panel.is-active { display: block; }

.fl-tabs--accordion .fl-tabs__nav { display: none; }
.fl-tabs--accordion .fl-tabs__panel,
.fl-tabs--stacked .fl-tabs__panel { display: block; }
.fl-tabs--accordion .fl-tabs__panel,
.fl-tabs--stacked .fl-tabs__panel { border-top: 1px solid var(--fl-border); }
.fl-tabs--accordion .fl-tabs__panel:first-child,
.fl-tabs--stacked .fl-tabs__panel:first-child { border-top: 0; }

.fl-courses { display: grid; gap: 1.2em; }
.fl-courses--cols2 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.fl-courses--cols3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.fl-course-card { border: 1px solid var(--fl-border); border-radius: 8px;
	padding: 1.1em; display: flex; flex-direction: column; gap: .6em; }
.fl-course-card__title { margin: 0; font-size: 1.05em; line-height: 1.3; }
.fl-course-card__title a { color: inherit; text-decoration: none; }
.fl-course-card__meta { font-size: .85em; opacity: .7; margin: 0; }
.fl-course-card.is-completed { border-color: rgba(46,125,50,.4); }

.fl-stats-summary { display: flex; flex-wrap: wrap; gap: 1.4em 2em; }
.fl-stat { display: flex; flex-direction: column; min-width: 100px; }
.fl-stat__value { font-size: 1.6em; font-weight: 700; line-height: 1.1; }
.fl-stat__label { font-size: .8em; opacity: .7; }

.fl-heatmap { display: grid; grid-auto-flow: column;
	grid-template-rows: repeat(7, 1fr); gap: 2px; overflow-x: auto; }
.fl-heatmap__day { width: 11px; height: 11px; border-radius: 2px;
	background: rgba(0,0,0,.06); }
.fl-heatmap__day--l1 { background: rgba(46,125,50,.25); }
.fl-heatmap__day--l2 { background: rgba(46,125,50,.45); }
.fl-heatmap__day--l3 { background: rgba(46,125,50,.7); }
.fl-heatmap__day--l4 { background: rgba(46,125,50,1); }

.fl-members { width: 100%; border-collapse: collapse; }
.fl-members th, .fl-members td { text-align: left; padding: .5em .7em;
	border-bottom: 1px solid var(--fl-border); }

.fl-streak { display: inline-flex; align-items: baseline; gap: .4em; }
.fl-streak__current { font-size: 1.5em; }
.fl-streak__best { font-size: .85em; opacity: .7; }

.fl-group-progress { display: flex; align-items: baseline; gap: .6em;
	flex-wrap: wrap; }
.fl-group-progress__value { font-size: 1.6em; font-weight: 700; }
.fl-group-progress__meta { font-size: .85em; opacity: .7; }

.fl-materials { line-height: 1.6; }
.fl-materials__node { margin: 1.2em 0 .4em; font-size: 1em; }
.fl-materials__node:first-child { margin-top: 0; }
.fl-materials__list { list-style: none; padding: 0; margin: 0 0 1.2em; }
.fl-materials__item { padding: .3em 0; }
.fl-materials__type { font-size: .75em; text-transform: uppercase;
	opacity: .6; margin-right: .6em; }

.fl-pdf a, .fl-downloads a { color: var(--fl-accent); text-decoration: none; }
.fl-pdf a:hover, .fl-downloads a:hover { text-decoration: underline; }
.fl-downloads { list-style: none; padding: 0; margin: 0; }
.fl-downloads li { padding: .3em 0; }

/* --- Índice de cursos del alumno --------------------------------------- */

.fl-index { max-width: 1140px; margin: 0 auto; padding: 2em 1.2em 4em; }
.fl-index__title { margin: 0 0 1em; }

/* --- Accesibilidad: utilidad para texto solo-lector-de-pantalla -------- */

.fl-sr-only { position: absolute; width: 1px; height: 1px; padding: 0;
	margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
	border: 0; }

/* Foco de teclado siempre visible: sin esto, quien navega sin ratón pierde
   de vista dónde está. Bricks o el tema pueden traer su propio anillo de
   foco; este es el de respaldo. */
.fl-topic a:focus-visible,
.fl-topic button:focus-visible,
.fl-tabs__tab:focus-visible { outline: 2px solid var(--flt-primary, #032e7d);
	outline-offset: 2px; border-radius: 2px; }

/* --- "Tema Único": composición completa de un tema en una sola pieza ---
   Paleta y forma alineadas con future-quiz para que un curso y su examen se
   sientan del mismo sitio: azul primario, acento rosa, tarjetas redondeadas
   con sombra suave, tipografía Roboto. Todo variable, así que se puede
   redefinir por elemento desde los controles de estilo de Bricks. */

.fl-topic {
	--flt-primary: #032e7d;
	--flt-primary-light: #1a44a0;
	--flt-primary-dark: #021d4d;
	--flt-accent: #ff5c8d;
	--flt-text: #252525;
	--flt-text-muted: #62666d;
	--flt-bg: #ffffff;
	--flt-bg-soft: #f9f9f9;
	--flt-border: rgba(3, 46, 125, .1);
	--flt-radius: 10px;
	--flt-shadow: 0 4px 16px rgba(3, 46, 125, .08);
	--flt-font: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;

	font-family: var(--flt-font);
	color: var(--flt-text);
	background: var(--flt-bg);
	border: 1px solid var(--flt-border);
	border-radius: var(--flt-radius);
	box-shadow: var(--flt-shadow);
	padding: 1.8em 2em 2.2em;
	max-width: 100%;
	box-sizing: border-box;
}
@media (max-width: 600px) { .fl-topic { padding: 1.3em 1.1em 1.6em; } }

.fl-topic .fl-breadcrumb { margin-bottom: 1.4em; color: var(--flt-text-muted); }
.fl-topic .fl-breadcrumb a { color: var(--flt-primary); text-decoration: none; }
.fl-topic .fl-breadcrumb a:hover { text-decoration: underline; }

.fl-topic__header { margin-bottom: 1.6em; }
.fl-topic__kicker { margin: 0 0 .4em; font-size: .8em; font-weight: 600;
	letter-spacing: .04em; text-transform: uppercase; color: var(--flt-accent); }
.fl-topic__title { margin: 0 0 .5em; font-size: 1.9em; line-height: 1.25;
	font-weight: 700; color: var(--flt-primary-dark); }

.fl-topic__meta { display: flex; flex-wrap: wrap; gap: .6em; margin-top: .8em; }
.fl-topic__meta-item { display: inline-flex; align-items: center; gap: .35em;
	padding: .4em .9em; border-radius: 999px; font-size: .85em; font-weight: 500;
	background: var(--flt-bg-soft);
	background: color-mix(in srgb, var(--flt-primary) 8%, var(--flt-bg-soft));
	color: var(--flt-primary-dark); }
.fl-topic__meta-item .fl-progress { color: var(--flt-primary); font-weight: 700; }
.fl-topic__meta-item .fl-time { font-weight: 700; }

.fl-topic__body { margin: 1.6em 0; }

/* Pestañas con el mismo lenguaje visual: pastilla activa en vez de solo un
   subrayado, más fácil de ver para baja visión y más fácil de tocar en
   móvil. */
.fl-topic .fl-tabs__nav { border-bottom: 0; gap: .4em; margin-bottom: .2em;
	flex-wrap: wrap; }
.fl-topic .fl-tabs__tab { opacity: 1; color: var(--flt-text-muted);
	border: 1px solid var(--flt-border); border-radius: 999px;
	padding: .55em 1.1em; font-weight: 600; font-size: .92em;
	transition: background-color .18s ease, color .18s ease, border-color .18s ease; }
.fl-topic .fl-tabs__tab:hover { background: var(--flt-bg-soft); }
.fl-topic .fl-tabs__tab.is-active { background: var(--flt-primary);
	border-color: var(--flt-primary); color: #fff; }
.fl-topic .fl-tabs__panel { padding: 1.4em 0 .2em; line-height: 1.75; }
.fl-topic .fl-content a { color: var(--flt-primary); }

.fl-topic__materials { margin-top: 1.8em; padding-top: 1.4em;
	border-top: 1px solid var(--flt-border); }
.fl-topic__materials .fl-materials__node { color: var(--flt-primary-dark); }

.fl-topic__footer { margin-top: 2em; padding-top: 1.6em;
	border-top: 1px solid var(--flt-border); display: flex;
	flex-wrap: wrap; align-items: center; gap: 1em 1.4em; }

.fl-topic .fl-complete { order: -1; flex: 0 0 auto; background: var(--flt-accent);
	border-radius: 999px; padding: .8em 1.8em; font-size: .95em;
	box-shadow: 0 4px 12px rgba(255, 92, 141, .35);
	box-shadow: 0 4px 12px color-mix(in srgb, var(--flt-accent) 35%, transparent);
	transition: transform .18s ease, box-shadow .18s ease; }
.fl-topic .fl-complete:hover:not(:disabled) { transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(255, 92, 141, .45);
	box-shadow: 0 6px 16px color-mix(in srgb, var(--flt-accent) 45%, transparent); }
.fl-topic .fl-complete.is-done { background: #2e7d32; box-shadow: none; }
.fl-topic .fl-complete:disabled { cursor: default; }

.fl-topic .fl-nav { margin: 0; flex: 1 1 auto; gap: .8em; }
.fl-topic .fl-nav__prev, .fl-topic .fl-nav__next { border-color: var(--flt-border);
	border-radius: 999px; color: var(--flt-primary-dark); font-weight: 600;
	font-size: .92em; transition: border-color .18s ease, background-color .18s ease; }
.fl-topic .fl-nav__prev:hover, .fl-topic .fl-nav__next:hover {
	border-color: var(--flt-primary); background: var(--flt-bg-soft); }
.fl-topic .fl-nav__label { max-width: 22ch; overflow: hidden;
	text-overflow: ellipsis; white-space: nowrap; display: inline-block;
	vertical-align: bottom; }

.fl-topic--locked { text-align: center; padding: 3em 2em; }
.fl-topic--locked h2 { margin-top: 0; color: var(--flt-primary-dark, #021d4d); }

@media (prefers-reduced-motion: reduce) {
	.fl-topic .fl-complete, .fl-topic .fl-tabs__tab { transition: none; }
	.fl-topic .fl-complete:hover:not(:disabled) { transform: none; }
}
