/* ==========================================================================
   CPRO TRADING — SECCIÓN FORMACIÓN (formacion.css)
   Ecosistema educativo: Hub central, Artículos Pilares y Glosario
   Integrado con el sistema de diseño de cprofx.com (style.css)
   ========================================================================== */

/* --- HUB HERO --- */
.hub-hero {
  position: relative;
  padding: 140px 0 60px;
  background: radial-gradient(circle at 50% 20%, rgba(37, 99, 234, 0.12), transparent 70%),
              radial-gradient(circle at 80% 30%, rgba(245, 198, 24, 0.08), transparent 60%);
  text-align: center;
  border-bottom: 1px solid var(--border-subtle);
}

.hub-hero .badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 198, 24, 0.1);
  border: 1px solid rgba(245, 198, 24, 0.3);
  color: var(--gold-400);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 20px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.hub-hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-main);
  max-width: 900px;
  margin: 0 auto 20px;
}

.hub-hero h1 .text-gradient-gold {
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hub-hero p.lead {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 auto 30px;
  line-height: 1.6;
}

.hub-stats-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
}

.hub-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(11, 27, 51, 0.6);
  border: 1px solid var(--border-subtle);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.hub-stat-pill strong {
  color: var(--gold-400);
  font-weight: 700;
}

/* --- HUB MODULES GRID --- */
.hub-content-section {
  padding: 70px 0 100px;
}

.section-head-simple {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 50px;
}

.section-head-simple h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--text-main);
}

.section-head-simple p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 28px;
}

.module-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 30px;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.module-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--border-subtle), transparent);
  transition: background var(--transition-normal);
}

.module-card:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 198, 24, 0.4);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
}

.module-card:hover::before {
  background: linear-gradient(90deg, var(--blue-500), var(--gold-400));
}

.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.module-badge {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(37, 99, 234, 0.15);
  color: var(--blue-400);
  border: 1px solid rgba(37, 99, 234, 0.3);
}

.module-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}

.module-status.active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.module-status.upcoming {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.module-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 10px;
}

.module-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 22px;
}

.lesson-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}

.lesson-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(5, 11, 20, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.lesson-item a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  text-decoration: none;
  width: 100%;
}

.lesson-item a:hover {
  color: var(--gold-400);
}

.lesson-num {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold-400);
  background: rgba(245, 198, 24, 0.08);
  padding: 2px 7px;
  border-radius: 4px;
  min-width: 32px;
  text-align: center;
}

.lesson-item.active:hover {
  background: rgba(37, 99, 234, 0.1);
  border-color: rgba(37, 99, 234, 0.3);
}

.lesson-item.upcoming {
  opacity: 0.65;
  cursor: default;
}

.lesson-item .badge-pill-mini {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 600;
}

.badge-pill-mini.green {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.badge-pill-mini.gray {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

/* ==========================================================================
   ARTÍCULOS PILARES — ESTRUCTURA & TIPOGRAFÍA
   ========================================================================== */

.article-page {
  padding-top: 100px;
  background: var(--bg-base);
}

.article-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 30px 20px 80px;
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.breadcrumbs a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumbs a:hover {
  color: var(--gold-400);
}

.breadcrumbs .sep {
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.8rem;
}

.breadcrumbs .current {
  color: var(--gold-400);
  font-weight: 500;
}

/* Encabezado del artículo */
.article-header {
  margin-bottom: 36px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 28px;
}

.article-header .category-tag {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--blue-400);
  background: rgba(37, 99, 234, 0.12);
  padding: 4px 12px;
  border-radius: 6px;
  margin-bottom: 16px;
  border: 1px solid rgba(37, 99, 234, 0.25);
}

.article-header h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4.5vw, 2.85rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-main);
  margin-bottom: 18px;
}

.article-lead {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  line-height: 1.65;
  color: var(--text-muted);
  margin-top: 14px;
  margin-bottom: 24px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.article-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.article-meta strong {
  color: var(--text-secondary);
}

/* Caja de "En este artículo aprenderás" (Key Takeaways) */
.takeaways-box {
  background: linear-gradient(135deg, rgba(11, 27, 51, 0.7), rgba(5, 11, 20, 0.85));
  border: 1px solid rgba(245, 198, 24, 0.3);
  border-left: 4px solid var(--gold-400);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin-bottom: 40px;
}

.takeaways-box h2,
.takeaways-box h3.takeaways-title,
.takeaways-box .takeaways-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold-400);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.takeaways-box ul,
.takeaways-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.takeaways-box li,
.takeaways-list li {
  position: relative;
  padding-left: 24px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.takeaways-box li::before,
.takeaways-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--gold-400);
  font-weight: bold;
}

/* Contenido / Cuerpo del artículo */
.article-body,
.article-content {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.75;
}

.article-body p,
.article-content p {
  margin-bottom: 22px;
}

.article-body h2,
.article-content h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  font-weight: 700;
  color: var(--text-main);
  margin-top: 48px;
  margin-bottom: 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
  letter-spacing: -0.01em;
}

.article-body h3,
.article-content h3 {
  font-family: var(--font-heading);
  font-size: clamp(1.2rem, 2.5vw, 1.4rem);
  font-weight: 600;
  color: var(--gold-300);
  margin-top: 32px;
  margin-bottom: 14px;
}

.article-body ul,
.article-body ol,
.article-content ul,
.article-content ol {
  margin: 0 0 24px 24px;
  padding: 0;
}

.article-body li,
.article-content li {
  margin-bottom: 8px;
  line-height: 1.65;
}

.article-body strong,
.article-content strong {
  color: var(--text-main);
  font-weight: 600;
}

/* Cajas de notas, advertencias y ejemplos */
.callout {
  padding: 20px 24px;
  border-radius: var(--radius-md);
  margin: 28px 0;
  border-left: 4px solid;
}

.callout.info {
  background: rgba(37, 99, 234, 0.08);
  border-color: var(--blue-500);
  color: var(--text-secondary);
}

.callout.warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: #f59e0b;
  color: var(--text-secondary);
}

.callout.tip {
  background: rgba(16, 185, 129, 0.08);
  border-color: #10b981;
  color: var(--text-secondary);
}

.callout-title {
  font-family: var(--font-heading);
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Indicador de contenido placeholder */
.content-placeholder-box {
  background: rgba(245, 198, 24, 0.05);
  border: 1px dashed rgba(245, 198, 24, 0.35);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 16px 0 24px;
  color: var(--gold-300);
  font-size: 0.92rem;
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Acordeón FAQ con <details> y <summary> */
.faq-section {
  margin-top: 60px;
  padding-top: 36px;
  border-top: 2px solid var(--border-subtle);
}

.faq-section h2,
.faq-section .faq-title {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 24px;
  border-bottom: none;
  padding-bottom: 0;
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.faq-item {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition-normal);
}

.faq-item[open] {
  border-color: rgba(245, 198, 24, 0.4);
}

.faq-item summary,
.faq-item .faq-question {
  padding: 18px 22px;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  user-select: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary .faq-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  transition: transform var(--transition-normal);
  color: var(--gold-400);
}

.faq-item[open] summary .faq-icon {
  transform: rotate(180deg);
}

.faq-content,
.faq-answer {
  padding: 0 22px 20px;
  color: var(--text-secondary);
  font-size: 0.96rem;
  line-height: 1.65;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 14px;
}

.faq-content p:last-child,
.faq-answer p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   BLOQUE CTA EMBUDO (3 NIVELES)
   1. Lead Magnet (Gratuito)
   2. Libro Digital ($27 USD)
   3. Comunidad VIP (Hotmart)
   ========================================================================== */

.funnel-cta-block {
  margin: 60px 0 40px;
  background: radial-gradient(circle at 50% 0%, rgba(37, 99, 234, 0.15), transparent 70%),
              var(--surface-card);
  border: 1px solid rgba(245, 198, 24, 0.35);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

.funnel-cta-header {
  text-align: center;
  max-width: 650px;
  margin: 0 auto 32px;
}

.funnel-cta-header .badge-step {
  display: inline-block;
  background: rgba(245, 198, 24, 0.12);
  color: var(--gold-400);
  border: 1px solid rgba(245, 198, 24, 0.3);
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.funnel-cta-header h3 {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 10px;
}

.funnel-cta-header p {
  color: var(--text-muted);
  font-size: 0.98rem;
}

.funnel-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.funnel-card {
  background: rgba(5, 11, 20, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal), border-color var(--transition-normal);
  position: relative;
}

.funnel-card.featured {
  border-color: rgba(245, 198, 24, 0.5);
  background: linear-gradient(180deg, rgba(245, 198, 24, 0.08), rgba(5, 11, 20, 0.8));
}

.funnel-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold-400);
}

.funnel-tier-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.funnel-card.featured .funnel-tier-badge {
  color: var(--gold-400);
}

.funnel-card h4 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.funnel-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 18px;
  flex-grow: 1;
}

.funnel-card .price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 16px;
}

.funnel-card .price-tag {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--gold-300);
}

.funnel-card .price-note {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Navegación anterior / siguiente */
.article-nav-pagination {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 40px 0;
  padding-top: 30px;
  border-top: 1px solid var(--border-subtle);
}

.nav-page-card {
  display: flex;
  flex-direction: column;
  padding: 18px 20px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition-normal);
}

.nav-page-card:hover {
  border-color: var(--gold-400);
  transform: translateY(-2px);
}

.nav-page-card.prev {
  text-align: left;
}

.nav-page-card.next {
  text-align: right;
}

.nav-direction-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--gold-400);
  margin-bottom: 6px;
}

.nav-page-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
}

/* Disclaimer dentro del artículo */
.article-disclaimer {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 30px 0;
}

.article-disclaimer strong {
  color: var(--text-secondary);
}

/* ==========================================================================
   ÁRBOL JERÁRQUICO / EXPLORADOR DE CONTENIDOS Y BUSCADOR (ESTILO DOCUMENTACIÓN)
   ========================================================================== */

.formacion-layout-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 110px 24px 60px;
}

.formacion-layout {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  position: relative;
}

/* Sidebar Explorador */
.formacion-sidebar {
  width: 340px;
  min-width: 340px;
  position: sticky;
  top: 90px;
  height: calc(100vh - 110px);
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(11, 17, 32, 0.95);
  border: 1px solid rgba(226, 180, 71, 0.2);
  border-radius: var(--radius-lg, 14px);
  padding: 20px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  scrollbar-width: thin;
  scrollbar-color: rgba(226, 180, 71, 0.3) transparent;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 40;
}

.formacion-sidebar::-webkit-scrollbar {
  width: 5px;
}
.formacion-sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.formacion-sidebar::-webkit-scrollbar-thumb {
  background: rgba(226, 180, 71, 0.3);
  border-radius: 4px;
}

/* Cabecera del sidebar */
.sidebar-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 14px;
}

.sidebar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.sidebar-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.sidebar-title .sidebar-icon {
  color: var(--gold-400);
  font-size: 1.1rem;
}

.sidebar-badge {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(226, 180, 71, 0.12);
  color: var(--gold-400);
  border: 1px solid rgba(226, 180, 71, 0.25);
  font-weight: 600;
}

/* Buscador instantáneo */
.sidebar-search-box {
  position: relative;
  margin-bottom: 8px;
}

.sidebar-search-input {
  width: 100%;
  background: rgba(7, 12, 22, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 10px 34px 10px 34px;
  font-size: 0.85rem;
  color: var(--text-main);
  transition: all 0.2s ease;
  font-family: var(--font-body);
}

.sidebar-search-input:focus {
  outline: none;
  border-color: var(--gold-400);
  box-shadow: 0 0 0 3px rgba(226, 180, 71, 0.15);
  background: rgba(10, 16, 30, 1);
}

.sidebar-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}

.sidebar-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 2px 6px;
  border-radius: 4px;
  display: none;
}
.sidebar-search-clear:hover {
  color: var(--gold-400);
}

.sidebar-search-summary {
  font-size: 0.75rem;
  color: var(--gold-400);
  margin-top: 4px;
  font-weight: 600;
  display: none;
}

/* Controles de expansión */
.tree-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  padding: 0 2px;
}

.tree-control-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.15s ease;
}
.tree-control-btn:hover {
  color: var(--gold-300);
}

/* Árbol de carpetas y archivos */
.tree-root {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tree-folder {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  overflow: hidden;
  transition: all 0.2s ease;
}

.tree-folder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  cursor: pointer;
  user-select: none;
  background: rgba(255, 255, 255, 0.03);
  transition: background 0.15s ease;
}

.tree-folder-header:hover {
  background: rgba(226, 180, 71, 0.06);
}

.tree-folder-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  min-width: 0;
}

.tree-folder-chevron {
  width: 14px;
  height: 14px;
  color: var(--gold-400);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.tree-folder.collapsed .tree-folder-chevron {
  transform: rotate(-90deg);
}

.tree-folder-icon {
  font-size: 0.95rem;
  flex-shrink: 0;
}

.tree-folder-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-folder-count {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 10px;
  flex-shrink: 0;
}

/* Lista de lecciones / archivos */
.tree-file-list {
  list-style: none;
  padding: 6px 6px 8px 14px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-left: 2px solid rgba(226, 180, 71, 0.15);
  margin-left: 14px;
  margin-top: 4px;
  margin-bottom: 6px;
}

.tree-folder.collapsed .tree-file-list {
  display: none;
}

.tree-file-item {
  display: block;
}

.tree-file-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s ease;
  line-height: 1.35;
}

.tree-file-link:hover {
  background: rgba(226, 180, 71, 0.08);
  color: var(--text-main);
  transform: translateX(2px);
}

.tree-file-link.active {
  background: rgba(226, 180, 71, 0.14);
  color: var(--gold-300);
  font-weight: 600;
  border-left: 3px solid var(--gold-400);
  padding-left: 8px;
  box-shadow: inset 0 0 10px rgba(226, 180, 71, 0.05);
}

.tree-file-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.tree-file-num {
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--gold-400);
  opacity: 0.85;
  flex-shrink: 0;
}

.tree-file-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-file-badge {
  font-size: 0.65rem;
  padding: 2px 5px;
  border-radius: 4px;
  flex-shrink: 0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tree-file-badge.pilar {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.tree-file-badge.prox {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

/* Área de contenido principal en layout */
.formacion-main-pane {
  flex: 1;
  min-width: 0;
}

.formacion-main-pane .hub-hero {
  padding: 40px 24px;
  border-radius: var(--radius-lg, 16px);
  border: 1px solid var(--border-subtle);
  margin-bottom: 24px;
  background: radial-gradient(circle at 50% 20%, rgba(37, 99, 234, 0.12), transparent 70%),
              radial-gradient(circle at 80% 30%, rgba(245, 198, 24, 0.08), transparent 60%),
              rgba(11, 17, 32, 0.6);
}

.formacion-main-pane .container {
  max-width: 100%;
  padding: 0;
}

.formacion-main-pane .hub-content-section {
  padding-top: 0;
}

/* Botón flotante móvil para abrir el explorador */
.mobile-tree-toggle-bar {
  display: none;
  margin-bottom: 24px;
}

.mobile-tree-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: center;
  padding: 12px 18px;
  background: rgba(11, 17, 32, 0.95);
  border: 1px solid rgba(226, 180, 71, 0.3);
  border-radius: 10px;
  color: var(--gold-300);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 998;
}

/* Responsive para sidebar */
@media (max-width: 1024px) {
  .mobile-tree-toggle-bar {
    display: block;
  }

  .formacion-layout-wrapper {
    padding-top: 90px;
  }

  .formacion-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    width: 320px;
    min-width: unset;
    border-radius: 0;
    border-left: none;
    border-top: none;
    border-bottom: none;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 999;
  }

  .formacion-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop.active {
    display: block;
  }
}

/* Responsive previo existente */
@media (max-width: 768px) {
  .modules-grid {
    grid-template-columns: 1fr;
  }

  .funnel-options-grid {
    grid-template-columns: 1fr;
  }

  .article-nav-pagination {
    grid-template-columns: 1fr;
  }

  .nav-page-card.next {
    text-align: left;
  }

  .hub-hero {
    padding: 20px 0 30px;
  }
}


/* Overrides para artículo dentro del layout con explorador lateral */
.formacion-main-pane .article-page {
  padding-top: 0;
  background: transparent;
}
.formacion-main-pane .article-container {
  max-width: 900px;
  margin: 0;
  padding: 10px 0 60px;
}

/* ===== Tabla comparativa (artículos pilar) ===== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1.4em 0; border-radius: 12px; border: 1px solid var(--line, #e6e9f0); }
.compare-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; background: #fff; }
.compare-table th { background: #0B1B33; color: #F5C618; text-align: left; padding: 12px 14px; font-family: 'Sora', sans-serif; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }
.compare-table td { padding: 11px 14px; border-top: 1px solid var(--line, #e6e9f0); vertical-align: top; color: #1c1c1c; }
.compare-table tbody tr:nth-child(even) td { background: #f7f9fd; }
.compare-table td:first-child { white-space: nowrap; }
@media (max-width: 640px) { .compare-table { font-size: 0.85rem; } .compare-table th, .compare-table td { padding: 9px 10px; } }

/* ===== Formulario Captura Checklist Pre-Trade ===== */
.checklist-email-form {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  text-align: left;
}
.checklist-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;
}
.checklist-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.checklist-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.88rem;
  border-radius: 6px;
  background: rgba(11, 27, 51, 0.8);
  border: 1px solid var(--border-card, rgba(255, 255, 255, 0.15));
  color: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.checklist-input:focus {
  border-color: var(--gold-400, #F5C618);
  box-shadow: 0 0 0 2px rgba(245, 198, 24, 0.2);
}
.checklist-input::placeholder {
  color: var(--text-muted, #8A99AD);
}
.checklist-btn {
  width: 100%;
  justify-content: center;
  font-weight: 700;
  cursor: pointer;
}
.checklist-form-error {
  color: #ff6b6b;
  font-size: 0.8rem;
  margin: 4px 0 0;
  font-weight: 500;
}
.checklist-form-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 6px;
  text-align: left;
}
.checklist-success-msg {
  color: #4ade80;
  font-size: 0.82rem;
  font-weight: 600;
  margin: 0 0 6px;
  line-height: 1.35;
}
.checklist-pdf-link {
  display: inline-block;
  color: var(--gold-400, #F5C618);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}
.checklist-pdf-link:hover {
  color: #fff;
}

/* ===== SECCIÓN GLOSARIO DE TRADING ===== */
.glossary-header {
  padding: 50px 0 30px;
  text-align: center;
  background: radial-gradient(circle at 50% 0%, rgba(245, 198, 24, 0.08) 0%, transparent 60%);
}
.glossary-header h1 {
  font-family: 'Sora', sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
  line-height: 1.2;
}
.glossary-header p {
  color: var(--text-muted, #8A99AD);
  font-size: 1.05rem;
  max-width: 680px;
  margin: 0 auto 24px;
  line-height: 1.6;
}
.glossary-search-box {
  max-width: 540px;
  margin: 0 auto 20px;
  position: relative;
}
.glossary-search-input {
  width: 100%;
  padding: 14px 18px 14px 44px;
  font-size: 1rem;
  border-radius: 12px;
  border: 1px solid var(--line-light, rgba(255, 255, 255, 0.15));
  background: rgba(11, 27, 51, 0.85);
  color: #fff;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}
.glossary-search-input:focus {
  border-color: var(--gold-400, #F5C618);
  box-shadow: 0 0 0 3px rgba(245, 198, 24, 0.25);
}
.glossary-search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--gold-400, #F5C618);
  pointer-events: none;
}
.glossary-search-counter {
  font-size: 0.85rem;
  color: var(--gold-400, #F5C618);
  font-weight: 600;
  margin-top: 8px;
}
.glossary-alphabet-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  max-width: 820px;
  margin: 0 auto 36px;
  padding: 0 16px;
}
.glossary-alpha-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #c5d1e0;
  font-weight: 700;
  font-size: 0.82rem;
  text-decoration: none;
  transition: all 0.15s ease;
}
.glossary-alpha-link:hover, .glossary-alpha-link.active {
  background: var(--gold-400, #F5C618);
  color: #071326;
  border-color: var(--gold-400, #F5C618);
}
.glossary-content-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px 60px;
}
.glossary-letter-group {
  margin-bottom: 32px;
}
.glossary-letter-group.hidden {
  display: none;
}
.glossary-letter-heading {
  font-family: 'Sora', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gold-400, #F5C618);
  border-bottom: 2px solid rgba(245, 198, 24, 0.3);
  padding-bottom: 6px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.glossary-terms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
}
.glossary-term-card {
  background: var(--card-bg, #0B1B33);
  border: 1px solid var(--line-light, rgba(255, 255, 255, 0.08));
  border-radius: 10px;
  padding: 16px 18px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.glossary-term-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 198, 24, 0.4);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}
.glossary-term-card.hidden {
  display: none;
}
.glossary-term-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.glossary-term-name {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 1.02rem;
  color: #fff;
  margin: 0;
}
.glossary-term-card:hover .glossary-term-name {
  color: var(--gold-400, #F5C618);
}
.glossary-term-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(245, 198, 24, 0.15);
  color: var(--gold-400, #F5C618);
  border: 1px solid rgba(245, 198, 24, 0.3);
  white-space: nowrap;
}
.glossary-term-snippet {
  font-size: 0.86rem;
  color: var(--text-muted, #8A99AD);
  line-height: 1.45;
  margin: 0 0 10px;
}
.glossary-term-arrow {
  font-size: 0.8rem;
  color: var(--gold-400, #F5C618);
  font-weight: 600;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ===== TEMPLATE DE DEFINICIÓN INDIVIDUAL (GLOSARIO) ===== */
.term-detail-wrapper {
  max-width: 780px;
  margin: 30px auto 60px;
  padding: 0 20px;
}
.term-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gold-400, #F5C618);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 24px;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.15s ease;
}
.term-back-btn:hover {
  background: rgba(245, 198, 24, 0.12);
  border-color: rgba(245, 198, 24, 0.3);
  transform: translateX(-2px);
}
.term-article-card {
  background: var(--card-bg, #0B1B33);
  border: 1px solid var(--line-light, rgba(255, 255, 255, 0.1));
  border-radius: 14px;
  padding: 36px 32px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
@media (max-width: 640px) {
  .term-article-card {
    padding: 24px 18px;
  }
}
.term-meta-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold-400, #F5C618);
  background: rgba(245, 198, 24, 0.12);
  border: 1px solid rgba(245, 198, 24, 0.25);
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 12px;
}
.term-article-card h1 {
  font-family: 'Sora', sans-serif;
  font-size: clamp(1.7rem, 3.5vw, 2.3rem);
  font-weight: 800;
  color: #fff;
  margin: 0 0 18px;
  line-height: 1.25;
}
.term-definition-body {
  font-size: 1.02rem;
  line-height: 1.7;
  color: #e1e7ef;
  margin-bottom: 24px;
}
.term-definition-body p {
  margin-bottom: 16px;
}
.term-example-box {
  background: rgba(15, 39, 77, 0.7);
  border-left: 4px solid var(--gold-400, #F5C618);
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
  margin: 24px 0 30px;
}
.term-example-box strong {
  color: var(--gold-400, #F5C618);
  font-family: 'Sora', sans-serif;
  font-size: 0.92rem;
  display: block;
  margin-bottom: 4px;
}
.term-example-box p {
  color: #c7d4e4;
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
}
.term-hub-cta-box {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 24px;
  margin-top: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.term-hub-cta-text h4 {
  font-family: 'Sora', sans-serif;
  font-size: 1rem;
  color: #fff;
  margin: 0 0 4px;
}
.term-hub-cta-text p {
  color: var(--text-muted, #8A99AD);
  font-size: 0.85rem;
  margin: 0;
}

/* ===== CONTENEDORES Y MÁRGENES DE LECTURA (FALLBACK / COMPATIBILIDAD) ===== */
.formacion-article-wrapper {
  padding: 40px 0 80px;
  background: var(--bg-base, #071326);
  width: 100%;
  min-height: 80vh;
}

.formacion-container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
  box-sizing: border-box;
}

.formacion-container-narrow {
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}

.formacion-article {
  width: 100%;
  max-width: 100%;
  color: var(--text-light, #c5d1e0);
  line-height: 1.75;
}

.formacion-header {
  background: rgba(7, 19, 38, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.formacion-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.formacion-brand {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.05em;
}

.formacion-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.formacion-nav a {
  color: var(--text-muted, #8a99ad);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.formacion-nav a:hover, .formacion-nav a.active {
  color: var(--gold-400, #F5C618);
}

.formacion-breadcrumbs {
  padding: 16px 0;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.85rem;
}

.formacion-breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
  align-items: center;
}

.formacion-breadcrumbs li + li::before {
  content: "›";
  margin-right: 8px;
  color: rgba(255, 255, 255, 0.3);
}

.formacion-breadcrumbs a {
  color: var(--text-muted, #8a99ad);
  text-decoration: none;
}

.formacion-breadcrumbs a:hover {
  color: var(--gold-400, #F5C618);
}

.formacion-breadcrumbs li[aria-current="page"] {
  color: var(--gold-400, #F5C618);
  font-weight: 600;
}

.formacion-footer {
  background: #040a14;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 30px 0;
  color: var(--text-muted, #8a99ad);
  font-size: 0.88rem;
}

.formacion-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.formacion-footer-links {
  display: flex;
  gap: 16px;
}

.formacion-footer-links a {
  color: var(--text-muted, #8a99ad);
  text-decoration: none;
}

.formacion-footer-links a:hover {
  color: var(--gold-400, #F5C618);
}




