/* ==========================================================================
   Meet — hoja de estilos
   Tema oscuro sobrio (el vídeo es el protagonista), acento azul cobalto.
   ========================================================================== */
:root {
  --fondo: #0b0d12;
  --fondo-2: #11141b;
  --superficie: #161a23;
  --superficie-2: #1d2230;
  --borde: #262c3a;
  --texto: #e8ebf2;
  --tenue: #8d96a8;
  --acento: #5b8cff;
  --acento-2: #3f6fe6;
  --acento-suave: rgba(91, 140, 255, .14);
  --ok: #3ecf8e;
  --aviso: #f5b84b;
  --peligro: #f0545c;
  --peligro-2: #d8424a;
  --radio: 14px;
  --radio-g: 20px;
  --sombra: 0 12px 40px rgba(0, 0, 0, .45);
  --fuente: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --seguro-abajo: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--fondo); color: var(--texto); font-family: var(--fuente);
  font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
a { color: var(--acento); text-decoration: none; } a:hover { text-decoration: underline; }
svg { width: 22px; height: 22px; flex: none; }
h1, h2 { letter-spacing: -.02em; line-height: 1.15; }
.tenue { color: var(--tenue); }

/* ---------------------------------------------------------------- comunes */
.cabecera { display: flex; align-items: center; gap: 14px; padding: 18px 28px; }
.marca { display: inline-flex; align-items: center; gap: 10px; color: var(--texto); font-weight: 650; font-size: 17px; letter-spacing: -.01em; }
.marca:hover { text-decoration: none; }
.logo { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, #7aa2ff, #3f6fe6 55%, #2a4fb8); position: relative; box-shadow: 0 4px 14px rgba(63, 111, 230, .45); }
.logo::after { content: ""; position: absolute; inset: 9px 11px 9px 8px; border-radius: 3px; background: #fff; clip-path: polygon(0 0, 70% 0, 70% 30%, 100% 10%, 100% 90%, 70% 70%, 70% 100%, 0 100%); }
.chip-sala { font: 500 13px ui-monospace, "SF Mono", Consolas, monospace; color: var(--tenue); background: var(--superficie); border: 1px solid var(--borde); padding: 4px 10px; border-radius: 999px; }

.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 15px var(--fuente);
  color: var(--texto); background: var(--superficie-2); border: 1px solid var(--borde); padding: 12px 20px;
  border-radius: 12px; cursor: pointer; transition: background .15s, border-color .15s, transform .05s; text-decoration: none;
}
.boton:hover { background: #242a3a; text-decoration: none; }
.boton:active { transform: translateY(1px); }
.boton.primario { background: var(--acento); border-color: var(--acento); color: #fff; }
.boton.primario:hover { background: var(--acento-2); }
.boton.fantasma { background: transparent; border-color: transparent; color: var(--acento); }
.boton.fantasma:hover { background: var(--acento-suave); }
.boton.ancho { width: 100%; }
.boton:disabled { opacity: .55; cursor: default; }
.boton svg { width: 18px; height: 18px; }

input, select {
  font: 15px var(--fuente); color: var(--texto); background: var(--fondo-2); border: 1px solid var(--borde);
  border-radius: 11px; padding: 11px 13px; width: 100%; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { border-color: var(--acento); box-shadow: 0 0 0 3px var(--acento-suave); }
.campo { display: grid; gap: 6px; font-size: 13px; color: var(--tenue); font-weight: 500; }
.tarjeta { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio-g); padding: 24px; }
.error-mensaje { color: var(--peligro); font-size: 14px; }

/* ---------------------------------------------------------------- pruebas de red */
.pruebas-red { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.pruebas-red li { display: flex; align-items: center; gap: 10px; background: var(--fondo-2); border: 1px solid var(--borde); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; }
.pruebas-red li b { display: block; font-weight: 600; }
.pruebas-red li small { color: var(--tenue); }
.pruebas-red .punto { width: 10px; height: 10px; border-radius: 50%; background: var(--tenue); flex: none; }
.pruebas-red .ok .punto { background: var(--ok); box-shadow: 0 0 0 4px rgba(62, 207, 142, .15); }
.pruebas-red .ko .punto { background: var(--peligro); }
.pruebas-red .probando .punto { background: var(--aviso); animation: latido 1s infinite; }
.pruebas-red.compacta { grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.pruebas-red.compacta li { padding: 7px 8px; font-size: 12px; gap: 7px; }
.pruebas-red.compacta small { display: none; }
@keyframes latido { 50% { opacity: .35; } }
.resumen-red { margin: 14px 0 0; font-size: 14px; color: var(--tenue); }
.resumen-red.ok { color: var(--ok); } .resumen-red.aviso { color: var(--aviso); } .resumen-red.ko { color: var(--peligro); }

/* ---------------------------------------------------------------- inicio */
.pagina-inicio { background: radial-gradient(1200px 600px at 75% -10%, rgba(91, 140, 255, .16), transparent 60%), radial-gradient(900px 500px at -10% 20%, rgba(62, 207, 142, .07), transparent 60%), var(--fondo); }
.inicio { max-width: 1060px; margin: 0 auto; padding: 24px 28px 40px; display: grid; gap: 44px; }
.hero { padding-top: 6vh; max-width: 720px; }
.antetitulo { color: var(--acento); font-weight: 600; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 14px; }
.hero h1 { font-size: clamp(32px, 5.2vw, 54px); margin: 0 0 18px; font-weight: 700; }
.entradilla { font-size: 18px; color: var(--tenue); margin: 0 0 30px; max-width: 600px; }
.crear { display: flex; gap: 10px; flex-wrap: wrap; }
.campo-sala { flex: 1 1 340px; display: flex; align-items: center; background: var(--fondo-2); border: 1px solid var(--borde); border-radius: 12px; padding-left: 14px; transition: border-color .15s, box-shadow .15s; }
.campo-sala:focus-within { border-color: var(--acento); box-shadow: 0 0 0 3px var(--acento-suave); }
.campo-sala .prefijo { color: var(--tenue); font: 14px ui-monospace, Consolas, monospace; white-space: nowrap; }
.campo-sala input { border: 0; background: transparent; box-shadow: none; padding-left: 2px; font: 15px ui-monospace, Consolas, monospace; }
.nota { color: var(--tenue); font-size: 14px; margin-top: 14px; }
.ventajas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ventajas article { background: rgba(22, 26, 35, .7); border: 1px solid var(--borde); border-radius: var(--radio-g); padding: 22px; }
.ventajas svg { color: var(--acento); width: 26px; height: 26px; }
.ventajas h2 { font-size: 16px; margin: 12px 0 6px; }
.ventajas p { margin: 0; color: var(--tenue); font-size: 14px; }
.comprobacion-cab { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.comprobacion-cab h2 { margin: 0 0 4px; font-size: 18px; } .comprobacion-cab p { margin: 0; }
.pie { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 20px 28px 28px; font-size: 13px; max-width: 1060px; margin: 0 auto; }

/* ---------------------------------------------------------------- sala de espera */
.espera { min-height: 100%; display: flex; flex-direction: column; }
.espera-cuerpo { flex: 1; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 40px; align-items: center; max-width: 1180px; width: 100%; margin: 0 auto; padding: 10px 28px 40px; }
.vista-previa { position: relative; aspect-ratio: 16 / 9; background: #05070b; border-radius: var(--radio-g); overflow: hidden; border: 1px solid var(--borde); box-shadow: var(--sombra); }
.vista-previa video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.controles-previa { position: absolute; left: 0; right: 0; bottom: 16px; display: flex; justify-content: center; gap: 12px; }
.medidor { position: absolute; top: 14px; left: 14px; width: 6px; height: 46px; border-radius: 4px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.medidor span { position: absolute; bottom: 0; left: 0; right: 0; height: 0; background: var(--ok); transition: height .08s linear; }
.panel-unirse h1 { font-size: 30px; margin: 0 0 6px; font-weight: 650; }
.panel-unirse { display: grid; gap: 14px; }
.panel-unirse > p { margin: 0 0 6px; }
.dispositivos { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--borde); border-radius: var(--radio); background: var(--fondo-2); }
.estado-red { margin-top: 8px; padding: 14px; border-radius: var(--radio); background: var(--superficie); border: 1px solid var(--borde); }
.estado-red-titulo { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; }
.estado-red-titulo svg { width: 18px; height: 18px; color: var(--acento); }

.redondo {
  width: 52px; height: 52px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .14); cursor: pointer;
  background: rgba(30, 35, 48, .72); color: #fff; display: grid; place-items: center; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: background .15s;
}
.redondo:hover { background: rgba(46, 53, 72, .85); }
.redondo[aria-pressed="false"] { background: var(--peligro); border-color: var(--peligro); }
.redondo.pequeno { width: 34px; height: 34px; } .redondo.pequeno svg { width: 18px; height: 18px; }

.sin-camara { position: absolute; inset: 0; display: none; place-items: center; align-content: center; justify-items: center; gap: 10px; background: radial-gradient(circle at 50% 40%, #1b2130, #0d1016 70%); color: var(--tenue); }
.sin-camara p { margin: 0; font-size: 14px; }
.camara-apagada .sin-camara { display: grid; }
.avatar { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; font-weight: 650; font-size: 28px; color: #fff; background: var(--avatar, #3f6fe6); text-transform: uppercase; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); }
.avatar.grande { width: 96px; height: 96px; font-size: 38px; }

/* ---------------------------------------------------------------- llamada */
.llamada { position: fixed; inset: 0; display: grid; grid-template-rows: auto 1fr auto; background: var(--fondo); }
.barra-superior { display: flex; align-items: center; gap: 12px; padding: 12px 18px; font-size: 13px; }
.aviso-conexion { color: var(--aviso); font-weight: 600; }
.escenario { position: relative; display: flex; min-height: 0; padding: 0 14px; gap: 14px; }
.rejilla { flex: 1; min-width: 0; display: grid; gap: 10px; align-content: center; justify-content: center; grid-template-columns: repeat(var(--col, 1), minmax(0, 1fr)); grid-auto-rows: var(--alto, auto); }
.rejilla[data-n="1"] { --col: 1; }
.rejilla[data-n="2"] { --col: 2; }
.rejilla[data-n="3"], .rejilla[data-n="4"] { --col: 2; }
.rejilla[data-n="5"], .rejilla[data-n="6"] { --col: 3; }
.rejilla[data-n="7"], .rejilla[data-n="8"], .rejilla[data-n="9"] { --col: 3; }
.tile { position: relative; background: #05070b; border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 9; max-height: calc(100dvh - 170px); width: 100%; border: 2px solid transparent; transition: border-color .15s; }
.rejilla[data-n="1"] .tile { max-width: min(100%, calc((100dvh - 170px) * 16 / 9)); margin: 0 auto; }
.tile video { width: 100%; height: 100%; object-fit: cover; background: #05070b; }
.tile.local video { transform: scaleX(-1); }
.tile.pantalla video, .tile.local.pantalla video { object-fit: contain; transform: none; }
.tile.hablando { border-color: var(--ok); }
.tile-pie { position: absolute; left: 10px; bottom: 10px; right: 10px; display: flex; align-items: center; gap: 6px; pointer-events: none; }
.tile-nombre { background: rgba(10, 12, 18, .66); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: 3px 10px; border-radius: 8px; font-size: 13px; font-weight: 500; max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-mic { display: none; background: var(--peligro); border-radius: 8px; padding: 3px; } .tile-mic svg { width: 16px; height: 16px; display: block; }
.tile.mic-apagado .tile-mic { display: inline-block; }
.tile-red { margin-left: auto; font-size: 11px; color: var(--tenue); background: rgba(10, 12, 18, .66); padding: 2px 8px; border-radius: 8px; }
.tile-red:empty { display: none; }
.tile-mano { position: absolute; top: 10px; left: 10px; display: none; background: var(--aviso); color: #1b1300; border-radius: 10px; padding: 5px; }
.tile-mano svg { display: block; width: 20px; height: 20px; }
.tile.mano .tile-mano { display: block; animation: saludo 1.2s ease-in-out 2; }
@keyframes saludo { 25% { transform: rotate(-14deg); } 75% { transform: rotate(14deg); } }
.tile.conectando::after { content: "Conectando…"; position: absolute; top: 10px; right: 10px; font-size: 12px; color: var(--aviso); background: rgba(10, 12, 18, .7); padding: 3px 9px; border-radius: 8px; }
.tile.destacado { grid-column: 1 / -1; }

/* panel lateral */
.panel-lateral { width: 340px; flex: none; background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio-g); display: flex; flex-direction: column; overflow: hidden; }
.panel-cab { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 10px 12px; border-bottom: 1px solid var(--borde); }
.pestanas { display: flex; gap: 4px; }
.pestanas button { font: 600 14px var(--fuente); color: var(--tenue); background: none; border: 0; padding: 8px 12px; border-radius: 10px; cursor: pointer; }
.pestanas button[aria-selected="true"] { color: var(--texto); background: var(--superficie-2); }
.panel-chat { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.mensajes { list-style: none; margin: 0; padding: 14px; flex: 1; overflow-y: auto; display: grid; gap: 12px; align-content: start; }
.mensajes li { font-size: 14px; }
.mensajes .autor { font-weight: 600; font-size: 13px; } .mensajes .hora { color: var(--tenue); font-size: 11px; margin-left: 6px; }
.mensajes .texto { margin-top: 2px; white-space: pre-wrap; word-break: break-word; }
.mensajes .sistema { color: var(--tenue); font-size: 12.5px; text-align: center; }
.enviar { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--borde); }
.enviar .boton { padding: 10px 14px; }
.panel-gente { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
.panel-gente li { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; }
.panel-gente .avatar { width: 36px; height: 36px; font-size: 15px; box-shadow: none; }
.panel-gente .iconos { margin-left: auto; display: flex; gap: 6px; color: var(--tenue); }
.panel-gente .iconos svg { width: 18px; height: 18px; }

/* barra de controles */
.barra-controles { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px calc(14px + var(--seguro-abajo)); }
.grupo { display: flex; gap: 8px; }
.control {
  position: relative; display: grid; justify-items: center; gap: 3px; min-width: 64px; padding: 9px 10px 7px; cursor: pointer;
  background: var(--superficie-2); color: var(--texto); border: 1px solid var(--borde); border-radius: 14px; font: 500 11.5px var(--fuente); transition: background .15s;
}
.control:hover { background: #262d3e; }
#btnMic[aria-pressed="false"], #btnCam[aria-pressed="false"] { background: rgba(240, 84, 92, .16); border-color: rgba(240, 84, 92, .5); color: #ffb3b7; }
.control.activo, .control[aria-pressed="true"]#btnMano { background: var(--acento-suave); border-color: var(--acento); color: #cfdcff; }
.control.colgar { background: var(--peligro); border-color: var(--peligro); color: #fff; min-width: 76px; }
.control.colgar:hover { background: var(--peligro-2); }
.insignia { position: absolute; top: 6px; right: 14px; width: 9px; height: 9px; background: var(--acento); border-radius: 50%; border: 2px solid var(--superficie-2); }

/* fin */
.fin { min-height: 100%; display: grid; place-content: center; text-align: center; padding: 24px; gap: 8px; }
.fin h1 { font-size: 30px; margin: 0; }
.fila-botones { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }

.aviso-flotante { position: fixed; left: 50%; bottom: calc(100px + var(--seguro-abajo)); transform: translateX(-50%); background: #f1f3f8; color: #10131a; padding: 10px 16px; border-radius: 12px; font-weight: 500; font-size: 14px; box-shadow: var(--sombra); z-index: 50; max-width: calc(100% - 32px); text-align: center; }

/* ---------------------------------------------------------------- móvil */
@media (max-width: 900px) {
  .espera-cuerpo { grid-template-columns: 1fr; gap: 22px; padding: 4px 16px 28px; }
  .ventajas { grid-template-columns: 1fr; }
  .panel-lateral { position: absolute; inset: 0 0 0 0; width: auto; z-index: 20; border-radius: 0; border: 0; }
}
@media (max-width: 640px) {
  .cabecera { padding: 14px 16px; }
  .inicio { padding: 8px 16px 28px; gap: 32px; }
  .hero { padding-top: 2vh; }
  .entradilla { font-size: 16px; }
  .crear .boton { width: 100%; }
  .comprobacion-cab { flex-direction: column; align-items: stretch; }
  .tarjeta { padding: 18px; }
  .pie { padding: 16px; flex-direction: column; }
  .vista-previa { aspect-ratio: auto; width: 100%; height: min(52dvh, 440px); }
  .sin-camara p { padding: 0 20px; text-align: center; }
  .escenario { padding: 0 8px; }
  .rejilla { gap: 6px; }
  .rejilla[data-n="2"] { --col: 1; }
  .rejilla[data-n="3"], .rejilla[data-n="4"] { --col: 2; }
  .rejilla[data-n="5"], .rejilla[data-n="6"], .rejilla[data-n="7"], .rejilla[data-n="8"], .rejilla[data-n="9"] { --col: 2; }
  .tile { aspect-ratio: auto; height: 100%; min-height: 0; max-height: none; border-radius: 12px; }
  .rejilla { align-content: stretch; grid-auto-rows: 1fr; }
  .rejilla[data-n="1"] .tile { max-width: none; }
  .barra-controles { padding: 8px 8px calc(10px + var(--seguro-abajo)); gap: 4px; }
  .grupo { gap: 4px; }
  .control { min-width: 0; width: 46px; height: 46px; padding: 0; place-content: center; border-radius: 50%; }
  .control span { display: none; }
  .control.colgar { min-width: 0; width: 56px; border-radius: 28px; }
  .insignia { top: 2px; right: 2px; }
  #btnMano, #btnGente { display: none; }
  .pruebas-red { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
