:root {
  color-scheme: dark;
  --bg: #0f1419;
  --surface: #1a2332;
  --text: #e8eef4;
  --muted: #8b9aab;
  --accent: #3d8bfd;
  --danger: #f87171;
  --radius: 10px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.login-card h1 {
  margin: 0 0 0.25rem;
  font-size: 1.75rem;
}

.subtitle {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.login-form label {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.login-form input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #2a3544;
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}

.login-form button,
.btn {
  padding: 0.55rem 1rem;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  font-weight: 500;
}

.login-form button {
  width: 100%;
  margin-top: 0.5rem;
}

.btn-ghost {
  background: transparent;
  border: 1px solid #3a4556;
  color: var(--text);
}

.error {
  color: var(--danger);
  font-size: 0.9rem;
  margin: 0.5rem 0 0;
}

.hidden {
  display: none !important;
}

.viewer-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid #2a3544;
  flex-wrap: wrap;
}

.brand {
  font-weight: 600;
}

.timestamp {
  flex: 1;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.95rem;
}

.toolbar-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.logout-form {
  margin: 0;
}

.video-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  position: relative;
  min-height: 0;
}

.video-wrap img {
  max-width: 100%;
  max-height: calc(100vh - 56px);
  width: auto;
  height: auto;
  object-fit: contain;
}

.video-wrap:fullscreen img {
  max-height: 100vh;
}

.stream-hint {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--muted);
}

@media (max-width: 480px) {
  .toolbar {
    gap: 0.5rem;
  }
  .timestamp {
    font-size: 0.85rem;
  }
}
