/* ==================================================
   ACADEMIA WEB - HOJA DE ESTILOS
   Organización por bloques para mantenimiento rápido.
   Cada sección agrupa componentes relacionados.
   ================================================== */

/* ---------- 1) Variables globales ----------
   Tokens de color, tipografía y medidas reutilizables.
   Legacy tokens kept for backward-compat; DS aliases added below. */
:root{
  /* ── Legacy (no eliminar — usados en todo el CSS) ── */
  --bg: #F3F4F6;              /* Fondo principal claro */
  --panel: #FFFFFF;           /* Tarjetas y bloques */
  --text: #1A202C;            /* Texto principal */
  --muted: #4A5568;           /* Texto secundario */
  --accent: #1B365D;          /* Azul institucional */
  --accent-light: #274C77;    /* Azul para hover */
  --success: #5C7C6F;         /* Verde progreso */
  --border: #E2E8F0;          /* Color de borde (usado como valor de color) */
  --max: 1100px;
  --font-body: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --font-heading: "Source Serif 4", Georgia, "Times New Roman", serif;

  /* ── Blue ramp ── */
  --blue-900: #0C1640;
  --blue-800: #0c1d3a;
  --blue-700: #1B365D;
  --blue-600: #1e3f6e;
  --blue-500: #274C77;
  --blue-400: #3B82F6;
  --blue-100: #dbeafe;

  /* ── Neutral ramp ── */
  --ink-900: #1A202C;
  --ink-700: #2d3748;
  --ink-500: #4A5568;
  --ink-400: #64748b;
  --ink-300: #94A3B8;
  --surface-0: #FFFFFF;
  --surface-1: #F3F4F6;
  --surface-2: #fafafa;
  --line: #E2E8F0;

  /* ── Status primitives ── */
  --green-700: #5C7C6F;
  --green-600: #16a34a;
  --green-100: #dcfce7;
  --red-700:   #b42318;
  --red-600:   #dc2626;
  --red-100:   #fee2e2;
  --amber-700: #92400e;
  --amber-100: #fef9c3;

  /* ── Semantic color aliases ── */
  --color-primary:       var(--blue-700);
  --color-primary-hover: var(--blue-500);
  --color-primary-deep:  var(--blue-900);
  --color-accent-bright: var(--blue-400);
  --text-strong:         var(--ink-900);
  --text-body:           var(--ink-500);
  --text-muted:          var(--ink-400);
  --text-faint:          var(--ink-300);
  --text-on-primary:     #ffffff;
  --surface-page:        var(--surface-1);
  --surface-card:        var(--surface-0);
  --surface-sunken:      var(--surface-2);
  --border-color:        var(--line);

  /* ── Primary tints ── */
  --primary-tint-04: rgba(27,54,93,.04);
  --primary-tint-06: rgba(27,54,93,.06);
  --primary-tint-08: rgba(27,54,93,.08);
  --primary-tint-10: rgba(27,54,93,.10);
  --primary-tint-16: rgba(27,54,93,.16);
  --primary-tint-18: rgba(27,54,93,.18);

  /* ── Gradients ── */
  --gradient-hero:   linear-gradient(150deg, #0c1d3a 0%, #1B365D 55%, #1e3f6e 100%);
  --gradient-cta:    linear-gradient(145deg, #0c1d3a 0%, #1B365D 60%, #1e3f6e 100%);
  --gradient-logo:   radial-gradient(circle at 38% 32%, #3B82F6 0%, #0C1640 100%);
  --gradient-footer: linear-gradient(180deg, #111827 0%, #0c0f18 100%);

  /* ── Typography ── */
  --font-mono:   ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;
  --fs-xs:       0.72rem;
  --fs-sm:       0.85rem;
  --fs-base:     1rem;
  --fs-md:       1.08rem;
  --fs-lg:       1.25rem;
  --fs-xl:       1.5rem;
  --fs-h3:       clamp(20px, 2.4vw, 28px);
  --fs-h2:       clamp(22px, 2.8vw, 40px);
  --fs-h1:       clamp(28px, 3.2vw, 44px);
  --fs-display:  clamp(30px, 3.4vw, 50px);
  --lh-tight:    1.15;
  --lh-snug:     1.4;
  --lh-body:     1.6;
  --lh-relaxed:  1.7;
  --ls-heading:  -0.2px;
  --ls-body:     0.1px;
  --ls-label:    0.07em;
  --ls-caps:     0.08em;

  /* ── Spacing scale ── */
  --space-1:  4px;
  --space-2:  6px;
  --space-3:  8px;
  --space-4:  10px;
  --space-5:  12px;
  --space-6:  14px;
  --space-7:  16px;
  --space-8:  18px;
  --space-9:  22px;
  --space-10: 24px;
  --space-12: 32px;
  --space-14: 40px;
  --space-16: 56px;
  --space-20: 72px;
  --space-24: 88px;

  /* ── Radii ── */
  --radius-sm:   8px;
  --radius-md:   10px;
  --radius-lg:   12px;
  --radius-xl:   14px;
  --radius-2xl:  16px;
  --radius-3xl:  20px;
  --radius-pill: 999px;

  /* ── Borders ── */
  --border-width: 1px;

  /* ── Shadows ── */
  --shadow-xs:     0 8px 18px rgba(15,23,42,.04);
  --shadow-sm:     0 4px 14px rgba(27,54,93,.08);
  --shadow-md:     0 10px 24px rgba(0,0,0,.08);
  --shadow-lg:     0 16px 40px rgba(27,54,93,.12);
  --shadow-xl:     0 18px 40px rgba(0,0,0,.18);
  --shadow-float:  0 32px 80px rgba(0,0,0,.35);
  --shadow-header: 0 10px 30px rgba(0,0,0,.08);

  /* ── Focus ── */
  --focus-ring:    0 0 0 3px rgba(27,54,93,.1);
  --focus-outline: 3px solid rgba(110,168,255,.55);

  /* ── Layout ── */
  --container-max: 1100px;
  --sidebar-width: 280px;
  /* Altura real medida de .site-header (logo .brand + nav + acciones,
     padding 14px arriba/abajo): ~76.6px renderizados, redondeado a 77px.
     Única fuente de altura para .site-header (vía min-height) Y .app-header
     (vía height) — así ambas cabeceras no pueden desalinearse en el futuro. */
  --header-height: 77px;
}

/* ---------- 2) Base / reset ----------
   Normaliza caja, márgenes y estilos base de texto/enlaces. */
*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; }
body{
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  letter-spacing: 0.1px;
}

a{ color:inherit; text-decoration:none; }
/* App/product surfaces use Inter for headings by default. */
h1,h2,h3{
  font-family: var(--font-body);
  line-height: 1.15;
  margin: 0 0 .5rem;
  letter-spacing: -0.2px;
}
/* Marketing pages (index, about, contact) opt back into the brand serif. */
.marketing h1, .marketing h2, .marketing h3{
  font-family: var(--font-heading);
}
p{ margin:.5rem 0 0; color: var(--muted); }

/* ---------- 3) Header y navegación pública ----------
   Barra superior principal, enlaces y botón hamburguesa. */
.site-header{
  position: sticky;
  top:0;
  z-index:10;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 18px;
  /* Pinned to the shared token (not just incidental padding+content), so
     .app-header in the Aula can mirror this exact height via the same var. */
  min-height: var(--header-height);
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}

.logo{ font-weight:700; letter-spacing:.4px; }
.brand{ display:flex; align-items:center; text-decoration:none; flex-shrink:0; }

.nav{ display:flex; gap: 14px; align-items:center; }
.nav a{ padding: 8px 10px; border-radius:10px; }
.nav a.active, .nav a:hover{ background: rgba(27,54,93,.08); }

.nav-toggle{
  display:none;
  border:1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 10px;
  cursor:pointer;
  flex-direction: column;
  gap: 4px;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
}

.nav-toggle span{
  display: block;
  width: 16px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: opacity .15s;
}

.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;
}

/* ---------- 4) Home: hero + layout de secciones ----------
   Estructura principal de portada, grids y tarjetas. */
.hero{ padding: 18px 18px 8px; }

.hero__content{
  max-width: var(--max);
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 22px;
}
.hero h1{ color:#fff; font-size:clamp(30px,3.4vw,48px); margin:14px 0 18px; max-width:560px; }
.hero__cta{ display:flex; gap: 12px; margin-top: 18px; flex-wrap:wrap; }

.section{
  max-width: var(--max);
  margin: 0 auto;
  padding: 8px 18px 18px;
}

.grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 12px;
}

.card{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
}

.card__icon{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(27,54,93,.08);
  color: var(--accent);
  margin-bottom: 10px;
}

.footer{
  max-width: var(--max);
  margin: 16px auto 30px;
  padding: 0 18px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

/* Responsive */
@media (max-width: 820px){
  .grid{ grid-template-columns: 1fr; }
  .nav-toggle{ display:inline-flex; }
  .nav{
    position: absolute;
    right: 18px;
    top: 56px;
    flex-direction: column;
    align-items: stretch;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px;
    display:none;
    min-width: 200px;
    box-shadow: 0 10px 24px rgba(0,0,0,.08);
  }
  .nav.open{ display:flex; }
}

/* ---------- 5) Autenticación (botón + modal) ----------
   Controles de acceso y modal de login/registro. */
.nav-auth{
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
}
.nav-auth:hover{ background: rgba(255,255,255,.10); }

.nav-auth.is-primary{
  background: var(--accent);
  color: #ffffff;
  border-color: transparent;
  font-weight: 650;
}

/* ===== Modal ===== */
.modal{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 50;
}
.modal.open{ display: block; }

.modal__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
}

.modal__panel{
  position: relative;
  width: min(92vw, 420px);
  margin: 10vh auto 0;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  color: var(--text);
  box-shadow: 0 18px 40px rgba(0,0,0,.18);
  -webkit-backdrop-filter: blur(10px); /* Safari */
  backdrop-filter: blur(10px);         /* Resto navegadores */
}

.modal__header{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.icon-btn{
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  border-radius: 12px;
  padding: 6px 10px;
  cursor: pointer;
}

.modal__form{ display:flex; flex-direction:column; gap: 10px; }

.field span{ display:block; font-size: .9rem; color: var(--muted); margin-bottom: 6px; }

.field input{
  width: 100%;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
}

.modal__actions{
  display:flex;
  gap: 10px;
  margin-top: 4px;
}

.hint{ font-size: .85rem; color: var(--muted); margin: 4px 0 0; }

/* ---------- Mensajes inline de formulario (error / éxito) ---------- */
.form-msg {
  font-size: .85rem;
  min-height: 1.1em;
  margin: 4px 0 0;
  line-height: 1.4;
}
.form-msg:empty { display: none; }
.form-msg--error   { color: #c0392b; }
.form-msg--success { color: var(--success); }

/* Campo con error: borde rojo */
.field--error input,
.field--error textarea {
  border-color: #c0392b !important;
  box-shadow: 0 0 0 2px rgba(192, 57, 43, .12);
}

/* Botón con estado loading */
.btn--loading {
  opacity: .7;
  cursor: wait;
  pointer-events: none;
}

/* ---------- Indicador de fortaleza de contraseña ---------- */
.pw-strength {
  display: none;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}
.pw-strength.is-visible { display: flex; }

.pw-strength__bar {
  position: relative;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
}
.pw-strength__bar::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 2px;
  width: var(--pw-w, 0%);
  background: var(--pw-color, transparent);
  transition: width .25s ease, background .25s ease;
}
.pw-strength__label {
  font-size: .78rem;
  text-align: right;
  transition: color .25s;
}

/* ---------- Banner de sesión caducada ---------- */
.session-expired-banner {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: var(--accent);
  color: #fff;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 500;
  box-shadow: 0 4px 18px rgba(0,0,0,.22);
  white-space: nowrap;
  transition: opacity .4s ease;
}

/* ---------- Lista de sesiones activas (panel de seguridad) ----------
   Todas las reglas se acoten a .sessions-list para no colisionar
   con .aula-item.session-item que usa aula.js para sesiones de clase. */
.sessions-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sessions-list .session-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}

.sessions-list .session-item--current {
  border-color: rgba(27,54,93,.3);
  background: rgba(27,54,93,.04);
}

.sessions-list .session-item__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sessions-list .session-item__label {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
}

.sessions-list .session-item__meta {
  font-size: .78rem;
  color: var(--muted);
}

.sessions-list .session-item__badge {
  font-size: .72rem;
  font-weight: 600;
  color: var(--success);
  background: rgba(92,124,111,.12);
  border: 1px solid rgba(92,124,111,.25);
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---------- 6) Home: bloques de contenido ----------
   Badge, estadísticas, callout y banda CTA de portada. */
.badge{
  display:inline-block;
  font-family: var(--font-body);
  font-size: .85rem;
  color: var(--accent);
  background: rgba(27,54,93,.08);
  border: 1px solid rgba(27,54,93,.18);
  padding: 6px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.hero__stats{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.stat{
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
}

.stat strong{
  display:block;
  font-family: var(--font-body);
  color: var(--text);
  font-weight: 700;
}

.stat span{
  display:block;
  color: var(--muted);
  margin-top: 4px;
  font-size: .95rem;
}

.callout{
  margin-top: 14px;
  background: rgba(92,124,111,.10);
  border: 1px solid rgba(92,124,111,.22);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
}

.cta-band{
  margin-top: 14px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 14px;
  background: rgba(27,54,93,.06);
  border: 1px solid rgba(27,54,93,.16);
  border-radius: 14px;
  padding: 14px 16px;
}

.cta-band p{ margin: 6px 0 0; }

@media (max-width: 820px){
  .hero__stats{ grid-template-columns: 1fr; }
  .cta-band{ flex-direction: column; align-items: stretch; }
}

/* ---------- 7) Programa: tabs ----------
   Navegación por pestañas y paneles de contenido. */
.tabs{
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  overflow: hidden;
}

.tabs__list{
  display: flex;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
  background: rgba(27,54,93,.04);
  overflow-x: auto;
}



.tabs__panels{
  padding: 14px;
}

.tab-panel{
  display: none;
}

.tab-panel.is-active{
  display: block;
  animation: fadeIn .18s ease-out;
}

@keyframes fadeIn{
  from{ opacity: 0; transform: translateY(2px); }
  to{ opacity: 1; transform: translateY(0); }
}

.panel-head{
  margin-bottom: 10px;
}

.panel-head h3{
  margin-bottom: 6px;
}

.panel-cta{
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

@media (max-width: 820px){
  .tabs__panels{ padding: 12px; }
}

/* ---------- 8) Ajustes de densidad y espaciado ----------
   Compactación visual para mantener bloques consistentes. */

/* Menos aire dentro de stats y dentro de los panels */
.hero__stats{ margin-top: 12px; gap: 10px; }
.stat{ padding: 10px 12px; }

.tabs__panels{ padding: 10px; }
.panel-cta{ margin-top: 10px; }



#programa.section{
  padding-left: 0;
  padding-right: 0;
  padding-top: 48px;
  padding-bottom: 24px;
}

/* ---------- 9) Menú desplegable de usuario ----------
   Dropdown del área de autenticación del header. */
.auth-dd{
  position: relative;
  display: inline-flex;
  align-items: center;
}

.auth-caret{
  margin-left: 6px;
  font-size: .9em;
  opacity: .9;
}

/* ===== Auth dropdown (CLARO, igual que tu web) ===== */
.auth-menu{
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 180px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #ffffff;              /* <-- color del desplegable */
  box-shadow: 0 18px 50px rgba(0,0,0,.12);
  display: none;
  z-index: 60;
}

.auth-menu.open{ display: block; }

.auth-item{
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.auth-item:hover{
  background: rgba(27,54,93,.06);   /* hover suave */
  border-color: rgba(27,54,93,.12);
}

.auth-item--danger{
  color: #b42318;
}

.auth-item--danger:hover{
  background: rgba(180,35,24,.08);
  border-color: rgba(180,35,24,.16);
}

/* ===== Campana de notificaciones del Aula (persistidas en backend) ===== */
.notif-dd{
  position: relative;
  display: inline-flex;
  align-items: center;
}

.notif-bell{
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 4px;
  color: var(--text-body);
  cursor: pointer;
  border-radius: 8px;
}
.notif-bell:hover{ background: rgba(27,54,93,.06); }
.notif-bell:focus-visible{ outline: 3px solid rgba(110,168,255,.55); outline-offset: 2px; }

.notif-badge{
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notif-menu{
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 360px;
  max-width: calc(100vw - 24px);
  max-height: 420px;
  overflow-y: auto;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(0,0,0,.12);
  display: none;
  z-index: 80;
}
.notif-menu.open{ display: block; }

.notif-menu__head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.notif-menu__title{ font-weight: 700; font-size: .92rem; color: var(--text); }

.notif-mark-all{
  background: none;
  border: none;
  color: var(--accent);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
}
.notif-mark-all:hover{ background: rgba(27,54,93,.06); }

.notif-menu__list{
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.notif-item{
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px;
  border: none;
  border-radius: 12px;
  background: none;
  cursor: pointer;
  color: var(--text);
}
.notif-item:hover{ background: rgba(27,54,93,.06); }
.notif-item:focus-visible{ outline: 3px solid rgba(110,168,255,.55); outline-offset: 2px; }

.notif-item__icon{
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(27,54,93,.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.notif-item__body{ flex: 1 1 auto; min-width: 0; }
.notif-item__title{ font-weight: 600; font-size: .86rem; margin: 0 0 2px; color: var(--text); }
.notif-item__text{ font-size: .8rem; color: var(--muted); margin: 0 0 4px; }
.notif-item__time{ font-size: .72rem; color: var(--muted); }

.notif-item__read-btn{
  flex: 0 0 auto;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .7rem;
  padding: 4px 8px;
  cursor: pointer;
  color: var(--accent);
  white-space: nowrap;
}
.notif-item__read-btn:hover{ background: rgba(27,54,93,.06); }

.notif-empty{
  padding: 24px 12px;
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
}

@media (max-width: 480px){
  .notif-menu{
    position: fixed;
    top: 64px;
    right: 8px;
    left: 8px;
    width: auto;
    max-width: none;
  }
}

/* ---------- 10) App interna: layout settings/dashboard ----------
   Estructura de app privada (sidebar, main, topbar móvil). */

.app-layout{
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}
/* Hide the injected public header on app pages — it's kept in DOM for script loading */
.app-layout #site-header{ display: none; }

/* Topbar móvil (legacy — replaced by .app-header in aula) */
.app-topbar{
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}
/* App-header toggle: hide on desktop, show on mobile */
.app-header .app-sidebar-toggle{ display: none; }
@media (max-width: 900px){ .app-header .app-sidebar-toggle{ display: flex; } }

/* En el Aula, por debajo de 900px solo debe haber UN botón de menú: el del
   sidebar del curso (arriba). La navegación pública (Inicio, Oposiciones
   INE, ...) se oculta entera —hamburguesa y enlaces— en vez de mostrar un
   segundo botón independiente que confundiría con el del temario. */
@media (max-width: 900px){
  .app-header .nav-toggle,
  .app-header .nav{ display: none; }
}

.app-brand{
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: .2px;
}

.app-sidebar-toggle{
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

/* Subbloque: Sidebar y navegación lateral */
.app-sidebar{
  grid-area: sidebar;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  padding: 20px 14px;
  background: #fff;
  border-right: 1px solid var(--border);
  overflow: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-user{
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 16px;
}

.sidebar-avatar{
  width: 44px;
  height: 44px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(27,54,93,.07);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}
.sidebar-avatar svg{
  width: 28px;
  height: 28px;
}
.sidebar-avatar img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-name{
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  color: var(--text);
}
.sidebar-role{
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.sidebar-nav{
  margin-top: 14px;
  display: grid;
  gap: 6px;
}

.sidebar-link{
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.sidebar-link:hover{
  background: rgba(27,54,93,.06);
  border-color: rgba(27,54,93,.12);
}

.sidebar-link.is-active{
  background: rgba(27,54,93,.10);
  border-color: rgba(27,54,93,.16);
}

.sidebar-ico{
  width: 22px;
  display: inline-flex;
  justify-content: center;
}

/* DS pattern: SVG directly inside .sidebar-link (no .sidebar-ico wrapper) */
.sidebar-link > svg{
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-link-danger{
  margin-top: 6px;
  background: rgba(255,60,60,.08);
  border-color: rgba(255,60,60,.16);
}
.sidebar-link-danger:hover{
  background: rgba(255,60,60,.12);
  border-color: rgba(255,60,60,.22);
}
/* DS BEM variant */
.sidebar-link--danger{ color: var(--status-danger); background: rgba(255,60,60,.08); border-color: rgba(255,60,60,.16); margin-top: 4px; }
.sidebar-link--danger:hover{ background: rgba(180,35,24,.12); border-color: rgba(180,35,24,.22); }

.sidebar-footer{
  margin-top: 18px;
  padding: 10px 12px;
  color: var(--muted);
}

/* Subbloque: Contenido principal */
.app-main{
  grid-area: main;
  padding: 32px 28px;
  background: var(--bg);
}

.panel{
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 14px;
  padding: 16px 16px;
}

.panel-title{
  margin: 0 0 6px;
  font-size: 22px;
  color: var(--text);
}

.panel-subtitle{
  margin: 0;
  color: var(--muted);
}

.grid-2{
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

/* OJO: tu .card ya existe para home, así que NO lo redefinimos aquí */
/* Si quieres la misma card del home, no la toques */

.app-footer{
  margin-top: 18px;
  color: var(--muted);
}

.muted{ color: var(--muted); }

/* Subbloque responsive: sidebar off-canvas en móvil */
@media (max-width: 900px){
  .app-layout{
    grid-template-columns: 1fr;
    grid-template-areas: "main";
  }
  .app-topbar{
    display: flex;
    position: sticky;
    top: 0;
    z-index: 20;
  }
  .app-sidebar{
    position: fixed;
    left: 0;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
    width: 280px;
    z-index: 30;
    transform: translateX(-105%);
    transition: transform .2s ease;
  }
  .app-sidebar.open{
    transform: translateX(0);
  }
  .app-main{
    padding: 16px 14px 30px;
  }
  .grid-2{
    grid-template-columns: 1fr;
  }
}

/* Subbloque: shell bajo el header principal */
body.app-layout{
  display: block;
  padding-top: 0; /* app-header is sticky, not fixed — no body offset needed */
}

/* ── Cabecera en páginas de app ───────────────────────────────────────────────
   Sin borde inferior: el header (#fff) y el sidebar (#fff) forman un único
   bloque blanco a la izquierda. El fondo gris del contenido crea el contraste.
   Al hacer scroll: sombra ancha que flota sobre todo (sidebar + main). */
body.app-layout .site-header {
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  background: #fff;
  transition: box-shadow .25s ease;
}
body.app-layout .site-header.is-scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,.10);
}

.app-shell{
  min-height: calc(100vh - var(--header-height));
  display: grid;
  grid-template-columns: 280px 1fr;
  grid-template-areas: "sidebar main";
  background: var(--bg);
}

/* en móvil: sidebar offcanvas sigue funcionando si lo estás usando */
@media (max-width: 900px){
  .app-shell{
    grid-template-columns: 1fr;
    grid-template-areas: "main";
  }
}

/* ---------- 11) Administración ----------
   Reglas para panel admin, tabla de usuarios y acciones. */
/* Elementos solo admin: ocultos por defecto */
.admin-only { display: none !important; }
.is-admin .admin-only { display: block !important; }

.users-table{
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.users-table th, .users-table td{
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 14px;
}
.users-table th{ background: rgba(27,54,93,.04); }
.users-table tr:last-child td{ border-bottom: 0; }

.users-table input, .users-table select{
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
}
.btn-danger{
  background: #b42318;
  color: #fff;
  border: none;
}
.btn-danger:hover{ background: #9b1c14; }
.btn-small{ padding: 8px 10px; border-radius: 10px; }

.admin-panel{
  margin-top: 14px;
}

.panel-title--sm{
  font-size: 18px;
}

.admin-form{
  margin-top: 10px;
  align-items: end;
}

.admin-actions{
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  align-items: center;
}

.admin-table-wrap{
  margin-top: 10px;
  overflow: auto;
}

.admin-msg{
  margin-top: 10px;
}

/* ---------- 12) Sistema de botones y utilidades UI ----------
   Botones reutilizables para enlaces, acciones y pestañas. */

.btn--outline-primary{
  background: var(--accent);       /* color actual del botón oscuro */
  border: 1px solid var(--accent);
  color: #fff; /* Color del texto */
}
.btn--outline-primary:hover{
  background: var(--accent-light);
  border-color: var(--accent-light);
}

/* Igualar botones <button> con <a> */
button.btn{
  font: inherit;        /* misma fuente que el body */
  line-height: inherit; /* mismo alto de línea */
  cursor: pointer;
  -webkit-appearance: none;     /* quita estilo nativo */
  appearance: none;
}

/* Botón primario base */
.btn{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  transition: background .2s ease;
  white-space: nowrap;
}

/* SVG dentro de cualquier botón: siempre centrado, sin encoger */
.btn svg{
  flex-shrink: 0;
  display: block;
}


.btn--ghost{
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}
.btn--ghost:hover{
  background: var(--accent-light);
}


/* Botón base de pestaña (estado normal) */
.tab-btn{
  appearance: none;
  border: 1px solid rgba(27,54,93,.18);
  background: #ffffff;
  color: var(--accent);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
}

.tab-btn:hover{
  background: rgba(27,54,93,.06);
}

/* Estado activo de pestaña */
.tab-btn.is-active{
  background: var(--accent);
  color: #ffffff;
  border-color: transparent;
}

/* Foco accesible para teclado */
.tab-btn:focus-visible{
  outline: 3px solid rgba(110,168,255,.55);
  outline-offset: 2px;
}


/* ---------- 13) Opiniones ----------
   Testimonios públicos + formulario de envío para usuarios autenticados. */
.reviews-section{
  padding-top: 48px;
  padding-bottom: 24px;
}

.reviews-shell{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}

.reviews-head p{
  margin-top: 8px;
  max-width: 760px;
}

.reviews-grid{
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.review-card{
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 18px;
  background: #ffffff;
  min-height: 100%;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.review-card__meta{
  display: grid;
  gap: 2px;
}

.review-card__meta strong{
  display: block;
  color: var(--text);
}

.review-card__meta span{
  color: var(--muted);
  font-size: .92rem;
}

.review-card__rating{
  margin-top: 8px;
  font-size: .95rem;
  letter-spacing: 1px;
  color: var(--accent);
}

.review-card p{
  margin-top: 10px;
}

.reviews-loading,
.reviews-empty,
.reviews-error{
  grid-column: 1 / -1;
  margin: 0;
  padding: 14px 16px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.8);
}

.reviews-error{
  color: #8a2d2d;
  border-color: rgba(138, 45, 45, 0.18);
  background: rgba(138, 45, 45, 0.04);
}

.review-compose{
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.review-compose h3{
  margin-bottom: 4px;
}

.review-form{
  margin-top: 10px;
  display: grid;
  gap: 10px;
  max-width: 760px;
}

.field textarea{
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 13px;
  font: inherit;
  color: var(--text);
  background: #ffffff;
}

.field textarea:focus{
  outline: 3px solid rgba(110,168,255,0.22);
  outline-offset: 1px;
  border-color: rgba(27,54,93,0.28);
}

.review-form__actions{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.hint{
  margin: 0;
  font-size: .95rem;
  color: var(--muted);
}

button.btn[disabled]{
  opacity: .65;
  cursor: not-allowed;
}

/* Responsive */
@media (max-width: 900px){
  .reviews-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px){
  .reviews-shell{
    padding: 16px;
  }

  .reviews-grid{
    grid-template-columns: 1fr;
  }

  .review-form__actions{
    align-items: stretch;
  }

  .review-form__actions .btn{
    width: 100%;
    text-align: center;
  }
}

/* ---------- 14) Estados controlados por JS ----------
/* ---------- 13) Estados controlados por JS ----------
   Evita parpadeos visuales durante hidratación del header. */
/* Oculta el botón de login hasta que JS confirme sesión */
.auth-hidden { visibility: hidden; }
/* Para evitar parpadeos: el header empieza oculto (con CSS) y se muestra con JS cuando esté listo */
.site-header.is-loading { opacity: 0; }
.site-header.is-ready { opacity: 1; transition: opacity .12s ease; }


/* =========================
   Settings: panel por sección
   ========================= */

/* Por defecto, los paneles no se muestran */
.settings-panel { 
  display: none; 
}

/* Solo el panel activo se muestra */
.settings-panel.is-visible { 
  display: block; 
}

/* OJO: tu CSS global fuerza admin-only a display:block !important.
   En settings, lo anulamos para que obedezcan a is-visible. */
.is-admin .settings-panel.admin-only {
  display: none !important;
}
.is-admin .settings-panel.admin-only.is-visible {
  display: block !important;
}

.settings-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, #94a3b8);
  margin: 0 0 12px 2px;
}

/* ---- Ajustes integrado en el Aula: barra de pestañas horizontal ---- */
.settings-tabbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.settings-tabbar .tab-btn {
  flex: 0 0 auto;
}

.settings-tabbar__divider {
  flex: 0 0 auto;
  width: 1px;
  height: 22px;
  background: rgba(27, 54, 93, 0.16);
  margin: 0 2px;
}

.settings-tabbar__content {
  min-width: 0;
}

@media (max-width: 640px) {
  .settings-tabbar {
    gap: 6px;
  }
}

/* ---- Role picker (segmented control) ---- */
.role-picker {
  display: flex;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
}
.role-picker__opt {
  flex: 1;
  cursor: pointer;
  position: relative;
}
.role-picker__opt input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.role-picker__opt span {
  display: block;
  text-align: center;
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 500;
  background: #fff;
  color: var(--muted, #64748b);
  border-right: 1px solid var(--border, #e2e8f0);
  transition: background .12s, color .12s;
  user-select: none;
  margin-bottom: 0; /* anula .field span { margin-bottom: 6px } */
}
.role-picker__opt:last-child span {
  border-right: none;
}
.role-picker__opt:hover span {
  background: rgba(27, 54, 93, .05);
  color: var(--primary, #1B365D);
}
.role-picker__opt input:checked + span {
  background: var(--primary, #1B365D);
  color: #fff;
}
.role-picker__opt input:focus-visible + span {
  outline: 2px solid var(--accent, #6ea8ff);
  outline-offset: -2px;
}

/* Small helper text under a form field */
.field-hint {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted, #64748b);
  line-height: 1.4;
}

/* ---- Subscription: user view ---- */
.sub-plan-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  max-width: 520px;
  overflow: hidden;
}
.sub-plan-card__header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.sub-plan-card__header .card__icon {
  flex-shrink: 0;
}
.sub-plan-card__header > div:nth-child(2) {
  flex: 1;
}
.sub-plan-card__name {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}
.sub-status {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  margin-top: 2px;
}
.sub-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.8;
}
.sub-status--active  { background: #dcfce7; color: #16a34a; }
.sub-status--expired { background: #fee2e2; color: #dc2626; }

.sub-plan-card__details {
  padding: 4px 20px;
}
.sub-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.sub-detail-row:last-child { border-bottom: none; }
.sub-detail-row span  { color: var(--muted); }
.sub-detail-row strong { font-weight: 600; color: var(--text); }

.sub-plan-card__includes {
  padding: 14px 20px 18px;
  background: rgba(27,54,93,.03);
  border-top: 1px solid var(--border);
}
.sub-includes-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin: 0 0 10px;
}
.sub-plan-card__includes ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sub-plan-card__includes li {
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.sub-plan-card__includes li::before {
  content: "";
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background: #16a34a;
  border-radius: 50%;
  /* checkmark via clip-path trick */
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

/* Empty state */
.sub-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 48px 20px;
  color: var(--muted);
  text-align: center;
}
.sub-empty p { margin: 0; }

/* ---- Subscription: admin table cell ---- */
.sub-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}
.sub-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid transparent;
}
.sub-dot--active  { background: #16a34a; }
.sub-dot--expired { background: #dc2626; }
.sub-dot--none    { background: #cbd5e1; }

/* ===== CABECERA CON MOVIMIENTO AL HACER SCROLL ===== */
.site-header{
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;

  transition:
    transform 0.28s ease,
    background-color 0.28s ease,
    box-shadow 0.28s ease,
    padding 0.28s ease;
}

/* Para que el contenido no quede tapado por la cabecera fija */
body{
  padding-top: 90px;
}

/* Estado cuando ya has bajado un poco */
.site-header.is-scrolled{
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  padding-top: 10px;
  padding-bottom: 10px;
}

.auth-item--with-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1B365D;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}


.aula-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px;
}

.aula-state {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 32px;
}

.aula-hero {
  margin-bottom: 24px;
}

.aula-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.aula-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 24px;
}

@media (max-width: 900px) {
  .aula-grid {
    grid-template-columns: 1fr;
  }
}

/* ================================
   AULA
   ================================ */

/* Backdrop móvil para cerrar sidebar */
.sidebar-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 25;
}

/* Estado interno (loading / denied) */
.aula-state-inner{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 8px 0;
}

.aula-state-icon{
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(27,54,93,.08);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}

.aula-state-icon--muted{
  background: rgba(74,85,104,.08);
  color: var(--muted);
}

.aula-state-inner .btn{
  margin-top: 10px;
}

/* Selector de curso en el sidebar — sin línea inferior */
.sidebar-course{
  padding: 14px 12px;
  margin-bottom: 4px;
}

/* Separador del sidebar */
.sidebar-divider{
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

/* Calendario del sidebar */
.sidebar-calendar{
  margin: 10px 0 0;
  padding: 12px;
  border-top: 1px solid var(--border);
}

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

.cal-title{
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
}

.cal-nav{
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 1.1rem;
  padding: 2px 6px;
  border-radius: 6px;
  line-height: 1;
  transition: background .15s;
}

.cal-nav:hover{
  background: rgba(27,54,93,.08);
  color: var(--text);
}

.cal-grid{
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  text-align: center;
}

.cal-weekday{
  font-size: .68rem;
  font-weight: 700;
  color: var(--muted);
  padding: 3px 0 5px;
  text-transform: uppercase;
}

.cal-day{
  font-size: .8rem;
  padding: 5px 2px;
  border-radius: 6px;
  color: var(--text);
  line-height: 1;
  background: none;
  border: none;
  cursor: default;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.cal-day--empty{
  visibility: hidden;
}

.cal-day--today{
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.cal-day--has-event{
  background: rgba(27,54,93,.13);
  cursor: pointer;
  font-weight: 600;
}

.cal-day--has-event:hover{
  background: rgba(27,54,93,.22);
}

.cal-day--today.cal-day--has-event{
  background: var(--accent);
}

.cal-day--today.cal-day--has-event:hover{
  filter: brightness(.9);
}

.cal-day--selected{
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Punto decorativo eliminado — se usa fondo en su lugar */
.cal-dot{ display: none; }

/* Popup de evento del calendario */
.cal-popup{
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,.13);
  padding: 10px 12px;
  min-width: 200px;
  max-width: 240px;
  z-index: 120;
  font-size: .8rem;
  color: var(--ink);
}

/* Popup en días del lado derecho: anclar al borde derecho del día */
.cal-day--popup-left .cal-popup{
  left: auto;
  right: 0;
  transform: none;
}

.cal-popup__event + .cal-popup__event{
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 8px;
}

.cal-popup__badge{
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  border-radius: 4px;
  padding: 2px 6px;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.cal-popup__badge--live    { background: #fee2e2; color: #b91c1c; }
.cal-popup__badge--scheduled { background: #dbeafe; color: #1e40af; }
.cal-popup__badge--ended   { background: #f3f4f6; color: #6b7280; }

.cal-popup__title{
  display: block;
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.cal-popup__time{
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.cal-popup__desc{
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.sidebar-course__label{
  margin: 0 0 5px;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
}

.sidebar-course__name{
  display: block;
  font-weight: 600;
  font-size: .95rem;
  color: var(--text);
  padding: 2px 0;
}

#aula-course-select-wrap{
  display: block;
}

.sidebar-course__select{
  width: 100%;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 28px 7px 10px;
  font: inherit;
  font-size: .9rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%234A5568' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
}

.sidebar-course__select:focus{
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(27,54,93,.1);
}

/* Toolbar de apuntes */
.aula-toolbar{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  align-items: center;
}

.aula-toolbar .btn{
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Chip de carpeta actual */
.aula-folder-chip{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(27,54,93,.07);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px 4px 8px;
  font-size: .85rem;
  color: var(--text);
  margin-bottom: 14px;
}

#apuntes-folder-chip{
  margin-bottom: 10px;
}

/* Botón volver en apuntes */
.aula-back-link{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--accent);
  font: inherit;
  font-size: .95rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  margin-bottom: 14px;
}

.aula-back-link:hover{
  text-decoration: underline;
}

/* Nav del aula */
.aula-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.aula-nav .sidebar-link {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

.aula-nav .sidebar-link.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.aula-nav .sidebar-link.is-active span {
  color: inherit;
}

#aula-content {
  display: grid;
  gap: 20px;
}

.aula-panel {
  animation: fadeIn 0.2s ease;
}

/* ── Panel Inicio: barra de progreso ────────────────────── */
.inicio-progress {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 22px 16px;
  margin-bottom: 20px;
}

.inicio-progress__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.inicio-progress__label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  font-size: .92rem;
  color: var(--text);
}

.inicio-progress__count {
  font-size: .85rem;
  font-weight: 500;
  color: var(--accent);
  white-space: nowrap;
}

.inicio-progress__bar-wrap {
  height: 8px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.inicio-progress__bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  width: 0%;
  transition: width .5s ease;
}

.inicio-progress__bar-fill--complete {
  background: var(--success);
}

.inicio-progress__hint {
  margin-top: 10px;
  font-size: .81rem;
  color: var(--muted);
}

/* ── Tarjetas de inicio navegables ──────────────────────── */
.aula-cards .card--nav {
  cursor: pointer;
  position: relative;
  transition: border-color .15s, box-shadow .15s, transform .12s;
  text-align: left;
}

.aula-cards .card--nav:hover {
  border-color: rgba(27,54,93,.3);
  box-shadow: 0 4px 14px rgba(27,54,93,.08);
  transform: translateY(-2px);
}

.aula-cards .card--nav:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.card--nav__arrow {
  position: absolute;
  bottom: 14px;
  right: 14px;
  color: var(--muted);
  opacity: .5;
  transition: opacity .15s, transform .15s;
}

.card--nav:hover .card--nav__arrow {
  opacity: 1;
  transform: translateX(2px);
}

/* ── Panel Inicio: actividad reciente ───────────────────── */
.inicio-recent {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}

.inicio-recent__panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.inicio-recent__panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.inicio-recent__panel-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  font-size: .88rem;
  color: var(--text);
}

.inicio-recent__list {
  flex: 1;
}

.inicio-recent__item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background .1s;
}

.inicio-recent__item:last-child {
  border-bottom: none;
}

.inicio-recent__item:hover {
  background: rgba(27,54,93,.03);
}

.inicio-recent__item-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(27,54,93,.07);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.inicio-recent__item-body {
  flex: 1;
  min-width: 0;
}

.inicio-recent__item-name {
  display: block;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inicio-recent__item-meta {
  display: block;
  font-size: .75rem;
  color: var(--muted);
  margin-top: 1px;
}

.inicio-recent__item-watched {
  flex-shrink: 0;
  font-size: .72rem;
  font-weight: 600;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.inicio-recent__empty {
  padding: 30px 16px;
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
}

.inicio-notif-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--accent);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1;
}

@media (max-width: 1200px) {
  .inicio-recent {
    grid-template-columns: 1fr 1fr;
  }
  .inicio-recent__panel--notifications {
    grid-column: 1 / -1;
  }
}

@media (max-width: 780px) {
  .inicio-recent {
    grid-template-columns: 1fr;
  }
  .inicio-recent__panel--notifications {
    grid-column: auto;
  }
}

/* ── Badge "Vista" en tarjetas de grabadas ──────────────── */
.grabada-card__watched {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .72rem;
  font-weight: 600;
  color: var(--success);
  margin: 4px 0 0;
  letter-spacing: .01em;
}

.aula-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.aula-list {
  display: grid;
  gap: 16px;
}

.aula-list .card,
.aula-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.aula-item--folder{
  border-color: rgba(27,54,93,.16);
  background: rgba(27,54,93,.02);
}

.aula-item__head{
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.aula-item__icon{
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(27,54,93,.08);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.aula-item h3,
.aula-cards .card h3 {
  margin: 0 0 2px;
  font-size: 1rem;
  font-family: var(--font-body);
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.aula-item p,
.aula-cards .card p {
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Wrapper de acciones al final de cada aula-item (Abrir + Eliminar, etc.) */
.aula-item__actions{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.aula-item .btn,
.aula-list .btn {
  flex-shrink: 0;
}

/* ── Secciones de Apuntes ───────────────────────────────── */
.aula-section {
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 12px;
}

.aula-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(27,54,93,.04);
  border-bottom: 1px solid var(--border);
}

.aula-section__title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  flex: 1;
  min-width: 0;
}

.aula-section__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.aula-section__move {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}

.aula-section__move .btn--icon {
  padding: 2px 5px;
  line-height: 1;
}

.aula-section__move .btn--icon:disabled {
  opacity: 0.25;
  cursor: default;
}

.aula-section__toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.aula-section__body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.aula-section__body .aula-item {
  margin: 0;
}

.aula-section__empty {
  margin: 6px 0;
  font-size: .875rem;
}

.aula-section__divider {
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 16px 0 6px;
}

/* Botones pequeños dentro de secciones */
.btn--sm {
  padding: 5px 12px;
  font-size: .8rem;
}

/* ── Live room: video + chat layout ─────────────────────── */
.live-room {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  width: 100%;
  min-height: 680px;
  /* 185px asumía el header de 60px; ahora es 77px (+17px), así que el resto
     de chrome restado pasa de 125px a 202px en total para no perder alto. */
  height: calc(100dvh - 202px);
  max-height: 860px;
  margin-bottom: 0;
}
.aula-panel[data-panel="directos"] {
  padding: 12px;
}

#aula-content .aula-panel[data-panel="directos"],
#aula-content .aula-panel[data-panel="inicio"] {
  /* 128px asumía el header de 60px (+17px de aumento → 145px). */
  min-height: calc(100dvh - 145px);
}

#directos-list {
  display: block;
}

#directos-list .live-room__video {
  min-height: 0;
}

#directos-list .viewer-video-wrap,
#directos-list .live-video-wrap {
  flex: 1;
  min-height: 0;
}

.live-room__video {
  display: flex;
  flex-direction: column;
  background: #000;
  min-width: 0;
  min-height: 0;
}
.live-video-wrap {
  flex: 1;
  position: relative;
  aspect-ratio: 16/9;
}
.live-video-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}
.live-video-wrap--noframe {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #111;
  padding: 32px 24px;
}
.live-video-noframe-title {
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  text-align: center;
}
.live-video-noframe-sub {
  color: rgba(255,255,255,.55);
  font-size: .9rem;
  margin: 0;
  text-align: center;
}
/* .live-room__title-bar and .live-room__title removed — title now in live-status-bar */
.live-room__desc {
  color: rgba(255,255,255,.55);
  font-size: .82rem;
  margin: 0;
}

/* ── Chat sidebar ─────────────────────────────────────────── */
.live-room__chat {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-left: 1px solid var(--border);
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.live-chat__header {
  padding: 12px 14px;
  font-size: .85rem;
  font-weight: 700;
  color: var(--ink);
  border-bottom: 1px solid var(--border);
  background: #fafafa;
}
.live-chat__feed {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}
.chat-msg {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-width: 90%;
  align-self: flex-start;
}
.chat-msg--me {
  align-self: flex-end;
  align-items: flex-end;
}
.chat-msg--hand .chat-msg__text {
  background: #fef9c3;
  color: #854d0e;
}
.chat-msg__author {
  font-size: .7rem;
  color: var(--muted);
  font-weight: 600;
}
.chat-msg__text {
  background: #f1f5f9;
  border-radius: 10px;
  padding: 5px 10px;
  font-size: .85rem;
  color: var(--ink);
  word-break: break-word;
}
.chat-msg--me .chat-msg__text {
  background: var(--accent);
  color: #fff;
}
.live-chat__input-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  background: #fafafa;
}
.live-chat__input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 7px 12px;
  font-size: .85rem;
  color: var(--ink);
  background: #fff;
  outline: none;
  min-width: 0;
}
.live-chat__input:focus { border-color: var(--accent); }
.live-chat__send-btn,
.live-chat__hand-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  transition: background .15s, color .15s, border-color .15s;
}
.live-chat__send-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.live-chat__hand-btn:hover { background: #fef9c3; color: #92400e; border-color: #fbbf24; }
.live-chat__hand-btn.is-raised { background: #fef9c3; color: #92400e; border-color: #fbbf24; }

@media (max-width: 768px) {
  .live-room {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .live-room__video {
    min-height: 52vh;
  }

  .live-room__chat {
    border-left: none;
    border-top: 1px solid var(--border);
    max-height: 34vh;
  }
}

/* ── Pantalla previa "antes de entrar" a Directos ──────────── */
.live-entry-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 420px;
  padding: 24px;
}
.live-entry-gate__card {
  max-width: 420px;
  width: 100%;
  text-align: center;
  background: var(--panel, #fff);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 24px;
}
.live-entry-gate__title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}
.live-entry-gate__text {
  margin: 0 0 18px;
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.5;
}
.live-entry-gate__error {
  margin: 0 0 14px;
  font-size: .85rem;
  color: #dc2626;
  line-height: 1.4;
}
.live-entry-gate__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.live-entry-gate__hint {
  margin: 14px 0 0;
  font-size: .8rem;
  color: var(--muted);
}
@media (max-width: 480px) {
  .live-entry-gate {
    min-height: 320px;
    padding: 16px;
  }
  .live-entry-gate__card {
    padding: 22px 18px;
  }
  .live-entry-gate__actions {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ── Eventos en el sidebar ───────────────────────────────── */
.sidebar-eventos {
  border-top: 1px solid var(--border);
  padding: 14px 12px 16px;
}
.sidebar-eventos__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.sidebar-eventos__title {
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  margin: 0;
}
.sidebar-eventos__add {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--accent);
  transition: background .15s, border-color .15s;
}
.sidebar-eventos__add:hover {
  background: rgba(27,54,93,.08);
  border-color: var(--accent);
}
.sidebar-eventos__empty {
  font-size: .8rem;
  margin: 0;
}
#evento-form-wrap:not([hidden]) {
  margin-bottom: 10px;
}
/* Evento form dentro del sidebar: más compacto */
#evento-form-wrap .session-form {
  padding: 14px;
  border-radius: 10px;
}
#evento-form-wrap .session-form__title {
  font-size: .85rem;
  margin-bottom: 10px;
}
#evento-form-wrap .session-form__fields {
  gap: 8px;
  margin-bottom: 12px;
}
#evento-form-wrap .session-form__field input {
  font-size: .82rem;
  padding: 6px 10px;
}

/* Items de evento en sidebar */
.evento-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(27,54,93,.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
}
.evento-item__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.evento-item__title {
  font-size: .83rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.evento-date {
  font-size: .76rem;
  color: var(--muted);
}
.evento-item__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.eventos-toolbar {
  margin-bottom: 24px;
}
.eventos-empty {
  font-size: .875rem;
}

/* ── Directos: badges de estado ──────────────────────────── */
.session-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 3px 9px;
  border-radius: 20px;
  margin-bottom: 4px;
  text-transform: uppercase;
}
.session-badge--live {
  background: #fee2e2;
  color: #dc2626;
}
.session-badge__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse-dot 1.2s ease infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .3; transform: scale(.65); }
}
.session-badge--scheduled {
  background: rgba(27,54,93,.08);
  color: var(--accent);
}
.session-badge--ended {
  background: #f3f4f6;
  color: var(--muted);
}

/* ── Session item variants ───────────────────────────────── */
.session-item--live {
  border-left: 3px solid #dc2626;
}
.session-item--ended {
  opacity: .65;
}
.aula-item__icon--live {
  background: #fee2e2;
  color: #dc2626;
}
.session-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.session-date {
  margin: 2px 0 0;
  font-size: .82rem;
  color: var(--muted);
}
.session-desc {
  margin: 2px 0 0;
  font-size: .82rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.session-actions {
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.session-manage {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Botón "Unirse ahora" */
.btn--session-join {
  background: #dc2626;
  color: #fff;
  font-weight: 600;
  border: none;
  white-space: nowrap;
}
.btn--session-join:hover {
  background: #b91c1c;
  color: #fff;
}
/* Botón "Iniciar" */
.btn--session-start {
  background: #16a34a;
  color: #fff;
  border: none;
  font-weight: 600;
}
.btn--session-start:hover {
  background: #15803d;
  color: #fff;
}
/* Botón deshabilitado */
.btn--disabled {
  background: #f3f4f6;
  color: var(--muted);
  border: 1px solid var(--border);
  cursor: default;
  pointer-events: none;
  font-size: .82rem;
  padding: 6px 14px;
  border-radius: 8px;
}

/* ── Barra de herramientas del panel Directos ─────────────── */
.directos-toolbar {
  margin-bottom: 16px;
}
.directos-empty {
  margin-top: 4px;
}

/* ── Estado vacío del panel Directos ─────────────────────── */
.directos-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px 40px;
  gap: 10px;
  color: var(--muted, #888);
}
.directos-empty-state__icon {
  opacity: .35;
  margin-bottom: 8px;
}
.directos-empty-state__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}
.directos-empty-state__sub {
  font-size: .9rem;
  color: var(--muted, #888);
  margin: 0;
  max-width: 360px;
}

/* ── Lista de eventos para seleccionar (profesor) ─────────── */
.directos-pick-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 440px;
  margin-top: 16px;
}
.directos-pick-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, box-shadow .15s;
}
.directos-pick-item:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}
.directos-pick-item__title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink);
}
.directos-pick-item__date {
  font-size: .82rem;
  color: var(--muted, #888);
}

/* ── Formulario de nueva/editar sesión ───────────────────── */
.session-form {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 16px;
}
.session-form__title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 16px;
}
.session-form__fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}
.session-form__field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink);
}
.session-form__field input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .9rem;
  color: var(--ink);
  background: #fafafa;
  transition: border-color .15s;
}
.session-form__field input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}
.session-form__actions {
  display: flex;
  gap: 8px;
}

.session-form__datetime-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 480px) {
  .session-form__datetime-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px){
  .aula-list .card,
  .aula-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .aula-item .btn,
  .aula-list .btn {
    width: 100%;
    justify-content: center;
  }
}

#aula-loading,
#aula-denied {
  min-height: 220px;
  display: grid;
  align-content: center;
}

#aula-denied .btn {
  margin-top: 14px;
  width: fit-content;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .aula-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .aula-cards {
    grid-template-columns: 1fr;
  }

  .aula-nav {
    gap: 8px;
  }

  .aula-list .card,
  .aula-item {
    padding: 16px;
  }
}

/* ---------- Página: Hero de subpáginas ---------- */
.page-hero{
  padding-top: 24px;
  padding-bottom: 4px;
  max-width: var(--max);
}

.page-hero__lead{
  max-width: 640px;
  font-size: 1.05rem;
  margin-top: 10px;
}

/* ---------- Página About: bloques, pasos y perfil ---------- */
.about-shell{
  display: grid;
  gap: 36px;
}

.about-block{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
}

.about-block h2{
  font-size: clamp(20px, 2.4vw, 28px);
  margin-top: 8px;
  margin-bottom: 12px;
}

.steps{
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.step{
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.step__num{
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.step__body strong{
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 4px;
}

.step__body p{
  margin: 0;
}

.about-profile{
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-top: 14px;
}

.about-profile__avatar{
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: rgba(27,54,93,.08);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}

.about-profile__name{
  display: block;
  color: var(--text);
  font-weight: 700;
  margin-bottom: 6px;
}

@media (max-width: 600px){
  .about-profile{ flex-direction: column; }
}

/* ---------- Página Contacto ---------- */
.contact-shell{
  max-width: 560px;
  margin: 0 auto;
}

.contact-form{
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.contact-form .field input,
.contact-form .field textarea{
  width: 100%;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
  font: inherit;
  resize: vertical;
}

.contact-form .field input:focus,
.contact-form .field textarea:focus{
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(27,54,93,.12);
}

.contact-form .field span{
  display: block;
  font-size: .9rem;
  color: var(--muted);
  margin-bottom: 6px;
}

/* ---------- Footer público ---------- */
.site-footer{
  max-width: var(--max);
  margin: 0 auto 28px;
  padding: 20px 18px 0;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: .88rem;
}

.site-footer a{
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer a:hover{
  color: var(--text);
}

/* ============================================================
   DS ADDITIONS — step 3
   All classes below are NEW (additive). No existing rule touched.
   Source: vanilla/jmz.css from the JMZ Oposiciones design system.
   ============================================================ */

/* ---------- Button variants ---------- */
/* Note: .btn--ghost-white already exists further in this file (kept there). */
.btn--on-dark{
  background: #fff;
  color: var(--color-primary);
  border: 1px solid transparent;
}
.btn--on-dark:hover{ background: rgba(255,255,255,.9); }

.btn--block{ width: 100%; justify-content: center; }

/* Alias matching DS naming convention (existing .btn-danger unchanged) */
.btn--danger{ background: var(--status-danger); color: #fff; border: none; }
.btn--danger:hover{ background: #9b1c14; }

/* ---------- Badge & tag ---------- */
.badge--on-dark{
  color: rgba(255,255,255,.92);
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.22);
}

/* Note: .tag already exists further in this file (kept there). */

/* ---------- Card variants ---------- */
/* Note: .card--hover already exists further in this file (kept there). */
.card__icon--lg{
  width: 52px;
  height: 52px;
  border-radius: var(--radius-xl);
}

.card__icon--muted{
  background: rgba(74,85,104,.08);
  color: var(--text-body);
}

/* ---------- Status pills ---------- */
.status{
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.status::before{
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: .85;
}
.status--active   { background: var(--status-success-bg); color: var(--status-success); }
.status--expired  { background: var(--status-error-bg);   color: var(--status-error); }
.status--live     { background: var(--status-error-bg);   color: var(--status-error); }
.status--live::before { animation: jmz-pulse 1.4s ease-in-out infinite; }
.status--scheduled{ background: var(--blue-100);          color: var(--color-primary); }
.status--ended    { background: var(--surface-sunken);    color: var(--text-muted); }
.status--pending  { background: var(--status-warn-bg);    color: var(--status-warn); }

@keyframes jmz-pulse{ 0%,100%{opacity:.4} 50%{opacity:1} }

/* ---------- Progress bar (generic) ---------- */
.progress__head{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.progress__label{
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  font-size: .92rem;
  color: var(--text-strong);
}
.progress__count{
  font-size: .85rem;
  font-weight: 500;
  color: var(--color-primary);
  white-space: nowrap;
}
.progress__track{
  height: 8px;
  background: var(--border-color);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.progress__fill{
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-pill);
  transition: width .5s ease;
}
.progress__fill--success{ background: var(--status-progress); }

/* ---------- Alerts ---------- */
.alert{
  display: flex;
  gap: 10px;
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  border: 1px solid transparent;
}
.alert strong{ display: block; }
.alert--info    { background: var(--primary-tint-04);       border-color: var(--primary-tint-16); }
.alert--success { background: rgba(92,124,111,.10);         border-color: rgba(92,124,111,.25); }
.alert--error   { background: rgba(138,45,45,.04);          border-color: rgba(138,45,45,.18); color: #8a2d2d; }
.alert--warn    { background: var(--status-warn-bg);        border-color: rgba(146,64,14,.22); color: var(--status-warn); }

/* ---------- Empty / error / denied states ---------- */
.state{
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 48px 24px;
}
.state__icon{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-xl);
  margin-bottom: 2px;
  background: var(--primary-tint-08);
  color: var(--color-primary);
}
.state__icon--error { background: rgba(138,45,45,.06); color: #8a2d2d; }
.state__icon--muted { background: rgba(74,85,104,.08);  color: var(--text-body); }
.state strong{ font-size: 1.05rem; color: var(--text-strong); }
.state p{ margin: 0; max-width: 380px; color: var(--text-body); font-size: .92rem; }

/* ---------- List rows (files, sessions, members) ---------- */
.list-row{
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.list-row__head{
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}
.list-row__title{
  font-weight: 600;
  font-size: .95rem;
  color: var(--text-strong);
}
.list-row__meta{
  font-size: .82rem;
  color: var(--text-muted);
}
.list-row__actions{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.list-stack{ display: grid; gap: 12px; }

/* ---------- Stat card ---------- */
.stat-card{
  display: flex;
  align-items: center;
  gap: 14px;
}
.stat-card__num{
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text-strong);
  line-height: 1;
}
.stat-card__label{
  font-size: .85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---------- Avatar ---------- */
.avatar{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--primary-tint-08);
  color: var(--color-primary);
  font-weight: 700;
}
.avatar img{ width: 100%; height: 100%; object-fit: cover; }
.avatar--sm{
  width: 30px;
  height: 30px;
  border-radius: var(--radius-md);
  font-size: 12px;
}

/* ---------- Sidebar extras ---------- */
.sidebar-badge{
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--color-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Generic sidebar section label (complements .settings-section-label) */
.sidebar-section-label{
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
  color: var(--text-muted);
  margin: 14px 4px 5px;
}

/* DS naming aliases for existing .sidebar-name / .sidebar-role */
.sidebar-user__name{
  font-weight: 700;
  font-size: 14px;
  color: var(--text-strong);
}
.sidebar-user__role{
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---------- App shell extras ---------- */
/* DS name for the sticky top bar on app pages. Unificada con .site-header:
   mismo logo .brand, misma nav central .nav/.nav__link, mismo fondo, borde
   inferior y padding horizontal — y la MISMA altura real, vía el token
   compartido --header-height (medida directamente sobre .site-header:
   padding 14px arriba/abajo + contenido ≈ 77px). .site-header usa ese token
   como min-height (no se queda corto); .app-header lo usa como height fijo
   porque .app-shell/.app-sidebar necesitan un valor exacto para su propio
   cálculo de layout (calc(100vh - var(--header-height))). Cambiar el token
   ajusta ambas cabeceras y todo el layout dependiente a la vez.
   Grid de 3 zonas en vez del space-between del público: así el nav queda
   centrado de verdad aunque la zona derecha (solo la campana) sea mucho
   más estrecha que la zona izquierda (toggle del sidebar + logo). */
.app-header{
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-height);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 16px;
  padding: 0 18px;
  background: #fff;
  border-bottom: 1px solid var(--border-color);
}

.app-header__left{
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.app-header__center{
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.app-header__right{
  display: flex;
  align-items: center;
  justify-self: end;
  /* Contenedor de posicionamiento para que la campana pueda anclarse al
     borde derecho sin contar como ancho "en flujo" (ver más abajo). */
  position: relative;
}

/* Slot fantasma: reutiliza tal cual las clases .btn/.btn--ghost/.btn--outline-primary/
   .auth-dd de la cabecera pública para que su ancho renderizado sea idéntico
   al de .actions, sin duplicar valores en px. visibility:hidden (no display:none)
   para que siga ocupando espacio en el layout sin pintarse ni ser interactivo. */
.app-header__ghost-actions{
  display: flex;
  align-items: center;
  visibility: hidden;
  pointer-events: none;
}

/* La campana sale del flujo y se ancla al borde derecho del slot, así el
   ancho "en flujo" de .app-header__right (el que cuenta para centrar la
   nav) es exactamente el del slot fantasma — igual que .actions público. */
.app-header__right .notif-dd{
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
}

/* El slot fantasma solo tiene sentido mientras la nav pública está visible
   (desktop): en móvil no debe reservar sus ~310px, o aplastaría el
   sidebar-toggle y el logo contra la campana. Sin nav que centrar, la
   campana vuelve a su posición normal en flujo (sin el truco de
   position:absolute), pegada al borde derecho por el propio flex layout. */
@media (max-width: 900px){
  .app-header__ghost-actions{ display: none; }
  .app-header__right .notif-dd{
    position: relative;
    top: auto;
    right: auto;
    transform: none;
  }
}

.app-main__head{ margin-bottom: 22px; }
.app-main__head h1{ font-size: var(--fs-xl); font-weight: 700; margin: 0 0 4px; }
.app-main__head h2{ font-size: 1.25rem; font-weight: 700; margin: 0 0 4px; }

.grid-3{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 900px){ .grid-3{ grid-template-columns: 1fr; } }

/* App tag (uppercase label in app headers) */
.app-tag{
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 3px 8px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
}

/* ---------- Auth card (standalone login/register pages) ---------- */
.auth-wrap{
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--gradient-hero);
}
.auth-card{
  width: min(94vw, 420px);
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-2xl);
  padding: 28px 26px;
  box-shadow: var(--shadow-xl);
}
.auth-card__logo{
  display: block;
  margin: 0 auto 18px;
  height: 40px;
}
.auth-card h1{ font-size: 1.35rem; text-align: center; margin: 0 0 4px; }
.auth-card__sub{
  text-align: center;
  color: var(--text-body);
  font-size: .9rem;
  margin: 0 0 20px;
}
.auth-form{ display: grid; gap: 12px; }
.auth-foot{
  text-align: center;
  font-size: .85rem;
  color: var(--text-body);
  margin: 16px 0 0;
}
.auth-foot a{ color: var(--color-primary); font-weight: 600; }
.auth-divider{
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--text-faint);
  font-size: .78rem;
}
.auth-divider::before,
.auth-divider::after{
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

/* ---------- Recording player (dark full-screen) ---------- */
.player-page{
  background: #0d0d0d;
  color: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 4vh;
}
.player-title{
  font-size: clamp(16px, 2vw, 24px);
  font-weight: 700;
  margin: 0 0 4px;
  text-align: center;
}
.player-date{
  font-size: .82rem;
  color: rgba(255,255,255,.5);
  margin: 0 0 14px;
}
.player-stage{
  width: min(92vw, calc((100vh - 120px) * 16 / 9));
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.85);
}

/* ---------- Live room extras ---------- */
/* Waiting/ended/denied stage (no video) */
.live-stage{
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #111;
  color: rgba(255,255,255,.85);
  text-align: center;
  padding: 24px;
}
.live-stage__title{ color: #fff; font-weight: 700; font-size: 1.1rem; margin: 0; }
.live-stage__sub  { color: rgba(255,255,255,.55); font-size: .9rem; margin: 0; }

/* Dark title/info bar at the bottom of the video column */
.live-room__bar{
  padding: 10px 16px;
  background: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}

/* DS naming alias for the existing .live-chat__header */
.live-chat__head{
  padding: 12px 14px;
  font-size: .85rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
  background: var(--surface-sunken);
}

/* Icon-circle buttons (send / raise-hand in live chat) */
.icon-circle{
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-circle--primary{
  background: var(--color-primary);
  color: #fff;
  border: none;
}

/* ---------- Subscription plan card (DS alias) ---------- */
/* .sub-plan-card already exists — .sub-card is the DS naming alias */
.sub-card{
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-2xl);
  max-width: 520px;
  overflow: hidden;
}
.sub-card__head{
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}
.sub-card__body{ padding: 4px 20px; }
.sub-card__includes{
  padding: 14px 20px 18px;
  background: var(--primary-tint-04);
  border-top: 1px solid var(--border-color);
}
.sub-card__includes ul{
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sub-card__includes li{
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-strong);
}
.sub-card__includes li::before{
  content: "";
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background: var(--status-success);
  border-radius: 50%;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

@media (max-width: 600px){
  .site-footer{ flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* ── WebRTC Broadcaster UI ───────────────────────────────── */
.bc-room {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bc-video-wrap {
  position: relative;
  width: 100%;
  max-width: 720px;
  aspect-ratio: 16/9;
  background: #111;
  border-radius: 12px;
  overflow: hidden;
}
.bc-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* .bc-overlay removed — status/count now in live-room__action-bar overlay */
.bc-status {
  font-size: .82rem;
  color: var(--text);
  font-weight: 600;
}
.bc-viewer-count {
  font-size: .78rem;
  color: var(--muted);
}
.bc-hint {
  font-size: .8rem;
}

/* ── WebRTC Viewer UI ────────────────────────────────────── */
.viewer-video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #111;
  border-radius: 12px;
  overflow: hidden;
}

.viewer-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

/* Screen share: preserve full content with contain (no crop) */
.viewer-video-wrap.is-screen-sharing .viewer-video {
  object-fit: contain;
  background: #0b1120;
}

.viewer-connecting {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(17,17,17,.85);
  color: #fff;
  font-size: .9rem;
}
.viewer-connecting__spinner {
  width: 32px; height: 32px;
  border: 3px solid rgba(255,255,255,.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.viewer-unmute-btn {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.65);
  color: #fff;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 20px;
  padding: 7px 18px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  z-index: 5;
  backdrop-filter: blur(4px);
  transition: background .15s;
}
.viewer-unmute-btn:hover { background: rgba(0,0,0,.85); }
.viewer-dbg {
  position: absolute;
  top: 8px; left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.72);
  color: #fff;
  font-size: .72rem;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

/* ── Botón de micrófono flotante del alumno (dentro del video-wrap) ── */
.viewer-mic-fab {
  position: absolute;
  bottom: 14px;
  left: 12px;
  z-index: 4;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(10,16,30,.65);
  color: rgba(255,255,255,.85);
  border: 1.5px solid rgba(255,255,255,.22);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  transition: background .15s, border-color .15s, color .15s;
  padding: 0;
  flex-shrink: 0;
}

.viewer-mic-fab:hover:not(:disabled) {
  background: rgba(10,16,30,.88);
  border-color: rgba(255,255,255,.38);
  color: #fff;
}

.viewer-mic-fab.is-on {
  background: rgba(22,163,74,.25);
  border-color: rgba(22,163,74,.55);
  color: #4ade80;
}

.viewer-mic-fab.is-on:hover:not(:disabled) {
  background: rgba(22,163,74,.38);
  border-color: rgba(22,163,74,.75);
}

.viewer-mic-fab:disabled {
  opacity: .38;
  cursor: not-allowed;
}

.viewer-mic-fab:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 3px;
}

/* Hint flotante que aparece cuando tiene contenido (mensaje de error/estado) */
.viewer-mic-hint {
  position: absolute;
  bottom: 58px;
  left: 8px;
  background: rgba(10,16,30,.88);
  color: rgba(255,255,255,.85);
  font-size: .72rem;
  line-height: 1.35;
  padding: 5px 10px;
  border-radius: 8px;
  pointer-events: none;
  z-index: 5;
  max-width: 210px;
  display: none;
  backdrop-filter: blur(4px);
}

.viewer-mic-hint:not(:empty) {
  display: block;
}

.live-room--teacher .viewer-video-wrap--teacher{
  border-radius: 0;
  aspect-ratio: 16 / 9;
}

.viewer-connecting--preview{
  background: rgba(17,17,17,.55);
}

/* ── Barra de controles del profesor (base, para embeds externos) ── */
.live-room__action-bar{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: #fff;
  border-top: 1px solid var(--border);
}

.live-room__action-bar .btn{
  padding: 6px 12px;
  font-size: .8rem;
  border-radius: 6px;
  box-shadow: none;
}

.live-room__action-bar .btn--ghost{
  background: #fff;
  border-color: var(--border);
  color: var(--text);
}

.live-room__action-bar .btn--ghost:hover:not(:disabled){
  background: rgba(27,54,93,.06);
}

.live-room__action-bar .btn[aria-pressed="false"]{
  background: #f3f4f6;
  color: var(--muted);
  border-color: var(--border);
}

.live-room__action-bar .btn:disabled{
  opacity: .55;
  cursor: default;
  background: #f3f4f6;
  border-color: var(--border);
  color: var(--muted);
}

.live-room__action-bar-end{
  border-color: rgba(220,38,38,.35) !important;
  color: #b91c1c !important;
  margin-left: auto;
}

.live-room__action-bar-end:hover:not(:disabled){
  background: rgba(220,38,38,.08) !important;
}

#bc-record-btn.is-recording{
  background: #fff;
  border-color: #dc2626;
  color: #b91c1c;
  font-weight: 600;
}

/* ── Action bar como overlay dentro del video-wrap (WebRTC nativo) ── */
.viewer-video-wrap .live-room__action-bar{
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(10,16,30,.78);
  border-top: none;
  border-radius: 0;
  flex-wrap: nowrap;
  z-index: 3;
  gap: 5px;
  padding: 7px 10px;
  backdrop-filter: blur(6px);
}

.viewer-video-wrap .live-room__action-bar .btn{
  background: transparent;
  color: rgba(255,255,255,.88);
  border-color: rgba(255,255,255,.18);
  padding: 5px 10px;
  font-size: .79rem;
  border-radius: 5px;
  flex-shrink: 0;
}

.viewer-video-wrap .live-room__action-bar .btn:hover:not(:disabled){
  background: rgba(255,255,255,.13);
  border-color: rgba(255,255,255,.3);
  color: #fff;
}

.viewer-video-wrap .live-room__action-bar .btn--session-start{
  background: rgba(37,99,235,.75);
  color: #fff;
  border-color: rgba(37,99,235,.45);
}

.viewer-video-wrap .live-room__action-bar .btn--session-start:hover:not(:disabled){
  background: rgba(37,99,235,.9);
}

.viewer-video-wrap .live-room__action-bar .btn[aria-pressed="false"]{
  background: transparent;
  color: rgba(255,255,255,.4);
  border-color: rgba(255,255,255,.1);
}

.viewer-video-wrap .live-room__action-bar .btn:disabled{
  opacity: .4;
  cursor: default;
  background: transparent;
  border-color: rgba(255,255,255,.1);
  color: rgba(255,255,255,.4);
}

.viewer-video-wrap #bc-record-btn.is-recording{
  background: transparent;
  border-color: rgba(239,68,68,.45);
  color: #fca5a5;
  font-weight: 600;
}

.viewer-video-wrap #bc-record-btn.is-recording::before{
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  margin-right: 5px;
  vertical-align: middle;
  flex-shrink: 0;
}

.viewer-video-wrap .live-room__action-bar-end{
  border-color: rgba(220,38,38,.35) !important;
  color: #fca5a5 !important;
}

.viewer-video-wrap .live-room__action-bar-end:hover:not(:disabled){
  background: rgba(220,38,38,.2) !important;
  border-color: rgba(220,38,38,.5) !important;
}

/* bc-status y bc-viewer-count integrados en la barra de controles */
.viewer-video-wrap .live-room__action-bar .bc-status{
  font-size: .74rem;
  color: rgba(255,255,255,.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
  flex-shrink: 1;
  padding: 0 2px;
}

.viewer-video-wrap .live-room__action-bar .bc-viewer-count{
  font-size: .74rem;
  color: rgba(255,255,255,.35);
  white-space: nowrap;
  flex-shrink: 0;
}

.live-room--teacher .live-room__chat{
  background: #fff;
}

@media (max-width: 768px){
  .live-room__action-bar{
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .live-room__action-bar .btn{
    flex-shrink: 0;
  }
  .live-room__action-bar-end{
    margin-left: 0;
  }
  .viewer-video-wrap .live-room__action-bar .bc-status,
  .viewer-video-wrap .live-room__action-bar .bc-viewer-count{
    display: none;
  }
  .live-status-bar__title{
    max-width: 140px;
  }
}

.live-side-tabs{
  display:flex;
  gap:0;
  border-bottom:1px solid var(--border);
  background:#fafafa;
}

.live-side-tab{
  flex:1;
  border:none;
  background:transparent;
  padding:12px 14px;
  font:inherit;
  font-size:.85rem;
  font-weight:700;
  color:var(--muted);
  cursor:pointer;
  border-bottom:2px solid transparent;
}

.live-side-tab.is-active{
  color:var(--accent);
  border-bottom-color:var(--accent);
  background:#fff;
}

.live-side-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.live-participants-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  overflow-y: auto;
  min-height: 0;
}

.live-participant{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 10px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  transition: border-color .15s ease, background .15s ease;
}

.live-participant--speaking{
  border-color: var(--accent);
  background: rgba(27,54,93,.04);
}

.live-participant__avatar{
  display:flex;
  align-items:center;
  justify-content:center;
  width:32px;
  height:32px;
  border-radius:50%;
  background: rgba(27,54,93,.08);
  color: var(--accent);
  font-weight:700;
  font-size:.85rem;
  flex-shrink:0;
  transition: box-shadow .15s ease;
}

/* Anillo discreto + pequeño pulso — el indicador de "hablando" no depende
   solo de cambiar el icono del micro. */
.live-participant__avatar--speaking{
  box-shadow: 0 0 0 3px rgba(22,163,74,.35);
  animation: live-speaking-pulse 1.4s ease-in-out infinite;
}

@keyframes live-speaking-pulse{
  0%, 100% { box-shadow: 0 0 0 2px rgba(22,163,74,.35); }
  50% { box-shadow: 0 0 0 5px rgba(22,163,74,.18); }
}

.live-participant__meta{
  display:flex;
  flex-direction:column;
  gap:1px;
  min-width:0;
  flex: 1 1 auto;
}

.live-participant__name{
  font-size:.86rem;
  color:var(--text);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.live-participant__role{
  font-size:.74rem;
  color:var(--muted);
}

.live-participant__mic{
  display:flex;
  align-items:center;
  justify-content:center;
  width:24px;
  height:24px;
  border-radius:50%;
  color: var(--muted);
  flex-shrink:0;
}

.live-participant__mic--on{
  color: #16a34a;
}

.live-participant__mute-btn{
  display:flex;
  align-items:center;
  justify-content:center;
  width:26px;
  height:26px;
  border-radius:50%;
  border:1px solid var(--border);
  background:#fff;
  color: var(--muted);
  cursor:pointer;
  flex-shrink:0;
}

.live-participant__mute-btn:hover{
  background: rgba(180,35,24,.08);
  border-color: rgba(180,35,24,.25);
  color: #b42318;
}

.live-side-empty{
  padding:16px 14px;
  color:var(--muted);
  font-size:.88rem;
}

.live-participants-count-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:18px;
  height:18px;
  padding:0 5px;
  border-radius:999px;
  background: rgba(27,54,93,.1);
  color: var(--accent);
  font-size:.7rem;
  font-weight:700;
  margin-left:4px;
}

/* ── Barra de estado superior (estado, duración, participantes, conexión) ── */
.live-status-bar{
  display:flex;
  align-items:center;
  gap:14px;
  flex-wrap:wrap;
  padding:8px 12px;
  margin-bottom:8px;
  border-radius:10px;
  background: rgba(15,23,42,.55);
  color:#fff;
  font-size:.78rem;
}

.live-status-bar__item{
  display:inline-flex;
  align-items:center;
  gap:4px;
  white-space:nowrap;
}

.live-status-bar__conn{ color:#86efac; }
.live-status-bar__conn--lost{ color:#fca5a5; }

.live-status-bar__title{
  font-size:.88rem;
  font-weight:600;
  color:#fff;
  flex:1;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

#directos-list .live-status-bar{ position: static; }

/* ── Aviso de grabación (visible para todos los participantes) ── */
.live-room__recording-notice{
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin-top:6px;
  padding:4px 10px;
  border-radius:999px;
  background: rgba(220,38,38,.12);
  color:#b91c1c;
  font-size:.78rem;
  font-weight:600;
}

/* ── Participantes: controles de moderación del aula (solo profesor/admin) ── */
.live-mod-controls{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:8px;
  padding:12px 14px;
  border-bottom:1px solid var(--border);
  background:#fafafa;
}

.live-mod-controls__title{
  margin:0;
  font-size:.7rem;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.04em;
  color:var(--muted);
}

.live-allow-audio-toggle{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:.85rem;
  font-weight:600;
  color: var(--text);
  cursor:pointer;
}

/* .live-room__controls removed — mic btn is now .viewer-mic-fab inside the video wrap */

/* #viewer-mic-btn is now .viewer-mic-fab (dark overlay FAB) */
#viewer-mic-btn{
  display:flex;
  align-items:center;
  justify-content:center;
}

#viewer-mic-btn.is-on{
  background: rgba(22,163,74,.25);
  border-color: rgba(22,163,74,.55);
  color: #4ade80;
}

/* ── Chat: estados de envío, banner de conexión, nuevos mensajes ── */
.live-chat__feed-wrap{
  position:relative;
  flex:1;
  min-height:0;
  display:flex;
  flex-direction:column;
}

.live-chat__feed-wrap .live-chat__feed{
  flex:1;
}

.live-chat__newmsg{
  position:absolute;
  bottom:10px;
  left:50%;
  transform:translateX(-50%);
  border:none;
  border-radius:999px;
  padding:5px 14px;
  background: var(--accent);
  color:#fff;
  font-size:.76rem;
  font-weight:600;
  cursor:pointer;
  box-shadow: 0 6px 16px rgba(0,0,0,.18);
}

.live-chat__conn-banner{
  margin:0;
  padding:6px 12px;
  background:#fef3c7;
  color:#92400e;
  font-size:.76rem;
  font-weight:600;
  text-align:center;
}

.chat-msg__status{
  font-size:.65rem;
  color: var(--muted);
  margin-top:1px;
  background:none;
  border:none;
  padding:0;
  cursor:default;
}

.chat-msg--sending .chat-msg__text{ opacity:.65; }

.chat-msg__status--retry{
  color:#b42318;
  cursor:pointer;
  text-decoration:underline;
}

textarea.live-chat__input{
  resize:none;
  font-family:inherit;
  line-height:1.3;
  padding-top:8px;
}

@media (max-width: 768px){
  .live-status-bar{
    font-size:.72rem;
    gap:8px;
  }
}

/* ── Directos: toast de error no bloqueante ──────────────── */
.directos-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: #1e293b;
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: .88rem;
  font-weight: 500;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
  white-space: pre-line;
  max-width: min(420px, 90vw);
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,.35);
}
.directos-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.directos-toast--error  { background: #dc2626; }
.directos-toast--warning { background: #d97706; }
.directos-toast--success { background: #16a34a; }

/* ── Viewer: estado finalizado / reconectando ────────────── */
.viewer-ended {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: rgba(255,255,255,.75);
  font-size: .95rem;
  text-align: center;
  padding: 24px;
  flex-direction: column;
  gap: 8px;
}
.viewer-ended p { margin: 0; }

/* ── Directos: sala de espera con estado para alumno ─────── */
.directos-waiting-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.directos-waiting-state__icon { color: var(--border); margin-bottom: 4px; }
.directos-waiting-state__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.directos-waiting-state__sub { font-size: .9rem; margin: 0; }
.directos-waiting-state__pulse {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: .3; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.3); }
}

.archivos-individuales-toolbar {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.archivos-individuales-toolbar .field {
  min-width: 260px;
  margin: 0;
}

/* ── Grid de vídeos (estilo YouTube) ─────────────────────── */
.grabadas-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-top: 8px;
}

.grabada-card {
  position: relative;
  border-radius: 10px;
  overflow: visible;
}

.grabada-card__link {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 10px;
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.grabada-card__link:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}

.grabada-card__thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: rgba(27,54,93,.08);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.grabada-card__thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.grabada-card__thumb-placeholder {
  color: var(--accent);
  opacity: .45;
}
.grabada-card__thumb-placeholder svg {
  width: 40px;
  height: 40px;
}

/* Icono de play al hacer hover */
.grabada-card__link:hover .grabada-card__thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.25);
  border-radius: 10px;
}

.grabada-card__title {
  margin: 8px 0 2px;
  font-size: .92rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.grabada-card__date {
  margin: 0;
  font-size: .78rem;
  color: var(--muted);
}

/* Botón eliminar flotante */
.grabada-card__delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: rgba(0,0,0,.55);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s, background .15s;
  z-index: 2;
}
.grabada-card:hover .grabada-card__delete {
  opacity: 1;
}
.grabada-card__delete:hover {
  background: #dc2626;
}

/* Etiqueta de estado (borrador/grabando/subiendo/fallida) — solo la ve quien gestiona el curso */
.grabada-card__status {
  display: inline-flex;
  align-items: center;
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  margin: 4px 0 0;
  letter-spacing: .01em;
}
.grabada-card__status--failed {
  color: #dc2626;
}

/* Botón "Publicar" para un borrador — visible siempre, sin requerir hover */
.grabada-card__publish {
  margin: 8px 12px 0;
  font-size: .8rem;
  padding: 6px 12px;
}

/* ── Formulario de subida de grabación ──────────────────── */
.grabacion-upload-form {
  background: var(--panel, #fff);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 20px;
  display: grid;
  gap: 14px;
}

.grabacion-preview-video {
  width: 100%;
  max-height: 280px;
  border-radius: 8px;
  background: #000;
  display: block;
  margin-top: 8px;
  margin-bottom: 10px;
}

.grabacion-thumb-preview {
  width: 160px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  margin-top: 8px;
  display: block;
}

.grabacion-form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.grabacion-form-error {
  color: #dc2626;
  font-size: .88rem;
  margin: 0;
}

/* Barra de progreso de subida */
.upload-progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.upload-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width .2s;
  width: 0%;
}
.upload-progress-text {
  font-size: .82rem;
  margin: 4px 0 0;
}

/* Responsive grabadas grid */
@media (max-width: 1100px) {
  .grabadas-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 780px) {
  .grabadas-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}
@media (max-width: 480px) {
  .grabadas-grid {
    grid-template-columns: 1fr;
  }
}

[hidden] {
  display: none !important;
}

/* ============================================================
   REDISEÑO 2025 — Secciones nuevas y mejoras visuales
   Todos los bloques de abajo complementan (no rompen) los
   estilos existentes. Se pueden revertir borrando este bloque.
   ============================================================ */

/* ── Smooth scroll global ─────────────────────────────────── */
html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ── Hero: nuevo layout oscuro con split 2 columnas ────────── */
.hero {
  padding: 0;
  background: linear-gradient(150deg, #0c1d3a 0%, #1B365D 55%, #1e3f6e 100%);
  position: relative;
  overflow: hidden;
}

/* Patrón sutil de fondo */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 50%, rgba(255,255,255,.03) 0%, transparent 60%),
                    radial-gradient(circle at 80% 20%, rgba(100,160,255,.06) 0%, transparent 50%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: 64px 24px;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 48px;
  align-items: center;
}

/* Texto del hero en blanco */
.hero__badge {
  background: rgba(255,255,255,.12) !important;
  border-color: rgba(255,255,255,.22) !important;
  color: rgba(255,255,255,.92) !important;
}

.hero__text h1 {
  color: #ffffff;
  font-size: clamp(30px, 3.4vw, 48px);
  margin: 14px 0 18px;
  max-width: 560px;
}

.hero__lead {
  color: rgba(255,255,255,.75) !important;
  font-size: 1.08rem;
  max-width: 500px;
  margin: 0 !important;
  line-height: 1.7;
}

.hero__cta {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}

/* Botón primario en hero (blanco sobre azul) */
.hero__btn-primary {
  background: #ffffff !important;
  color: var(--accent) !important;
  font-weight: 700;
  border: none;
}
.hero__btn-primary:hover {
  background: rgba(255,255,255,.9) !important;
}

/* Botón fantasma blanco */
.btn--ghost-white {
  background: transparent;
  border: 1px solid rgba(255,255,255,.35);
  color: #ffffff;
  font-weight: 600;
}
.btn--ghost-white:hover {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.5);
}

/* Stats en el hero */
.hero__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 30px;
  max-width: 460px;
}

.hero__stat {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius-lg);
  padding: 10px 12px;
}
.hero__stat strong { display: block; color: #fff; font-size: .95rem; }
.hero__stat span   { display: block; color: rgba(255,255,255,.6); font-size: .82rem; margin-top: 3px; }

/* ── Mockup visual del hero ───────────────────────────────── */
.hero__visual {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Imagen real (cuando la pongas): */
.hero__img {
  width: 100%;
  max-width: 520px;
  height: auto;
  border-radius: 20px;
  box-shadow: 0 32px 80px rgba(0,0,0,.35);
  object-fit: cover;
}

.hero__mockup {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Animación flotante — desactivada con prefers-reduced-motion */
.hero__mockup {
  animation: heroFloat 7s ease-in-out infinite;
}
@keyframes heroFloat {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-10px); }
}
@media (prefers-reduced-motion: reduce) {
  .hero__mockup { animation: none; }
}

.mockup-card {
  background: rgba(255,255,255,.96);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.28), 0 4px 16px rgba(0,0,0,.12);
  color: var(--text);
}

.mockup-card--main { }

.mockup-card--sm {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  transform: translateX(20px);
}

.mockup-card--xs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--muted);
  transform: translateX(-12px);
}

.mockup-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.mockup-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(27,54,93,.10);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mockup-name {
  font-weight: 700;
  font-size: .88rem;
  color: var(--text);
  line-height: 1.2;
}

.mockup-course {
  font-size: .75rem;
  color: var(--muted);
  margin-top: 1px;
}

.mockup-live-badge {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .72rem;
  font-weight: 700;
  color: #dc2626;
  background: rgba(220,38,38,.08);
  border: 1px solid rgba(220,38,38,.18);
  border-radius: 999px;
  padding: 3px 8px;
  white-space: nowrap;
}

.mockup-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.mockup-dot--live {
  background: #dc2626;
  box-shadow: 0 0 0 3px rgba(220,38,38,.25);
  animation: dotPulse 1.5s ease-in-out infinite;
}
.mockup-dot--ok {
  background: #16a34a;
}

@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(220,38,38,.25); }
  50%       { box-shadow: 0 0 0 6px rgba(220,38,38,.08); }
}
@media (prefers-reduced-motion: reduce) {
  .mockup-dot--live { animation: none; }
}

.mockup-progress-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.mockup-prog-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  align-items: center;
}

.mockup-prog-label {
  font-size: .75rem;
  color: var(--muted);
  grid-column: 1;
}

.mockup-bar-wrap {
  grid-column: 1;
  height: 6px;
  background: rgba(27,54,93,.08);
  border-radius: 999px;
  overflow: hidden;
}

.mockup-bar {
  height: 100%;
  width: var(--w, 50%);
  background: var(--accent);
  border-radius: 999px;
  transition: width .6s ease;
}
.mockup-bar--green { background: var(--success); }

.mockup-pct {
  font-size: .75rem;
  font-weight: 700;
  color: var(--text);
  grid-row: 1 / 3;
  grid-column: 2;
  align-self: center;
}

.mockup-stats-row {
  display: flex;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.mockup-mini-stat {
  flex: 1;
  text-align: center;
}
.mockup-mini-stat strong {
  display: block;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.1;
}
.mockup-mini-stat span {
  font-size: .7rem;
  color: var(--muted);
  margin-top: 2px;
  display: block;
}

/* ── Hero responsive ──────────────────────────────────────── */
@media (max-width: 900px) {
  .hero__inner {
    grid-template-columns: 1fr;
    padding: 48px 20px 40px;
    gap: 36px;
  }
  .hero__visual {
    justify-content: center;
  }
  .hero__mockup {
    max-width: 420px;
    margin: 0 auto;
  }
  .hero__stats {
    grid-template-columns: repeat(3, 1fr);
    max-width: none;
  }
}

@media (max-width: 600px) {
  .hero__inner {
    padding: 36px 16px 32px;
    gap: 28px;
  }
  .hero__mockup {
    max-width: 100%;
  }
  .hero__stats {
    grid-template-columns: 1fr;
  }
  .hero__cta {
    flex-direction: column;
  }
  .hero__cta .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ── Cabecera de sección (section-head) ───────────────────── */
.section-head {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 32px;
}
.section-head p {
  margin-top: 10px;
}

/* Tamaño responsive de títulos de sección (alineado con hero/cta-final) */
.section-head h2,
.why__grid h2 {
  font-size: var(--fs-h2);
}

.section--tabs {
  padding-top: 48px;
  padding-bottom: 24px;
}
.section--tabs .tabs {
  margin-top: 24px;
}

/* ── Tarjetas con hover (clase añadida en el HTML) ─────────── */
.card--hover {
  transition: transform .22s ease, box-shadow .22s ease;
  cursor: default;
}
.card--hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(27,54,93,.11);
}
@media (prefers-reduced-motion: reduce) {
  .card--hover { transition: none; }
  .card--hover:hover { transform: none; box-shadow: none; }
}

/* ── Sección "Por qué elegirnos" ──────────────────────────── */
.why-section {
  padding-top: 52px;
  padding-bottom: 52px;
  background: var(--bg);
}

.why-head {
  text-align: center;
  max-width: 580px;
  margin: 0 auto 40px;
}
.why-head p { margin-top: 10px; }

.why-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.why-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 22px;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.why-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 36px rgba(27,54,93,.10);
  border-color: rgba(27,54,93,.22);
}
@media (prefers-reduced-motion: reduce) {
  .why-card { transition: none; }
  .why-card:hover { transform: none; box-shadow: none; }
}

.why-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(27,54,93,.08);
  color: var(--accent);
  margin-bottom: 14px;
}

.why-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text);
}
.why-card p {
  font-size: .9rem;
  line-height: 1.6;
  margin: 0;
}

@media (max-width: 900px) {
  .why-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 580px) {
  .why-grid { grid-template-columns: 1fr; gap: 14px; }
  .why-section { padding-top: 40px; padding-bottom: 40px; }
}

/* ── Sección CTA final ────────────────────────────────────── */
.cta-final {
  background: linear-gradient(145deg, #0c1d3a 0%, #1B365D 60%, #1e3f6e 100%);
  padding: 88px 24px;
  position: relative;
  overflow: hidden;
}

.cta-final::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 70% 50%, rgba(100,160,255,.07) 0%, transparent 55%);
  pointer-events: none;
}

.cta-final__inner {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}

.cta-final__badge {
  background: rgba(255,255,255,.12) !important;
  border-color: rgba(255,255,255,.22) !important;
  color: rgba(255,255,255,.9) !important;
}

.cta-final h2 {
  color: #ffffff;
  font-size: clamp(24px, 2.8vw, 40px);
  margin: 16px 0 0;
}

.cta-final p {
  color: rgba(255,255,255,.72) !important;
  font-size: 1.06rem;
  margin: 16px 0 0;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.cta-final__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 36px;
}

.cta-final__btn {
  background: #ffffff !important;
  color: var(--accent) !important;
  font-weight: 700;
  border: none;
}
.cta-final__btn:hover {
  background: rgba(255,255,255,.9) !important;
}

@media (max-width: 580px) {
  .cta-final {
    padding: 60px 20px;
  }
  .cta-final__actions {
    flex-direction: column;
    align-items: center;
  }
  .cta-final__actions .btn {
    width: 100%;
    max-width: 320px;
    justify-content: center;
  }
}

/* ── Footer mejorado ──────────────────────────────────────── */
.site-footer {
  background: var(--text);
  color: rgba(255,255,255,.55);
  padding: 40px 24px 28px;
}

.site-footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px 48px;
  align-items: start;
}

.site-footer__brand {
  grid-column: 1;
}
.site-footer__brand p {
  color: rgba(255,255,255,.45);
  font-size: .88rem;
  margin-top: 10px;
  max-width: 320px;
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: flex-start;
}
.site-footer__nav a {
  color: rgba(255,255,255,.55);
  font-size: .9rem;
  text-decoration: none;
  transition: color .15s ease;
}
.site-footer__nav a:hover {
  color: rgba(255,255,255,.9);
}

.site-footer__copy {
  grid-column: 1 / -1;
  font-size: .82rem;
  color: rgba(255,255,255,.32);
  margin: 8px 0 0;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.08);
}

@media (max-width: 640px) {
  .site-footer__inner {
    grid-template-columns: 1fr;
  }
  .site-footer__nav {
    gap: 8px 16px;
  }
}

/* ── Animación de aparición al hacer scroll (JS-driven) ────── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .5s ease, transform .5s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============================================================
   AJUSTES V2 — Header texto, tarjetas numeradas, why-split,
   trust panel, footer minimal.
   ============================================================ */

/* ── Marca textual en el header ───────────────────────────── */
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  gap: 0;
}
.brand-name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.2px;
}
.brand-tagline {
  font-size: .6rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 1px;
}

/* ── Tarjetas numeradas (Niveles e INE / Método) ───────────── */
.grid--levels {
  gap: 18px;
}

.level-card {
  position: relative;
  padding: 22px 20px 18px;
  border-top: 3px solid rgba(27,54,93,.15);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.level-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 40px rgba(27,54,93,.12);
  border-top-color: var(--accent);
}
@media (prefers-reduced-motion: reduce) {
  .level-card { transition: none; }
  .level-card:hover { transform: none; box-shadow: none; }
}

/* Variantes de color en el acento de borde superior */
.level-card--mid  { border-top-color: rgba(27,54,93,.3); }
.level-card--adv  { border-top-color: rgba(27,54,93,.5); }
.level-card--mid:hover  { border-top-color: var(--success); }
.level-card--adv:hover  { border-top-color: var(--accent); }

.level-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.level-num {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: rgba(27,54,93,.12);
  line-height: 1;
  letter-spacing: -1px;
  user-select: none;
}
.level-card:hover .level-num {
  color: rgba(27,54,93,.22);
}

.level-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text);
}
.level-card > p {
  font-size: .88rem;
  line-height: 1.6;
  margin: 0 0 14px;
  color: var(--muted);
}

/* Pills de etiqueta */
.level-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
}

.tag {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(27,54,93,.07);
  border: 1px solid rgba(27,54,93,.12);
  border-radius: 999px;
  padding: 3px 9px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* ── Sección "Por qué elegirnos" — layout 2 columnas ──────── */
.why-section {
  background: rgba(241,245,249,.7);
  padding: 64px 0;
}

.why-split {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 56px;
  align-items: start;
}

.why-split__text .badge { margin-bottom: 14px; }

.why-split__text h2 {
  font-size: clamp(22px, 2.4vw, 32px);
  color: var(--text);
  margin: 0 0 14px;
}

.why-split__lead {
  color: var(--muted) !important;
  font-size: .97rem;
  line-height: 1.7;
  max-width: 480px;
  margin: 0 0 28px !important;
}

/* Lista de features */
.why-features {
  list-style: none;
  margin: 0 0 32px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.why-feature {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.why-features li:first-child { border-top: 1px solid var(--border); }

.why-feature__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(27,54,93,.08);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.why-feature strong {
  display: block;
  font-size: .93rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}
.why-feature p {
  font-size: .85rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.why-cta { margin-top: 4px; }

/* Panel de confianza (derecha) */
.why-split__visual {
  position: sticky;
  top: 88px;
}

.trust-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(27,54,93,.10), 0 4px 12px rgba(27,54,93,.05);
}

.trust-panel__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px 12px;
  font-size: .84rem;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.trust-panel__capacity {
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--border);
}

.trust-bar-wrap {
  height: 6px;
  background: rgba(27,54,93,.08);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}
.trust-bar {
  height: 100%;
  width: var(--w, 50%);
  background: var(--accent);
  border-radius: 999px;
}
.trust-bar--green { background: var(--success); }

.trust-cap-label {
  font-size: .72rem;
  color: var(--success);
  font-weight: 600;
}

.trust-items {
  list-style: none;
  margin: 0;
  padding: 12px 0;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 20px;
  transition: background .12s;
}
.trust-item:hover { background: rgba(27,54,93,.03); }

.trust-item__icon {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(92,124,111,.10);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
}

.trust-item__label {
  display: block;
  font-size: .83rem;
  color: var(--text);
  font-weight: 500;
}
.trust-item__val {
  display: block;
  font-size: .74rem;
  color: var(--success);
  font-weight: 600;
  margin-top: 1px;
}

.trust-panel__next {
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border);
  background: rgba(27,54,93,.025);
}
.trust-next__label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.trust-next__course {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}
.trust-next__progress {
  font-size: .72rem;
  color: var(--muted);
  margin-top: 5px;
}

/* Responsive why-split */
@media (max-width: 960px) {
  .why-split {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .why-split__visual {
    position: static;
    max-width: 460px;
  }
}
@media (max-width: 600px) {
  .why-section { padding: 48px 0; }
  .why-split { padding: 0 16px; gap: 32px; }
}

/* ── Footer minimal: thin dark bar (full-bleed) ──────────────
   La regla original en línea ~3039 tiene max-width y margin:auto;
   hay que anularlos explícitamente para lograr ancho completo.   */
.site-footer {
  background: linear-gradient(180deg, #111827 0%, #0c0f18 100%) !important;
  border-top: 1px solid rgba(255,255,255,.07) !important;
  padding: 22px 40px !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}
.site-footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  flex-wrap: wrap;
  /* Elimina el grid del V1 */
  grid-template-columns: unset !important;
}
/* Oculta el bloque .brand del V1 si existiera */
.site-footer__brand { display: none !important; }

.site-footer__copy {
  font-size: .78rem;
  color: rgba(255,255,255,.3) !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  grid-column: unset !important;
}

.site-footer__nav {
  display: flex;
  gap: 4px 18px;
  flex-wrap: wrap;
}
.site-footer__nav a {
  font-size: .78rem;
  color: rgba(255,255,255,.3) !important;
  text-decoration: none;
  transition: color .15s;
}
.site-footer__nav a:hover {
  color: rgba(255,255,255,.7) !important;
}

@media (max-width: 600px) {
  .site-footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* ============================================================
   DS LANDING — Mockup card & why/feature layout
   ============================================================ */

/* ── Hero mockup (DS naming: .mockup__card / .mockup__float) ── */
.mockup { position: relative; }
.mockup__card {
  background: rgba(255,255,255,.96);
  border-radius: var(--radius-3xl);
  box-shadow: 0 24px 60px rgba(0,0,0,.28);
  padding: 18px;
  color: var(--text);
}

.mockup__float {
  position: absolute;
  background: rgba(255,255,255,.96);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 60px rgba(0,0,0,.28);
  padding: 10px 14px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-strong);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

/* ── Why section — DS layout ── */
.why {
  background: var(--surface-1, var(--bg));
  padding: 64px 0;
}

.why__grid {
  max-width: var(--container-max, var(--max));
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 48px;
  align-items: start;
}

@media (max-width: 900px) {
  .why__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .why {
    padding: 48px 0;
  }
  .why__grid {
    padding: 0 16px;
    gap: 32px;
  }
}

/* ── Feature list item ── */
.feature {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.feature:last-of-type {
  margin-bottom: 0;
}

/* .why-card is reused here only as the main.js scroll-reveal hook —
   scoped reset removes the boxed-card look so feature rows match the
   DS reference's plain icon+text rows instead of stacked cards. */
.why .why-card {
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  transition: none;
}
.why .why-card:hover {
  transform: none;
  box-shadow: none;
  border-color: transparent;
}

.feature__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--primary-tint-04);
  color: var(--color-primary);
}

/* ---------- Recording player (dark, standalone) ---------- */
.player-page{ background:#0d0d0d; color:#fff; min-height:100vh; display:flex; flex-direction:column; align-items:center; padding-top:4vh; margin:0; }
.player-title{ font-family:var(--font-body); font-size:clamp(16px,2vw,24px); font-weight:700; margin:0 0 4px; text-align:center; }
.player-date{ font-size:.82rem; color:rgba(255,255,255,.5); margin:0 0 14px; text-align:center; }
.player-stage{ width:min(92vw, calc((100vh - 120px) * 16 / 9)); aspect-ratio:16/9; background:#000; border-radius:var(--radius-lg,12px); overflow:hidden; display:flex; align-items:center; justify-content:center; color:rgba(255,255,255,.85); position:relative; }