/* Nexo web client — shadcn-inspired: minimal, neutral, one accent. */
:root {
  --bg: #09090b;
  --surface: #0e0e11;
  --card: #131316;
  --card-hover: #17171b;
  --border: #232329;
  --border-strong: #2e2e36;
  --fg: #fafafa;
  --muted: #a1a1aa;
  --faint: #52525b;
  --primary: #7c5cff;
  --primary-fg: #fff;
  --primary-soft: rgba(124, 92, 255, 0.14);
  --ring: rgba(124, 92, 255, 0.45);
  --ok: #22c55e;
  --err: #f43f5e;
  --radius: 12px;
  --radius-sm: 9px;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: var(--sans); background: var(--bg); color: var(--fg);
  min-height: 100vh; font-size: 14px; -webkit-font-smoothing: antialiased;
}
a { color: var(--fg); text-decoration: none; }

.wrap { max-width: 420px; margin: 0 auto; padding: 56px 20px; }

.brand { display: flex; align-items: center; gap: 11px; font-weight: 650; font-size: 20px; letter-spacing: -0.01em; margin-bottom: 6px; }
.brand svg { display: block; }
.brand .dot { display: none; }
.tag { color: var(--muted); margin: 0 0 26px; font-size: 13.5px; line-height: 1.5; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 14px; }
.card h2 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }

label { display: block; font-size: 12px; color: var(--muted); margin: 14px 0 7px; font-weight: 500; }

input[type=text], input[type=password] {
  width: 100%; padding: 11px 13px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--fg); font-size: 15px; font-family: var(--mono); letter-spacing: 1px; transition: .14s;
}
input::placeholder { color: var(--faint); letter-spacing: .3px; font-family: var(--sans); }
input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }

button {
  width: 100%; padding: 11px; margin-top: 16px; background: var(--primary); color: var(--primary-fg);
  border: none; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; cursor: pointer; transition: .14s;
}
button:hover { filter: brightness(1.08); }
button:active { transform: translateY(1px); }
button.ghost { background: var(--surface); color: var(--fg); border: 1px solid var(--border); font-weight: 550; }
button.ghost:hover { filter: none; background: var(--card-hover); border-color: var(--border-strong); }
button:disabled { opacity: .5; cursor: not-allowed; }

.credential {
  font-family: var(--mono); font-size: 26px; font-weight: 600; letter-spacing: 1px; text-align: center;
  padding: 15px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin: 6px 0; user-select: all;
}
.credential.small { font-size: 18px; letter-spacing: 2px; }

.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted);
  padding: 4px 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.status .led { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.status.ok .led { background: var(--ok); box-shadow: 0 0 7px rgba(34,197,94,.7); }
.status.err .led { background: var(--err); }
.status.wait .led { background: var(--primary); animation: pulse 1.1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

.row { display: flex; gap: 10px; }
.row button { margin-top: 0; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.5; }
.err-msg { color: var(--err); font-size: 13px; min-height: 18px; margin-top: 8px; }

/* ---- Controller viewer ---- */
.viewer-shell { max-width: none; padding: 0; height: 100vh; display: flex; flex-direction: column; }
.toolbar { display: flex; align-items: center; gap: 14px; padding: 9px 14px; background: var(--surface); border-bottom: 1px solid var(--border); font-size: 13px; }
.toolbar .spacer { flex: 1; }
.toolbar .stat { color: var(--faint); font-family: var(--mono); font-size: 12px; }
.toolbar .stat b { color: var(--muted); }
.toolbar select { background: var(--card); color: var(--fg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 9px; font-size: 13px; }
.stage { flex: 1; background: #000; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
#dropHint { display: none; }
.stage.dragover #dropHint { display: flex !important; }
video { max-width: 100%; max-height: 100%; display: block; }
.viewer-shell .stage video { width: 100%; height: 100%; object-fit: contain; cursor: crosshair; }
/* Hide native media controls in fullscreen so they don't overlay / block clicks. */
video::-webkit-media-controls,
video::-webkit-media-controls-enclosure,
video::-webkit-media-controls-panel { display: none !important; -webkit-appearance: none !important; }
/* Zoom modes */
.viewer-shell .stage.fill video { object-fit: cover; }
.viewer-shell .stage.actual { justify-content: flex-start; align-items: flex-start; overflow: auto; }
.viewer-shell .stage.actual video { width: auto; height: auto; max-width: none; max-height: none; object-fit: none; }

.chat { position: fixed; right: 14px; bottom: 14px; width: 270px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; max-height: 300px; overflow: hidden; }
.chat .log { flex: 1; overflow-y: auto; padding: 10px; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.chat .msg { padding: 6px 9px; border-radius: 8px; background: var(--surface); }
.chat .msg.me { background: var(--primary-soft); align-self: flex-end; }
.chat .compose { display: flex; border-top: 1px solid var(--border); }
.chat input { border: none; border-radius: 0; letter-spacing: 0; font-family: var(--sans); }
.chat input:focus { box-shadow: none; }
.chat button { width: auto; margin: 0; border-radius: 0; padding: 0 16px; }

.hint { text-align: center; font-size: 11.5px; color: var(--faint); line-height: 1.6; }
