/* Estilo alineado con sat.stmpro.es (STM PRO PORTAL): fondo claro, Blinker, botones negros. */
@font-face { font-family: 'Blinker'; font-weight: 400; font-style: normal; font-display: swap; src: url(/fonts/blinker-400-normal-latin.woff2) format('woff2'); }
@font-face { font-family: 'Blinker'; font-weight: 600; font-style: normal; font-display: swap; src: url(/fonts/blinker-600-normal-latin.woff2) format('woff2'); }
@font-face { font-family: 'Blinker'; font-weight: 700; font-style: normal; font-display: swap; src: url(/fonts/blinker-700-normal-latin.woff2) format('woff2'); }

:root {
  --bg: #f6f5f3;
  --panel: #ffffff;
  --panel-2: #f2f5f7;
  --line: #e1e8ed;
  --text: #3a4f66;
  --heading: #192a3d;
  --muted: #7a8896;
  --ink: #000000;
  --ink-2: #4f5053;
  --accent: #000000;
  --ok: #2e9d4f;
  --warn: #c58a12;
  --bad: #d23a31;
  --radius: 6px;
  font-family: Blinker, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; height: 100%; }
body {
  background: var(--bg) url(/fondo.jpg) no-repeat center top / cover fixed;
  color: var(--text); font-size: 16px; line-height: 1.5;
}
button { font: inherit; }
h1, h2 { color: var(--heading); }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 16px; gap: 28px;
}
.login-logo { width: min(560px, 92vw); height: auto; display: block; }
.login-card { width: 100%; max-width: 280px; text-align: center; }
.login-card label { text-align: center; }
.login-card .sub { margin: 0 0 6px; color: var(--muted); font-size: 15px; }
.login-note { max-width: 640px; text-align: center; color: var(--muted); font-size: 15px; margin: 0; }
label { display: block; font-size: 15px; color: var(--text); margin: 14px 0 6px; }
input {
  width: 100%; padding: 8px 18px; height: 40px; border-radius: 4px; border: 1px solid #121214;
  background: #fff; color: #121214; font: inherit; font-size: 16px;
}
input:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 5px 20px; border-radius: 4px; border: 1px solid var(--line);
  background: #fff; color: var(--heading); cursor: pointer; font-size: 15px; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { border-color: var(--ink); background: var(--panel-2); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn:disabled:hover { border-color: var(--line); background: #fff; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn.danger { border-color: #e9b9b5; color: var(--bad); }
.btn.rec { border-color: var(--bad); color: #fff; background: var(--bad); }
.btn.block { width: 100%; margin-top: 20px; }
.error { color: var(--bad); font-size: 14px; min-height: 18px; margin-top: 10px; }

/* ---------- App ---------- */
.app { display: grid; grid-template-rows: auto 1fr; min-height: 100%; }
header.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 24px; height: 52px; background: #0d0d0f; border-bottom: 1px solid #000;
}
header .brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
header .brand img { height: 20px; width: auto; display: block; }
header .who { color: #cfd6de; font-size: 15px; display: flex; align-items: center; gap: 10px; }
header .who #who { margin-right: 4px; }
.btn.ghost { min-height: 32px; padding: 2px 14px; font-size: 14px; background: transparent; color: #fff; border-color: #3a3d43; }
.btn.ghost:hover { background: #1c1e22; border-color: #8a8f98; }

main.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; padding: 20px 24px; min-height: 0;
  width: 100%; max-width: 1680px; margin: 0 auto; align-items: start;
}
@media (max-width: 900px) {
  main.layout { grid-template-columns: 1fr; padding: 12px 16px; }
  header.top { padding: 0 14px; }
}

.stage {
  position: relative; background: #000; border-radius: var(--radius); overflow: hidden;
  height: clamp(360px, calc(100vh - 168px), 1000px); display: grid; place-items: center; border: 1px solid #121214;
}
.stage video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.stage .overlay {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  color: #b9c4d0; padding: 24px; pointer-events: none;
}
.stage .overlay .big { font-size: 20px; color: #fff; margin-bottom: 6px; font-weight: 600; }
.stage .badge {
  position: absolute; top: 12px; left: 12px; display: flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,.65); color: #fff; padding: 5px 10px; border-radius: 999px; font-size: 13px;
}
.stage .unmute { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.ok { background: var(--ok); }
.dot.live { background: #ff4a40; animation: pulse 1.4s infinite; }
.dot.warn { background: var(--warn); }
@keyframes pulse { 50% { opacity: .35; } }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

aside.side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(25,42,61,.04);
}
.card h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--heading); margin: 0 0 10px; font-weight: 600; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 15px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--heading); }
.seg { display: flex; gap: 6px; }
.seg .btn { flex: 1; padding: 6px; }
.seg .btn.on { border-color: var(--ink); color: #fff; background: var(--ink); }
ul.viewers { list-style: none; padding: 0; margin: 0; font-size: 15px; }
ul.viewers li { padding: 4px 0; display: flex; gap: 8px; align-items: center; }
.hint { color: var(--muted); font-size: 13px; margin-top: 8px; line-height: 1.4; }
.toast {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: 10px 16px; border-radius: 4px; font-size: 15px;
  opacity: 0; transition: opacity .2s; pointer-events: none; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; }

[hidden] { display: none !important; }

.req { color: var(--bad); }

/* ---------- Diálogo Mi cuenta ---------- */
.dlg { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; width: min(420px, 92vw); color: var(--text); background: #fff; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.dlg::backdrop { background: rgba(13,13,15,.55); }
.dlg h2 { margin: 0 0 4px; font-size: 20px; }
.dlg .hint { margin: 0 0 4px; }
.dlg label .hint { display: inline; font-size: 13px; margin: 0; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

@media (max-width: 900px) {
  .stage { height: clamp(260px, 62vh, 700px); }
}
