:root {
  --bg-color: #0b0f19;
  --card-bg: #151c2e;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --border-color: #1e293b;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --success: #10b981;
  --warning: #f59e0b;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
}

.pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 9999px;
  text-transform: uppercase;
}

.pill-locked { background: #334155; color: #cbd5e1; }
.pill-unlocking { background: #854d0e; color: #fef08a; }
.pill-ready { background: #065f46; color: #a7f3d0; }
.pill-error { background: #7f1d1d; color: #fecaca; }

.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.card h2 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: #fff;
  font-size: 1rem;
}

input[type="password"]:focus {
  outline: none;
  border-color: var(--primary);
}

.btn {
  display: block;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s ease;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:active { background: var(--primary-hover); }

.btn-secondary { background: #334155; color: white; margin-top: 12px; }
.btn-secondary:active { background: #475569; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:active { background: var(--danger-hover); }

.btn-sm { width: auto; padding: 6px 12px; font-size: 0.8rem; }

.error-msg {
  margin-top: 14px;
  padding: 10px;
  background: #450a0a;
  border: 1px solid #7f1d1d;
  color: #fca5a5;
  border-radius: 6px;
  font-size: 0.85rem;
}

.account-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  background: #0f172a;
}

.account-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.state-indicator {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.action-buttons {
  display: flex;
  gap: 8px;
}

.action-buttons .btn {
  flex: 1;
}

/* Stream View */
.stream-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.stream-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  width: 100%;
}

.viewport-container {
  width: 100%;
  flex: 1;
  height: calc(100vh - 120px);
  min-height: 500px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

#display-canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  max-height: 80vh;
  object-fit: contain;
}

.keyboard-capture {
  position: absolute;
  top: -100px;
  left: -100px;
  opacity: 0;
  pointer-events: none;
}
