:root {
  --blue-950: #071b3a;
  --blue-900: #08244f;
  --blue-700: #0f4c9a;
  --blue-100: #eaf2ff;
  --text: #172033;
  --muted: #667085;
  --border: #e5e9f2;
  --bg: #f5f8fc;
  --white: #ffffff;
  --success: #16803c;
  --warning: #fff7e6;
}

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

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at top left, #e9f3ff, transparent 35%), linear-gradient(135deg, var(--blue-950), var(--blue-700));
  padding: 24px;
}

.login-card, .panel, .status-card {
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(6, 28, 63, .16);
}

.login-card {
  width: min(440px, 100%);
  padding: 36px;
}

.brand-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, var(--blue-900), var(--blue-700));
  border-radius: 16px;
  font-weight: 800;
  font-size: 28px;
  margin-bottom: 18px;
}

h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(28px, 4vw, 44px); letter-spacing: -0.04em; color: var(--blue-950); }
h2 { font-size: 22px; color: var(--blue-950); }
.muted { color: var(--muted); line-height: 1.55; }
.eyebrow { color: var(--blue-700); text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 800; }

.form { display: grid; gap: 10px; margin-top: 24px; }
label { font-size: 14px; font-weight: 700; }
input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 16px;
  outline: none;
}
input:focus { border-color: var(--blue-700); box-shadow: 0 0 0 4px rgba(15, 76, 154, .12); }
button {
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, var(--blue-900), var(--blue-700));
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(15, 76, 154, .22);
}
button.secondary {
  background: white;
  color: var(--blue-900);
  border: 1px solid var(--border);
  box-shadow: none;
}
.alert, .warning {
  padding: 14px 16px;
  border-radius: 14px;
  margin: 18px 0;
}
.alert { background: #fff1f1; color: #a11818; }
.warning { background: var(--warning); border: 1px solid #ffe1a6; }

.topbar {
  height: 76px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 32px;
  background: white;
  border-bottom: 1px solid var(--border);
}
.topbar div { display: grid; gap: 2px; }
.topbar span { color: var(--muted); font-size: 14px; }
.container { width: min(1180px, calc(100% - 40px)); margin: 34px auto; }
.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
}
.status-card {
  min-width: 260px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.status-card small { color: var(--muted); display: block; }
.status-card strong { color: var(--blue-950); }
.status-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #98a2b3;
  box-shadow: 0 0 0 6px rgba(152, 162, 179, .14);
}
.status-dot.connected { background: var(--success); box-shadow: 0 0 0 6px rgba(22, 128, 60, .14); }
.status-dot.qr, .status-dot.starting { background: #e69313; box-shadow: 0 0 0 6px rgba(230, 147, 19, .16); }
.grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 24px; }
.panel { padding: 26px; }
.qr-box {
  min-height: 330px;
  display: grid;
  place-items: center;
  border: 1px dashed #c7d5ea;
  border-radius: 22px;
  background: #fbfdff;
  margin: 20px 0;
  text-align: center;
  padding: 20px;
}
.qr-box img { width: min(280px, 100%); height: auto; }
.success { color: var(--success); font-weight: 800; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.settings { display: grid; grid-template-columns: 150px 1fr; gap: 14px; }
dt { color: var(--muted); }
dd { margin: 0; font-weight: 700; }
.note { margin-top: 24px; color: var(--muted); line-height: 1.5; }
code { background: var(--blue-100); color: var(--blue-900); padding: 2px 6px; border-radius: 6px; }

@media (max-width: 820px) {
  .hero, .grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 18px; }
  .container { width: min(100% - 28px, 1180px); }
  .settings { grid-template-columns: 1fr; }
}
