:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1d2733;
  --muted: #647282;
  --line: #d9e0e7;
  --primary: #22577a;
  --primary-strong: #183b54;
  --success: #1f7a4d;
  --danger: #b42318;
  --warning: #b7791f;
  --focus: #2f80ed;
  --shadow: 0 18px 45px rgba(24, 59, 84, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(47, 128, 237, 0.35);
  outline-offset: 2px;
}

.auth-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.auth-shell {
  width: min(100%, 420px);
}

.auth-panel,
.info-panel,
.notice-panel,
.control-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-panel {
  padding: 32px;
}

.auth-panel h1,
.topbar h1,
.info-panel h2,
.notice-panel h2 {
  margin: 0;
  line-height: 1.15;
}

.auth-panel h1,
.topbar h1 {
  font-size: clamp(1.8rem, 2.8rem, 2.8rem);
}

.info-panel h2,
.notice-panel h2 {
  font-size: 1.1rem;
}

.muted,
.helper-text,
.info-panel p,
.notice-panel p {
  color: var(--muted);
}

.stack,
.button-stack {
  display: grid;
  gap: 12px;
}

.stack label {
  font-weight: 700;
}

.stack input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  background: #ffffff;
}

.error-message {
  margin: 0;
  color: var(--danger);
  font-weight: 700;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px clamp(16px, 4vw, 44px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 20px;
  padding: 20px clamp(16px, 4vw, 44px) 36px;
}

.video-panel {
  min-width: 0;
}

.video-frame {
  position: relative;
  display: grid;
  min-height: clamp(320px, 66vh, 760px);
  overflow: hidden;
  place-items: center;
  background: #141c24;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.video-frame video {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
  background: #141c24;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #dbe7f2;
  text-align: center;
  font-weight: 700;
}

.live-indicator {
  position: absolute;
  top: 14px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 28px);
  padding: 8px 10px;
  color: #ffffff;
  background: rgba(180, 35, 24, 0.94);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 800;
}

.live-indicator span {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  background: #ffffff;
  border-radius: 999px;
}

.control-panel {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 16px;
  box-shadow: none;
}

.info-panel,
.notice-panel {
  padding: 18px;
  box-shadow: none;
}

.notice-panel.urgent {
  border-color: rgba(180, 35, 24, 0.35);
  background: #fff8f7;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.primary-button {
  color: #ffffff;
  background: var(--primary);
}

.primary-button:hover:not(:disabled) {
  background: var(--primary-strong);
}

.secondary-button,
.ghost-button {
  color: var(--primary);
  background: #e8f0f5;
}

.secondary-button:hover:not(:disabled),
.ghost-button:hover:not(:disabled) {
  background: #d7e5ee;
}

.danger-button {
  color: #ffffff;
  background: var(--danger);
}

.danger-button:hover:not(:disabled) {
  background: #8f1d14;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.neutral {
  color: #34495e;
  background: #e8edf2;
}

.status-pill.online {
  color: #ffffff;
  background: var(--success);
}

.status-pill.warning {
  color: #2e2200;
  background: #f8d86f;
}

.status-pill.danger {
  color: #ffffff;
  background: var(--danger);
}

.indicator-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.helper-text {
  margin: 0;
  min-height: 1.4em;
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .video-frame {
    min-height: min(56vh, 480px);
  }
}

@media (max-width: 520px) {
  .button-row {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    padding: 24px;
  }
}
