/* Garage — Control Remoto · look & feel 2026 */
:root {
  --bg: #0c0e11;
  --bg-2: #12151a;
  --surface: #171b21;
  --surface-2: #20252d;
  --steel: #2b313b;
  --line: #2c323c;
  --text: #eef0f3;
  --muted: #8c94a3;
  --amber: #f5b301;
  --amber-ink: #1a1400;
  --ok: #2fd27a;
  --warn: #f5b301;
  --danger: #ff4d4f;
  --radius: 20px;
  --tabbar-h: 66px;
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-cond: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }

body {
  background:
    radial-gradient(1200px 500px at 50% -200px, #1d232c 0%, transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.45 var(--font);
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* ---------- header ---------- */
.app-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: rgba(12, 14, 17, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.app-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 4px;
  background: repeating-linear-gradient(-45deg, var(--amber) 0 10px, #111 10px 20px);
  opacity: .9;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  flex: none; width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--amber); color: var(--amber-ink);
  box-shadow: 0 6px 18px rgba(245, 179, 1, .25);
}
.brand-mark svg { width: 24px; height: 24px; }
.app-header h1 {
  margin: 0; font: 700 22px/1 var(--font-cond); letter-spacing: .12em; text-transform: uppercase;
}
.app-header .sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.header-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.clock { font: 600 18px/1 var(--font-cond); letter-spacing: .06em; font-variant-numeric: tabular-nums; }

/* chip / pill */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  white-space: nowrap;
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.chip[data-state="ok"]   { color: var(--text); }
.chip[data-state="ok"]::before   { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.chip[data-state="warn"]::before { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.chip[data-state="bad"]  { color: #ffb3b4; }
.chip[data-state="bad"]::before  { background: var(--danger); box-shadow: 0 0 8px var(--danger); }

/* ---------- layout ---------- */
main { max-width: 1120px; margin: 0 auto; padding: 20px 16px; }
.view { display: none; }
.view.active { display: grid; gap: 16px; animation: view-in .25s ease-out; }
@keyframes view-in { from { opacity: 0; -webkit-transform: translateY(6px); transform: translateY(6px); } }
@media (min-width: 920px) {
  .view.active.cols-2 { grid-template-columns: 1.15fr 1fr; align-items: start; }
}
.stack { display: grid; gap: 16px; }

.card {
  position: relative;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 12px 30px rgba(0,0,0,.25);
}
.card h2, .eyebrow {
  margin: 0 0 12px;
  font: 600 13px/1 var(--font-cond); letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}

/* ---------- garage door ---------- */
.garage { --open: 0; --door-speed: 3.2s; }
.door-frame {
  position: relative; overflow: hidden;
  aspect-ratio: 16 / 10;
  border-radius: 14px 14px 6px 6px;
  border: 10px solid #23282f;
  border-bottom-width: 0;
  background:
    radial-gradient(60% 70% at 50% 100%, rgba(245,179,1,.10), transparent 70%),
    linear-gradient(180deg, #07080a 0%, #111419 100%);
  box-shadow: inset 0 0 40px rgba(0,0,0,.8);
}
.door-frame::before { /* luz de techo */
  content: ""; position: absolute; top: 6px; left: 50%; width: 46%; height: 6px; -webkit-transform: translateX(-50%); transform: translateX(-50%);
  border-radius: 3px; background: #2a2f37;
  transition: background .4s, box-shadow .4s;
}
.garage[data-door="opening"] .door-frame::before,
.garage[data-door="closing"] .door-frame::before,
.garage[data-door="partial"] .door-frame::before {
  background: var(--amber); box-shadow: 0 0 18px 4px rgba(245,179,1,.55);
  animation: beacon 1s steps(2, jump-none) infinite;
}
@keyframes beacon { 50% { opacity: .35; } }

.car { position: absolute; left: 50%; bottom: 8%; width: 62%; -webkit-transform: translateX(-50%); transform: translateX(-50%); color: #39404b; }
.floor {
  position: absolute; left: 0; right: 0; bottom: 0; height: 10%;
  background: linear-gradient(180deg, #1a1e24, #0d0f12);
}

.door-panel {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  -webkit-transform: translateY(calc(var(--open) * -100%));
  transform: translateY(calc(var(--open) * -100%));
  -webkit-transition: -webkit-transform var(--door-speed) cubic-bezier(.45,.05,.3,1);
  transition: transform var(--door-speed) cubic-bezier(.45,.05,.3,1);
  will-change: transform;
  background:
    linear-gradient(90deg, rgba(0,0,0,.35), transparent 6%, transparent 94%, rgba(0,0,0,.35)),
    repeating-linear-gradient(180deg,
      #59616e 0, #6c7584 3px, #5a6270 14%, #444b57 calc(100% / 7 - 4px), #1c2026 calc(100% / 7 - 2px), #1c2026 calc(100% / 7));
  box-shadow: 0 8px 18px rgba(0,0,0,.6);
}
.door-panel::after { /* manija */
  content: ""; position: absolute; left: 50%; bottom: 7%; width: 18%; height: 5px; -webkit-transform: translateX(-50%); transform: translateX(-50%);
  border-radius: 3px; background: #2a2f37; box-shadow: 0 1px 0 rgba(255,255,255,.15);
}
.door-sill { height: 8px; border-radius: 0 0 6px 6px; background: repeating-linear-gradient(-45deg, var(--amber) 0 8px, #111 8px 16px); opacity: .85; }

.garage[data-door="open"]    { --open: .9; }
.garage[data-door="partial"] { --open: .45; }
.garage[data-door="opening"] { --open: .9;  --door-speed: 12s; }
.garage[data-door="closing"] { --open: 0;   --door-speed: 12s; }

/* estado grande */
.door-status {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 16px 2px 14px;
}
.door-status .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; }
.door-status .value {
  font: 700 34px/1.05 var(--font-cond); letter-spacing: .04em; text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
}
.door-status .value::before {
  content: ""; flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--muted);
}
.door-status .value > div:empty::after { content: "Conectando…"; color: var(--muted); font-size: 22px; }
.garage[data-state="ok"]   .door-status .value::before { background: var(--ok);     box-shadow: 0 0 12px var(--ok); }
.garage[data-state="warn"] .door-status .value::before { background: var(--warn);   box-shadow: 0 0 12px var(--warn); }
.garage[data-state="bad"]  .door-status .value::before { background: var(--danger); box-shadow: 0 0 12px var(--danger); }
.garage[data-state="bad"]  .door-status .value { color: #ffb3b4; }
.updated { color: var(--muted); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- botonera tipo control remoto ---------- */
.remote { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }

.btn {
  appearance: none; cursor: pointer; user-select: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 58px; padding: 10px 12px; border-radius: 16px;
  background: linear-gradient(180deg, #2a3039, #1f242b);
  border: 1px solid #353c47;
  box-shadow: 0 1px 0 rgba(255,255,255,.07) inset, 0 6px 14px rgba(0,0,0,.35);
  color: var(--text); font: 600 15px/1.1 var(--font); letter-spacing: .02em;
  touch-action: manipulation;
  transition: transform .08s, border-color .15s, background .15s, box-shadow .15s;
}
.btn:hover { border-color: #4a5260; }
.btn:active { -webkit-transform: scale(.96); transform: scale(.96); box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 2px 6px rgba(0,0,0,.4); }
.btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.btn svg { width: 28px; height: 28px; }
.btn small { color: var(--muted); font-size: 12px; font-weight: 500; }

.btn.big { min-height: 96px; font-size: 16px; }
.btn.big svg { width: 34px; height: 34px; }
.btn.amber svg { color: var(--amber); }
.btn.ok svg { color: var(--ok); }
.btn.danger svg { color: var(--danger); }

.btn.estop {
  width: 104px; height: 104px; min-height: 0; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #ff6b6b, #d4171b 60%, #8f0c0f);
  border: 6px solid var(--amber);
  box-shadow: 0 0 0 4px #111, 0 10px 24px rgba(212,23,27,.45), inset 0 -6px 12px rgba(0,0,0,.35);
  color: #fff; font: 700 15px/1 var(--font-cond); letter-spacing: .12em; text-transform: uppercase;
}
.btn.estop svg { width: 30px; height: 30px; color: #fff; }

.btn-row { display: grid; grid-template-columns: repeat(var(--n, 2), 1fr); gap: 10px; }

/* segmentado ON/OFF */
.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; gap: 4px; border-radius: 16px; background: #0f1216; border: 1px solid var(--line); }
.segmented .btn { box-shadow: none; border-color: transparent; background: transparent; min-height: 54px; flex-direction: row; gap: 8px; }
.segmented .btn:hover { background: var(--surface-2); }
.segmented .btn.lit { background: linear-gradient(180deg, #3a3210, #262108); border-color: rgba(245,179,1,.4); }
.segmented .btn.lit svg { color: var(--amber); filter: drop-shadow(0 0 6px rgba(245,179,1,.7)); }

.btn.flash { animation: flash .45s; }
@keyframes flash { from { box-shadow: 0 0 0 0 rgba(245,179,1,.55); } to { box-shadow: 0 0 0 14px rgba(245,179,1,0); } }

/* ---------- cámara ---------- */
.camera { position: relative; border-radius: 14px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
@supports not (aspect-ratio: 1) {
  .camera { height: 0; padding-top: 56.25%; }
  .door-frame { height: 0; padding-top: 62.5%; }
}
.camera img { width: 100%; height: 100%; object-fit: cover; display: block; }
.camera .live {
  position: absolute; top: 10px; left: 10px;
  font: 700 11px/1 var(--font); letter-spacing: .1em;
  background: rgba(0,0,0,.6); padding: 5px 9px; border-radius: 999px;
}
.camera .live::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px;
  border-radius: 50%; background: var(--danger); vertical-align: 0;
  animation: pulse 1.6s infinite;
}
@keyframes pulse { 50% { opacity: .3; } }
.camera .nosignal {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: none; place-items: center; text-align: center; color: var(--muted);
  background: repeating-linear-gradient(-45deg, #111 0 14px, #15181d 14px 28px);
  font: 600 14px/1.4 var(--font-cond); letter-spacing: .12em; text-transform: uppercase;
}
.camera.off .nosignal { display: grid; }
.camera.off .live { display: none; }

/* ---------- status genérico (otras páginas / sistema) ---------- */
.status {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 14px 0; padding: 14px; border-radius: 14px;
  background: #0f1216; border: 1px solid var(--line);
  font: 700 24px/1.1 var(--font-cond); letter-spacing: .06em; text-transform: uppercase; min-height: 60px;
}
.status::before { content: ""; width: 11px; height: 11px; border-radius: 50%; background: var(--muted); flex: none; }
.status[data-state="ok"]::before   { background: var(--ok);     box-shadow: 0 0 10px var(--ok); }
.status[data-state="warn"]::before { background: var(--warn);   box-shadow: 0 0 10px var(--warn); }
.status[data-state="bad"]::before  { background: var(--danger); box-shadow: 0 0 10px var(--danger); }
.status > div:empty::after { content: "—"; color: var(--muted); }

/* ---------- tablas ---------- */
.search {
  width: 100%; min-height: 44px; padding: 0 14px 0 40px; margin-bottom: 12px; border-radius: 12px;
  background: #0f1216 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238c94a3' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px 50% / 18px;
  border: 1px solid var(--line); color: var(--text); font: inherit; font-size: 16px;
  -webkit-appearance: none; appearance: none;
}
.search:focus { outline: 2px solid var(--amber); outline-offset: 1px; }
.table-wrap { overflow-x: auto; overflow-y: visible; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; margin: 0 -16px -16px; padding: 0 16px 16px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
table thead td, table thead th {
  position: sticky; top: 0; z-index: 1; background: var(--surface);
  color: var(--muted); font: 600 12px/1 var(--font-cond); text-transform: uppercase; letter-spacing: .12em;
  border-bottom: 1px solid var(--line);
}
table td { padding: 10px; border-bottom: 1px solid rgba(44,50,60,.6); white-space: nowrap; }
table tbody tr:nth-child(even) td { background: rgba(255,255,255,.015); }
table tbody tr:hover td { background: var(--surface-2); }
.empty { color: var(--muted); text-align: center; padding: 24px 0; }

/* ---------- formularios ---------- */
select {
  width: 100%; min-height: 52px; padding: 0 14px; border-radius: 14px;
  background: #0f1216; color: var(--text); border: 1px solid var(--line);
  font: 600 17px var(--font);
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f5b301' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 18px;
}
select:focus { outline: 2px solid var(--amber); outline-offset: 1px; }

/* ---------- sensores ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); gap: 10px; }
.tiles > div {
  background: #0f1216; border: 1px solid var(--line); border-left: 4px solid var(--amber);
  border-radius: 14px; padding: 14px; min-height: 68px;
  font: 600 18px/1.2 var(--font-cond); letter-spacing: .04em;
}
.tiles > div:empty::after { content: "Sin datos"; color: var(--muted); font-weight: 400; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px); z-index: 30;
  -webkit-transform: translate(-50%, 20px); transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 10px 16px; border-radius: 999px;
  background: #f4f5f7; color: #111; font-weight: 600; font-size: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; -webkit-transform: translate(-50%, 0); transform: translate(-50%, 0); }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding: 0 max(8px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(8px, env(safe-area-inset-left));
  background: rgba(18, 21, 26, .9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar button {
  position: relative; appearance: none; background: none; border: 0; color: var(--muted); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font: 600 11px/1 var(--font); letter-spacing: .06em; text-transform: uppercase;
}
.tabbar button svg { width: 22px; height: 22px; }
.tabbar button[aria-selected="true"] { color: var(--amber); }
.tabbar button[aria-selected="true"]::before {
  content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px;
  background: var(--amber);
}

/* páginas sin tabbar */

/* ---------- movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  .door-panel { -webkit-transition: none; transition: none; }
  .view.active, .btn.flash { animation: none; }
  .camera .live::before { animation: none; }
  .garage .door-frame::before { animation: none !important; }
  .toast { transition: opacity .2s; -webkit-transform: translate(-50%, 0); transform: translate(-50%, 0); }
}

/* ---------- barra inferior: siempre fija y visible ---------- */
.tabbar {
  -webkit-transform: translateZ(0); transform: translateZ(0);
  min-height: var(--tabbar-h);
}
.tabbar a {
  position: relative; color: var(--muted); text-decoration: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font: 600 11px/1 var(--font); letter-spacing: .06em; text-transform: uppercase;
  touch-action: manipulation;
}
.tabbar a svg { width: 22px; height: 22px; }
.tabbar button, .tabbar a { min-width: 0; padding: 0 2px; }
.tabbar [aria-selected="true"], .tabbar a[aria-current="page"] { color: var(--amber); }
.tabbar a[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px;
  background: var(--amber);
}
.tabbar.five { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 360px) { .tabbar button, .tabbar a { font-size: 10px; letter-spacing: .02em; } }

/* ---------- botón volver ---------- */
.back {
  flex: none; display: none; align-items: center; justify-content: center; gap: 2px;
  height: 40px; padding: 0 12px 0 6px; margin-right: -2px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  font: 600 14px/1 var(--font); cursor: pointer; text-decoration: none;
  touch-action: manipulation;
}
.back svg { width: 22px; height: 22px; color: var(--amber); }
.back.show { display: inline-flex; }
.back.show + .brand-mark { display: none; }
@media (min-width: 420px) { .back.show + .brand-mark { display: grid; } }

/* ---------- selector de cámaras ---------- */
.cams { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 12px; padding: 0 16px 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.cams::-webkit-scrollbar { display: none; }
.cams button {
  flex: none; appearance: none; -webkit-appearance: none; cursor: pointer;
  padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: #0f1216; color: var(--muted); font: 600 13px/1 var(--font); touch-action: manipulation;
}
.cams button[aria-pressed="true"] { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
.camera img { opacity: 1; transition: opacity .3s; }
.camera.loading img[src=""] { opacity: 0; }
.camera .expand {
  position: absolute; right: 10px; bottom: 10px; width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center; background: rgba(0,0,0,.55); color: #fff; border: 0; cursor: pointer;
}
.camera .expand svg { width: 20px; height: 20px; }
.camera.full {
  position: fixed; z-index: 50; top: 0; right: 0; bottom: 0; left: 0; border-radius: 0; aspect-ratio: auto;
  height: auto; padding: 0; background: #000;
}
.camera.full img { object-fit: contain; }

/* ---------- sin desborde horizontal (evita que el celular achique la página) ---------- */
body { max-width: 100%; overflow-x: hidden; overflow-x: clip; }
.view.active > *, .stack > *, .btn-row > *, .remote > * { min-width: 0; }
.card { max-width: 100%; }
.app-header .brand > div:last-child { min-width: 0; }
.app-header .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.btn { text-decoration: none; }

/* ---------- cámara grande: video en vivo, imagen completa sin recorte ---------- */
.cam-hero { padding: 0; overflow: hidden; grid-column: 1 / -1; }
.cam-hero h2 { padding: 16px 16px 0; }
.cam-hero .cams { margin: 0 0 12px; }
.cam-hero .camera {
  --ar: 1.7778;
  border-radius: 0; height: auto; padding-top: 0;
  aspect-ratio: var(--ar);
  width: 100%; max-width: calc(72vh * var(--ar)); margin: 0 auto;
}
@supports not (aspect-ratio: 1) { .cam-hero .camera { height: 0; padding-top: calc(100% / var(--ar)); } }
.cam-hero .camera img.snap,
.cam-hero .camera .live-video,
.cam-hero .camera .live-video video-rtc {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%;
}
.cam-hero .camera img.snap { object-fit: contain; }
/* el flujo normal es 704x576: se estira a la proporción real de la cámara */
.cam-hero .camera .live-video video { width: 100%; height: 100%; object-fit: fill; background: #000; }
.cam-hero .camera .live-video { opacity: 0; transition: opacity .25s; }
.cam-hero .camera.is-live .live-video { opacity: 1; }
.cam-hero .camera.is-live img.snap { visibility: hidden; }
.cam-hero .camera:not(.is-live) .live { display: none; }
.cam-hero .camera.off img.snap { visibility: hidden; }
.cam-hero .camera .live, .cam-hero .camera .expand, .cam-hero .camera .nosignal { z-index: 2; }
.cam-hero .camera.full { aspect-ratio: auto; max-width: none; margin: 0; padding: 0; height: auto; }
.cam-hero .camera.full .live-video video { object-fit: contain; }

/* ---------- pantalla de ingreso ---------- */
body.login-page { padding-bottom: 0; }
.login-page main { max-width: 420px; padding-top: 32px; }
.card.login { padding: 24px 20px; display: grid; gap: 14px; }
.card.login h2 { margin: 0; font-size: 20px; color: var(--text); letter-spacing: .12em; }
.login-lock {
  width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center;
  background: var(--amber); color: var(--amber-ink); box-shadow: 0 8px 22px rgba(245,179,1,.25);
}
.login-lock svg { width: 28px; height: 28px; }
.login-help { margin: -6px 0 0; color: var(--muted); }
.login-field { display: grid; gap: 6px; font-weight: 600; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.pwd-wrap { position: relative; display: block; }
.pwd-wrap input {
  width: 100%; min-height: 54px; padding: 0 54px 0 16px; border-radius: 14px;
  background: #0f1216; border: 1px solid var(--line); color: var(--text);
  font: 600 18px var(--font); letter-spacing: .04em; -webkit-appearance: none; appearance: none;
}
.pwd-wrap input:focus { outline: 2px solid var(--amber); outline-offset: 1px; }
.pwd-toggle {
  position: absolute; right: 6px; top: 50%; -webkit-transform: translateY(-50%); transform: translateY(-50%);
  width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--muted);
  display: grid; place-items: center; cursor: pointer; touch-action: manipulation;
}
.pwd-toggle svg { width: 22px; height: 22px; }
.login-check { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.login-check input { width: 20px; height: 20px; accent-color: var(--amber); }
.login-error {
  padding: 12px 14px; border-radius: 12px; font-weight: 600;
  background: rgba(255,77,79,.12); border: 1px solid rgba(255,77,79,.45); color: #ffb3b4;
}
.login-submit { width: 100%; flex-direction: row; gap: 10px; min-height: 60px; }
