/* ============================================================================
   MÉTODO TBC · LMS · Design System
   Tokens canónicos de la marca The BIM Co-Work — no aproximar colores.
   ============================================================================ */
:root {
  --bg: #F5F2EC;
  --bg-card: #FFFFFF;
  --bg-dark: #111111;
  --fg: #111111;
  --fg-mid: #4A4A4A;
  --fg-soft: #8A8682;
  --line: #1A1A1A;
  --line-soft: #D9D5CD;
  --pink: #ED1B69;
  --pink-soft: #FBE2EC;
  --pink-tint: rgba(237, 27, 105, 0.06);
  --ok: #157A4B;
  --ok-soft: #E3F0E9;
  --warn: #C84A1F;
  --warn-soft: #F8E7DF;
  --code-bg: #0F0F10;
  --code-fg: #F4EFE6;
  --font: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', 'Menlo', monospace;
  --radius: 10px;
  --shadow-hard: 8px 8px 0 #111111;
  --shadow-mini: 4px 4px 0 #111111;
}

/* ---------- Reset & base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  min-height: 100vh;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; }

h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.15; }
h1 { font-size: 34px; font-weight: 900; }
h2 { font-size: 24px; font-weight: 800; }
h3 { font-size: 18px; font-weight: 800; }
.mono { font-family: var(--mono); }
.muted { color: var(--fg-mid); }
.soft { color: var(--fg-soft); }
.small { font-size: 14px; }

/* ---------- Topbar ---------- */
.topbar {
  background: var(--bg-dark);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 28px;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.tbc-mark {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  background: #fff;
  color: #000;
  border: 2.5px solid #000;
  padding: 5px 9px;
  font-weight: 900;
  line-height: 1.0;
  font-size: 11px;
  box-shadow: 3px 3px 0 rgba(255,255,255,0.35);
  text-decoration: none;
  letter-spacing: 0;
}
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a {
  color: #cfcbc4;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 12px;
  border-radius: 4px;
}
.topbar nav a:hover { color: #fff; background: rgba(255,255,255,0.08); }
.topbar nav a.activo { color: #fff; box-shadow: inset 0 -3px 0 var(--pink); border-radius: 0; }
.topbar .usuario {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 14px;
}
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--pink);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  flex: none;
}
.campana { position: relative; background: none; border: 0; color: #cfcbc4; font-size: 18px; padding: 6px; }
.campana:hover { color: #fff; }
.campana .punto {
  position: absolute; top: 2px; right: 0;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--pink); border: 2px solid var(--bg-dark);
}

/* ---------- Layout ---------- */
.contenedor { max-width: 1180px; margin: 0 auto; padding: 36px 28px 80px; }
.fila { display: flex; gap: 20px; align-items: center; }
.fila.sep { justify-content: space-between; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .contenedor { padding: 24px 16px 60px; } }

/* ---------- Eyebrow ---------- */
.eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pink);
  margin-bottom: 10px;
}
.eyebrow.negro { color: var(--fg); }
.hr-pink { width: 56px; height: 4px; background: var(--pink); border: 0; margin: 14px 0 22px; }

/* ---------- Chips ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 26px;
  padding: 0 10px;
  background: #111;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  border-radius: 4px;
  text-transform: uppercase;
}
.chip-pink { background: var(--pink); }
.chip-outline { background: transparent; color: var(--fg); border: 1.5px solid var(--fg); }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}
.card-shadow { box-shadow: var(--shadow-hard); }
.card.bloqueada { opacity: 0.55; background: transparent; border-style: dashed; }
.card h3 { margin-bottom: 6px; }
.card .pie { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--fg);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 12px 22px;
  border-radius: 4px;
  border: 1.5px solid var(--fg);
  text-decoration: none;
  transition: transform 0.06s ease;
}
.btn:hover { transform: translate(-1px, -1px); }
.btn:active { transform: translate(1px, 1px); }
.btn-pink { background: var(--pink); border-color: var(--pink); }
.btn-outline { background: transparent; color: var(--fg); }
.btn-outline:hover { background: var(--pink-tint); }
.btn-dark { background: var(--bg-dark); }
.btn[disabled], .btn.off { opacity: 0.45; pointer-events: none; }
.btn-mini { padding: 7px 14px; font-size: 11px; }

/* ---------- Badges de estado ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 4px;
}
.badge-ok   { background: var(--ok-soft);   color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-pend { background: #EFEBE3; color: var(--fg-mid); }
.badge-rev  { background: var(--pink-soft); color: var(--pink); }

/* ---------- Progress ---------- */
.progress {
  height: 8px;
  background: #E8E4DB;
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill { height: 100%; background: var(--pink); border-radius: 99px; transition: width 0.4s ease; }
.progress.gris .progress-fill { background: var(--fg); }

/* ---------- Step (paso numerado) ---------- */
.step { display: grid; grid-template-columns: 52px 1fr; gap: 16px; align-items: start; }
.step .n {
  width: 52px; height: 52px;
  background: var(--pink);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

/* ---------- Tablas ---------- */
.table-tbc { width: 100%; border-collapse: collapse; background: var(--bg-card); border: 1.5px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table-tbc th {
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-mid);
  padding: 12px 16px;
  border-bottom: 1.5px solid var(--line);
  background: #FAF8F3;
}
.table-tbc td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); font-size: 15px; vertical-align: middle; }
.table-tbc tr:last-child td { border-bottom: 0; }
.table-tbc tbody tr:hover { background: var(--pink-tint); }
.tabla-envoltura { border-radius: var(--radius); overflow: auto; }

/* ---------- Formularios ---------- */
.field { margin-bottom: 18px; }
.label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-mid);
  margin-bottom: 7px;
}
.input, select.input, textarea.input {
  width: 100%;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  padding: 11px 14px;
  font-size: 15px;
  color: var(--fg);
}
.input:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px var(--pink-tint); }
textarea.input { min-height: 110px; resize: vertical; }
.ayuda { font-size: 13px; color: var(--fg-soft); margin-top: 5px; }
.error-msg { color: var(--warn); font-size: 14px; font-weight: 600; }

/* ---------- Flash / Toast ---------- */
.flash {
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 13px 16px;
  margin-bottom: 18px;
  font-size: 14px;
  font-weight: 600;
  background: #fff;
}
.flash-ok { border-color: var(--ok); color: var(--ok); background: var(--ok-soft); }
.flash-error { border-color: var(--warn); color: var(--warn); background: var(--warn-soft); }
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-dark);
  color: #fff;
  padding: 12px 22px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-mini);
  z-index: 200;
  animation: subir 0.25s ease;
}
@keyframes subir { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Modal ---------- */
.modal-fondo {
  position: fixed; inset: 0;
  background: rgba(17,17,17,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 150;
  padding: 20px;
}
.modal {
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  max-width: 560px;
  width: 100%;
  max-height: 88vh;
  overflow: auto;
  padding: 28px;
}

/* ---------- Candado / bloqueo ---------- */
.lock {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-soft);
}

/* ---------- Nota mega (libreta) ---------- */
.nota-mega {
  font-size: 56px;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
}
.nota-ok { color: var(--ok); }
.nota-mal { color: var(--warn); }

/* ---------- Login ---------- */
.login-página {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.login-marca {
  background: var(--bg-dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 56px;
}
.login-marca .titulo { font-size: 44px; font-weight: 900; letter-spacing: -0.03em; line-height: 1.05; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-form .card { width: 100%; max-width: 420px; }
@media (max-width: 860px) { .login-página { grid-template-columns: 1fr; } .login-marca { padding: 36px; } }
.login-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.login-volver { color: var(--fg-soft); font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none; transition: color 0.15s; white-space: nowrap; }
.login-volver:hover { color: #fff; }
.login-card { max-width: 440px; border-radius: 14px; box-shadow: 0 24px 60px -32px rgba(20,16,8,0.45); }
.login-passwrap { position: relative; display: flex; align-items: center; }
.login-passwrap .input { padding-right: 70px; }
.login-ver { position: absolute; right: 8px; background: none; border: 0; cursor: pointer; color: var(--fg-soft); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 8px; transition: color 0.15s; }
.login-ver:hover { color: var(--pink); }
.login-olvido { display: flex; justify-content: flex-end; margin-top: 8px; }
.login-olvido a { font-size: 12.5px; color: var(--fg-soft); text-decoration: none; transition: color 0.15s; }
.login-olvido a:hover { color: var(--pink); }
.login-sep { display: flex; align-items: center; gap: 14px; margin: 26px 0 18px; font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-soft); }
.login-sep::before, .login-sep::after { content: ""; height: 1px; background: var(--line-soft); flex: 1; }
.field.invalid .input { border-color: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }

/* ---------- Portal del estudiante ---------- */
.portal-accion { width: 100%; justify-content: flex-start; margin-bottom: 10px; }
.portal-accion:last-of-type { margin-bottom: 0; }

/* ---------- Dashboard de módulos ---------- */
.mod-num {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--fg-soft);
  letter-spacing: 0.1em;
}
.kpi { font-size: 40px; font-weight: 900; letter-spacing: -0.03em; line-height: 1; }
.kpi-label { font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-mid); margin-top: 6px; }

/* ---------- Lista de lecciones ---------- */
.leccion-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  text-decoration: none;
  margin-bottom: 12px;
  transition: transform 0.06s ease;
}
.leccion-item:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow-mini); }
.leccion-item.bloqueada { opacity: 0.5; border-style: dashed; pointer-events: none; background: transparent; }
.leccion-item .num {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 14px;
  color: var(--fg-soft);
  min-width: 36px;
}

/* ---------- Visor de slides ---------- */
.visor {
  background: var(--bg-dark);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  user-select: none;
}
.visor .lienzo { position: relative; width: 100%; aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; }
.visor .lienzo img { width: 100%; height: 100%; object-fit: contain; }
.visor .flecha {
  position: absolute;
  top: 0; bottom: 0;
  width: 18%;
  background: none;
  border: 0;
  color: transparent;
  font-size: 34px;
  z-index: 5;
}
.visor .flecha:hover { color: rgba(255,255,255,0.8); }
.visor .flecha.izq { left: 0; }
.visor .flecha.der { right: 0; }
.visor .barra {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #0B0B0B;
  color: #cfcbc4;
  padding: 10px 16px;
  font-size: 13px;
  font-family: var(--mono);
}
.visor .barra .progress { flex: 1; background: #2A2A2A; }
.visor .barra button { background: none; border: 0; color: #cfcbc4; font-size: 16px; padding: 4px 8px; }
.visor .barra button:hover { color: #fff; }
.visor-indice {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.visor-indice img {
  border: 1.5px solid var(--line-soft);
  border-radius: 6px;
  cursor: pointer;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.visor-indice img.actual { border-color: var(--pink); box-shadow: 0 0 0 2px var(--pink-soft); }
.visor:fullscreen { border-radius: 0; display: flex; flex-direction: column; }
.visor:fullscreen .lienzo { flex: 1; aspect-ratio: auto; }

/* ---------- Quiz ---------- */
.quiz-opcion {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 12px;
  cursor: pointer;
  font-size: 15px;
}
.quiz-opcion:hover { background: var(--pink-tint); }
.quiz-opcion.elegida { border-color: var(--pink); background: var(--pink-soft); }
.quiz-opcion.correcta { border-color: var(--ok); background: var(--ok-soft); }
.quiz-opcion.incorrecta { border-color: var(--warn); background: var(--warn-soft); }
.quiz-opcion input { margin-top: 3px; accent-color: var(--pink); }

/* ---------- Rúbrica (instructor) ---------- */
.rubrica-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 14px;
  border: 1.5px solid var(--line-soft);
  border-radius: 8px;
  margin-bottom: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
}
.rubrica-item input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--pink); }
.rubrica-item.marcado { border-color: var(--ok); background: var(--ok-soft); }
.escala-ref { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--fg-mid); }
.escala-ref b { font-size: 16px; color: var(--fg); }

/* ---------- Código / mono block ---------- */
.code {
  font-family: var(--mono);
  background: var(--code-bg);
  color: var(--code-fg);
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 13.5px;
  overflow: auto;
}

/* ---------- Footer ---------- */
.pie-pagina {
  border-top: 1px solid var(--line-soft);
  color: var(--fg-soft);
  font-size: 13px;
  padding: 22px 28px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.pie-pagina .mono { font-size: 12px; }

/* ---------- Portada / Cover del Campus Virtual ---------- */
.portada {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--bg-dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: clamp(28px, 4vw, 56px);
  overflow: hidden;
}
/* marco fino tipo lámina A1 */
.portada::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  pointer-events: none;
}
/* acento magenta vertical */
.portada::after {
  content: "";
  position: absolute;
  top: 18px; bottom: 18px; left: 18px;
  width: 6px;
  background: var(--pink);
}
.portada > * { position: relative; z-index: 1; }
.portada-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.portada-top .tbc-mark { font-size: 12px; padding: 7px 11px; box-shadow: 4px 4px 0 rgba(255, 255, 255, 0.28); }
.portada-url { color: var(--fg-soft); font-size: 13px; }
.portada-centro {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 1000px;
  padding: 24px clamp(8px, 3vw, 48px);
}
.portada h1 {
  font-size: clamp(46px, 8.5vw, 124px);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 0.94;
}
.portada h1 .campus { display: block; color: var(--pink); }
.portada-lead {
  color: #B9B5AE;
  font-size: clamp(16px, 1.6vw, 21px);
  line-height: 1.5;
  max-width: 520px;
  margin: 28px 0 38px;
}
.portada-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.portada .btn-grande { padding: 16px 30px; font-size: 14px; }
.portada-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  color: var(--fg-soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.portada-foot .mono { font-weight: 400; letter-spacing: 0.04em; text-transform: none; }
.btn-outline.blanco { background: transparent; color: #fff; border-color: #fff; }
.btn-outline.blanco:hover { background: rgba(255, 255, 255, 0.1); }
@media (max-width: 620px) {
  .portada::before { inset: 10px; }
  .portada::after { top: 10px; bottom: 10px; left: 10px; }
  .portada-centro { padding: 16px 4px; }
}

/* ===== VISOR + QUIZ (añadido) ===== */
/* Panel índice del visor: rejilla de números para saltar de lámina */
.visor .panel-indice {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(17, 17, 17, 0.94);
  overflow: auto;
  padding: 26px;
}
.visor .panel-indice .rejilla {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(62px, 1fr));
  gap: 10px;
}
.visor .panel-indice button.salto {
  background: transparent;
  border: 1.5px solid #4A4A4A;
  color: #cfcbc4;
  border-radius: 6px;
  padding: 12px 0;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
}
.visor .panel-indice button.salto:hover { border-color: #fff; color: #fff; }
.visor .panel-indice button.salto.actual { border-color: var(--pink); background: var(--pink); color: #fff; }

/* Overlay de lección completada */
.visor .visor-fin {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(17, 17, 17, 0.94);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 28px;
}
.visor .visor-fin h2 { color: #fff; }
.visor .visor-fin p { color: #cfcbc4; max-width: 420px; font-size: 15px; }
.visor .visor-fin .acciones { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.visor .visor-fin .btn-outline.blanco { color: #fff; border-color: #fff; }
.visor .visor-fin .btn-outline.blanco:hover { background: rgba(255, 255, 255, 0.08); }
.visor .visor-fin button.cerrar {
  background: none;
  border: 0;
  color: #8A8682;
  font-size: 13px;
  text-decoration: underline;
  margin-top: 10px;
}
.visor .visor-fin button.cerrar:hover { color: #fff; }
