:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --border: #2d3a4d;
  --text: #e8edf4;
  --muted: #8b9cb3;
  --accent: #25d366;
  --accent-dim: #1da851;
  --danger: #f87171;
  --warn: #fbbf24;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    sans-serif;
  --radius: 12px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: radial-gradient(ellipse 120% 80% at 50% -20%, #1e3a2f 0%, var(--bg) 55%);
  color: var(--text);
  line-height: 1.5;
}

.shell {
  max-width: 440px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

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

.main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.card-title {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.dash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.dash-head .card-title {
  margin: 0;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.label {
  font-size: 0.85rem;
  color: var(--muted);
}

.input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}

.input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
}

.btn {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  border: none;
  padding: 0.65rem 1rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #062d16;
  margin-top: 0.35rem;
}

.btn-primary:hover {
  background: var(--accent-dim);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--muted);
}

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

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}

.status-pill[data-state='ready'] .status-dot {
  background: var(--accent);
  box-shadow: 0 0 12px rgba(37, 211, 102, 0.55);
}

.status-pill[data-state='qr'],
.status-pill[data-state='authenticated'],
.status-pill[data-state='initializing'] .status-dot {
  background: var(--warn);
}

.status-pill[data-state='disconnected'],
.status-pill[data-state='auth_failure'] .status-dot {
  background: var(--danger);
}

.qr-wrap {
  margin-top: 0.5rem;
}

.qr-hint {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.qr-frame {
  display: flex;
  justify-content: center;
  padding: 1rem;
  background: #fff;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.qr-frame img {
  display: block;
  max-width: 100%;
  height: auto;
}

.footer {
  margin-top: 1.5rem;
  text-align: center;
}

.muted {
  font-size: 0.8rem;
  color: var(--muted);
}

[hidden] {
  display: none !important;
}
