/* ═════════════════════════════════════════════════════════════════════════
   Lazzo Bienestar Cliente · Lobby + Sala videoconsulta (C11)
   Servido desde public/js/features/bienestar/cliente/sala-lobby.css
   z-index 2000 → por encima de TODOS los overlays Bienestar
   (recordatorio toast=1500, calendario=1050, etc.).
   ═════════════════════════════════════════════════════════════════════════ */

.bnstr-sala-overlay {
  position: fixed;
  inset: 0;
  background: #0c0a1a;
  color: #fff;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: bnstrSalaIn 0.25s ease-out;
}
@keyframes bnstrSalaIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.bnstr-sala-pane {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* `display:flex` por defecto pisa `[hidden]` del UA stylesheet → forzamos
   display:none cuando el pane no está activo. Sin esto, _showPane(name)
   ponía hidden=true en el preflight pero seguía visible apilando con room. */
.bnstr-sala-pane[hidden] { display: none !important; }

/* ── Header común ──────────────────────────────────────────────────────── */
.bnstr-sala-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  flex-shrink: 0;
}
.bnstr-sala-h h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  font-family: var(--serif, 'DM Serif Display', serif);
}
.bnstr-sala-x {
  appearance: none;
  border: 0;
  background: rgba(255,255,255,0.05);
  color: inherit;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.bnstr-sala-x:hover { background: rgba(255,255,255,0.10); }
.bnstr-sala-x i[data-lucide] svg { width: 18px; height: 18px; }

/* Header en modo sala — botón "Salir" en rojo */
.bnstr-sala-h-room { background: rgba(220, 50, 50, 0.06); border-bottom-color: rgba(220, 50, 50, 0.18); }
.bnstr-sala-h-room .bnstr-sala-x {
  background: #dc3232;
  color: #fff;
  padding: 10px 16px;
  font-weight: 600;
}
.bnstr-sala-h-room .bnstr-sala-x:hover { background: #b82828; }

/* ── Pre-flight ────────────────────────────────────────────────────────── */
.bnstr-sala-pre-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
}

.bnstr-sala-preview {
  position: relative;
  width: 100%;
  max-width: 460px;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  overflow: hidden;
  background: #14122a;
  border: 1px solid rgba(255,255,255,0.08);
}
.bnstr-sala-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* efecto espejo */
}
.bnstr-sala-preview-msg {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 18px;
  color: rgba(255,255,255,0.65);
  font-size: 14px;
}
.bnstr-sala-preview-msg i[data-lucide] svg { width: 32px; height: 32px; opacity: 0.6; }

.bnstr-sala-checks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}
.bnstr-sala-checks li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  font-size: 13px;
  color: rgba(255,255,255,0.7);
}
.bnstr-sala-checks li i[data-lucide] svg { width: 16px; height: 16px; }
.bnstr-sala-checks li.ok    { background: rgba(58,166,118,0.18); color: #6cd99b; }
.bnstr-sala-checks li.ko    { background: rgba(220, 80, 80, 0.18); color: #ff9090; }

.bnstr-sala-hint {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  text-align: center;
  max-width: 440px;
  line-height: 1.5;
  margin: 0;
}

.bnstr-sala-entrar {
  appearance: none;
  border: 0;
  background: linear-gradient(135deg, #9b7fd4, #6c63b0);
  color: #fff;
  padding: 14px 28px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s;
  min-width: 220px;
  justify-content: center;
}
.bnstr-sala-entrar:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(155, 127, 212, 0.35);
}
.bnstr-sala-entrar:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.bnstr-sala-entrar.loading {
  position: relative;
  color: transparent;
}
.bnstr-sala-entrar.loading::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: bnstrSalaSpin 0.7s linear infinite;
}
@keyframes bnstrSalaSpin {
  to { transform: rotate(360deg); }
}

/* ── Sala iframe ───────────────────────────────────────────────────────── */
.bnstr-sala-room {
  background: #000;
}
.bnstr-sala-iframe {
  flex: 1 1 auto;
  width: 100%;
  border: 0;
  background: #000;
  min-height: 0;
}

/* ── Pane error ────────────────────────────────────────────────────────── */
.bnstr-sala-err {
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.bnstr-sala-err-card {
  max-width: 420px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.bnstr-sala-err-card i[data-lucide] svg {
  width: 48px;
  height: 48px;
  color: #f4956a;
}
.bnstr-sala-err-card h2 {
  margin: 0;
  font-family: var(--serif, 'DM Serif Display', serif);
  font-size: 22px;
}
.bnstr-sala-err-card p {
  margin: 0;
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  line-height: 1.5;
}

/* ── Responsive móvil ──────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .bnstr-sala-h h2 { font-size: 15px; }
  .bnstr-sala-pre-body { padding: 16px 14px; gap: 16px; }
  .bnstr-sala-preview { max-width: 100%; }
  .bnstr-sala-h-room .bnstr-sala-x-lbl { display: none; }
  .bnstr-sala-checks { gap: 8px; }
  .bnstr-sala-checks li { font-size: 12px; padding: 5px 10px; }
}

/* ── Capacitor / iOS safe-area ──────────────────────────────────────────── */
@supports (padding-top: env(safe-area-inset-top)) {
  .bnstr-sala-overlay { padding-top: env(safe-area-inset-top); }
  .bnstr-sala-h-room  { padding-bottom: env(safe-area-inset-bottom); }
}
