/* Demo pública de LAMBDA: barra de demostración, visita guiada con Nex y aviso de «no se guarda».
   Mismo lenguaje que la plataforma: Montserrat, blanco, borde fino gris, un solo azul para la acción principal. */
:root {
  --ld-azul: #2563eb;
  --ld-azul-osc: #1d4ed8;
  --ld-texto: #111827;
  --ld-texto-2: #4b5563;
  --ld-texto-3: #6b7280;
  --ld-borde: #e5e7eb;
  --ld-suave: #f8fafc;
  --ld-sombra: 0 18px 48px rgba(15, 23, 42, .16), 0 2px 6px rgba(15, 23, 42, .06);
}

/* Lo que la plataforma muestra la primera vez (novedades, primeros pasos) no aparece en la demo: lo cuenta Nex */
#novedades, .novedades-fondo, #primerUso { display: none !important; }

/* ---------- Nex (igual que siempre) ---------- */
.ld-nex {
  width: 42px; height: 42px; border-radius: 50%; position: relative; flex-shrink: 0;
  background: radial-gradient(circle at 35% 28%, #6ba5ff 0%, #3b82f6 45%, #16a34a 120%);
  box-shadow: 0 4px 14px rgba(37,99,235,.4), inset 0 -3px 7px rgba(0,0,0,.18), inset 0 2px 5px rgba(255,255,255,.4);
  animation: ldNexFlotar 3.2s ease-in-out infinite;
}
.ld-nex::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid rgba(59,130,246,.45); animation: ldNexHalo 2.8s ease-out infinite;
}
@keyframes ldNexHalo { 0% { transform: scale(.92); opacity: .7; } 70% { transform: scale(1.45); opacity: 0; } 100% { opacity: 0; } }
@keyframes ldNexFlotar { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.ld-nex .ojo {
  position: absolute; top: 15px; width: 6.5px; height: 9px; background: #fff; border-radius: 4px;
  box-shadow: 0 0 4px rgba(255,255,255,.6); animation: ldNexParpadeo 4.5s infinite;
}
.ld-nex .ojo.i { left: 11px; } .ld-nex .ojo.d { right: 11px; }
@keyframes ldNexParpadeo { 0%, 93%, 100% { transform: scaleY(1); } 96.5% { transform: scaleY(.12); } }
.ld-nex .boca {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  width: 13px; height: 6px; border-bottom: 2px solid rgba(255,255,255,.9); border-radius: 0 0 9px 9px;
}
.ld-nex--feliz { background: radial-gradient(circle at 35% 28%, #6ee7b7 0%, #16a34a 50%, #0891b2 120%); box-shadow: 0 4px 14px rgba(22,163,74,.42), inset 0 -3px 7px rgba(0,0,0,.18), inset 0 2px 5px rgba(255,255,255,.4); }
.ld-nex--feliz::after { border-color: rgba(22,163,74,.5); }
.ld-nex--feliz .boca { bottom: 8px; width: 16px; height: 8px; }
.ld-nex--chico { transform: scale(.76); animation: none; }
.ld-nex--chico::after { display: none; }
.ld-nex--grande { width: 64px; height: 64px; }
.ld-nex--grande .ojo { top: 22px; width: 9px; height: 13px; border-radius: 5px; }
.ld-nex--grande .ojo.i { left: 17px; } .ld-nex--grande .ojo.d { right: 17px; }
.ld-nex--grande .boca { bottom: 15px; width: 20px; height: 9px; border-bottom-width: 3px; }
.ld-nex-id { display: flex; flex-direction: column; line-height: 1.2; }
.ld-nex-id .nm { font-size: 14px; font-weight: 700; color: var(--ld-texto); }
.ld-nex-id .tg { font-size: 12px; font-weight: 500; color: var(--ld-texto-3); }
.ld-nex-id .tg b { color: var(--ld-azul); font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .ld-nex, .ld-nex::after, .ld-nex .ojo { animation: none; } }

/* ---------- Barra de la demostración ---------- */
.ld-barra {
  position: fixed; right: 20px; bottom: 20px; z-index: 9990;
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid var(--ld-borde); border-radius: 14px;
  padding: 8px 8px 8px 12px; box-shadow: 0 8px 24px rgba(15, 23, 42, .10);
  font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif; color: var(--ld-texto);
}
.ld-barra-texto { display: flex; flex-direction: column; line-height: 1.25; }
.ld-barra-texto strong { font-size: 13px; font-weight: 700; }
.ld-barra-texto span { font-size: 12px; color: var(--ld-texto-3); }
.ld-barra.oculta { display: none; }

.ld-boton {
  font: 600 13px/1 'Montserrat', 'Helvetica Neue', Arial, sans-serif; border-radius: 10px; padding: 11px 16px;
  border: 1px solid var(--ld-borde); background: #fff; color: var(--ld-texto); cursor: pointer; white-space: nowrap;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.ld-boton:hover { background: var(--ld-suave); }
.ld-boton:focus-visible { outline: 2px solid var(--ld-azul); outline-offset: 2px; }
.ld-boton--principal { background: var(--ld-azul); border-color: var(--ld-azul); color: #fff; }
.ld-boton--principal:hover { background: var(--ld-azul-osc); border-color: var(--ld-azul-osc); }
.ld-boton--texto { border-color: transparent; background: transparent; color: var(--ld-texto-2); padding-left: 10px; padding-right: 10px; }
.ld-boton--texto:hover { background: var(--ld-suave); color: var(--ld-texto); }
.ld-boton[disabled] { opacity: .4; cursor: default; }

/* ---------- Visita guiada ---------- */
.ld-velo { position: fixed; inset: 0; z-index: 9993; pointer-events: auto; }
.ld-velo.sin-foco { background: rgba(15, 23, 42, .45); }
.ld-foco {
  position: fixed; z-index: 9994; border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, .45), 0 0 0 2px #fff, 0 0 0 5px rgba(37, 99, 235, .55);
  transition: top .28s ease, left .28s ease, width .28s ease, height .28s ease;
}
.ld-tarjeta {
  position: fixed; z-index: 9995; width: 380px; max-width: calc(100vw - 32px);
  background: #fff; border: 1px solid var(--ld-borde); border-radius: 16px; box-shadow: var(--ld-sombra);
  padding: 20px 20px 16px; font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif; color: var(--ld-texto);
  transition: top .28s ease, left .28s ease, opacity .2s ease;
}
.ld-tarjeta.centro { width: 520px; }
.ld-tarjeta-cabeza { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.ld-tarjeta-quien { display: flex; align-items: center; gap: 10px; }
.ld-capitulo { font-size: 12px; font-weight: 600; color: var(--ld-texto-3); text-align: right; line-height: 1.3; }
.ld-capitulo b { display: block; color: var(--ld-texto); font-weight: 700; }
.ld-tarjeta h3 { font-size: 17px; font-weight: 700; line-height: 1.3; margin: 0 0 8px; color: var(--ld-texto); letter-spacing: -.01em; }
.ld-tarjeta p { font-size: 14px; line-height: 1.6; color: var(--ld-texto-2); margin: 0; }
.ld-tarjeta p + p { margin-top: 8px; }
.ld-tarjeta p b { color: var(--ld-texto); font-weight: 600; }
.ld-avance { height: 4px; background: #eef2f7; border-radius: 4px; margin: 16px 0 14px; overflow: hidden; }
.ld-avance i { display: block; height: 100%; background: var(--ld-azul); border-radius: 4px; transition: width .3s ease; }
.ld-tarjeta-pie { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ld-tarjeta-pie .der { display: flex; gap: 8px; }
.ld-teclas { font-size: 12px; color: var(--ld-texto-3); margin-top: 10px; text-align: right; }

/* Índice de capítulos */
.ld-indice { position: fixed; inset: 0; z-index: 9996; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15, 23, 42, .45); }
.ld-indice-caja {
  width: 560px; max-width: 100%; max-height: calc(100vh - 32px); overflow: auto;
  background: #fff; border: 1px solid var(--ld-borde); border-radius: 18px; box-shadow: var(--ld-sombra);
  padding: 24px; font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif; color: var(--ld-texto);
}
.ld-indice-caja h2 { font-size: 20px; font-weight: 700; margin: 14px 0 6px; letter-spacing: -.01em; }
.ld-indice-caja > p { font-size: 14px; color: var(--ld-texto-2); line-height: 1.55; margin: 0 0 18px; }
.ld-capitulos { list-style: none; margin: 0 0 20px; padding: 0; border: 1px solid var(--ld-borde); border-radius: 12px; overflow: hidden; }
.ld-capitulos li + li { border-top: 1px solid var(--ld-borde); }
.ld-capitulos button {
  width: 100%; display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center; text-align: left;
  background: #fff; border: 0; padding: 14px 16px; cursor: pointer; font-family: inherit; color: inherit;
}
.ld-capitulos button:hover { background: var(--ld-suave); }
.ld-capitulos button:focus-visible { outline: 2px solid var(--ld-azul); outline-offset: -2px; }
.ld-capitulos .n { font-size: 14px; font-weight: 700; color: var(--ld-texto-3); }
.ld-capitulos .t { font-size: 14px; font-weight: 600; }
.ld-capitulos .t small { display: block; font-size: 13px; font-weight: 400; color: var(--ld-texto-3); margin-top: 2px; line-height: 1.4; }
.ld-capitulos .d { font-size: 12px; color: var(--ld-texto-3); }
.ld-capitulos .hecho .n { color: var(--ld-azul); }
.ld-indice-pie { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

/* Aviso: en la demo no se guarda */
.ld-aviso {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 9998; opacity: 0;
  background: #fff; color: var(--ld-texto); border: 1px solid var(--ld-borde); border-left: 3px solid var(--ld-azul);
  border-radius: 12px; padding: 12px 18px; max-width: calc(100vw - 32px);
  font: 500 13px/1.45 'Montserrat', 'Helvetica Neue', Arial, sans-serif; box-shadow: var(--ld-sombra);
  transition: opacity .2s ease, transform .2s ease; pointer-events: none;
}
.ld-aviso.visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 720px) {
  .ld-barra { left: 12px; right: 12px; bottom: 12px; justify-content: space-between; }
  .ld-barra-texto span { display: none; }
  .ld-tarjeta, .ld-tarjeta.centro { left: 12px !important; right: 12px; top: auto !important; bottom: 12px; width: auto; max-height: 60vh; overflow: auto; }
  .ld-teclas { display: none; }
}
@media print { .ld-barra, .ld-velo, .ld-foco, .ld-tarjeta, .ld-indice, .ld-aviso { display: none !important; } }
