:root {
  --bg: #0e1116;
  --panel: #171b22;
  --line: #262c36;
  --text: #e6e9ef;
  --muted: #8b94a3;
  --accent: #35c47a;
  --accent-press: #2aa565;
  --danger: #e04f5f;
  --danger-press: #c33e4d;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
}

/* --- centered forms (login, register, setup) ------------------------------ */
.card {
  margin: auto;
  width: min(380px, calc(100% - 32px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
}

.card h1 { margin: 0 0 20px; font-size: 20px; font-weight: 600; }

label {
  display: block;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--muted);
}

input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  background: #0f1319;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
}

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

button {
  width: 100%;
  padding: 11px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #06210f;
  font: 600 15px/1 inherit;
  cursor: pointer;
}

button:hover { background: var(--accent-press); }
button:disabled { background: var(--line); color: var(--muted); cursor: default; }

.error { color: var(--danger); font-size: 13px; margin: 0 0 14px; }
.ok    { color: var(--accent); font-size: 13px; margin: 0 0 8px; }
.muted { color: var(--muted); font-size: 13px; }
.muted a, a { color: var(--accent); }

/* --- call page ------------------------------------------------------------ */
.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.stage {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 32px 20px;
  text-align: center;
}

.callee-name { font-size: 26px; font-weight: 600; }

.status {
  font-size: 14px;
  color: var(--muted);
  min-height: 1.5em;
  font-variant-numeric: tabular-nums;
}

.status.bad { color: var(--danger); }

.controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.controls button { width: auto; min-width: 140px; }
.controls .secondary { background: var(--line); color: var(--text); }
.controls .secondary:hover { background: #313846; }
.controls .danger { background: var(--danger); color: #2a0007; }
.controls .danger:hover { background: var(--danger-press); }

/* Live input level, so you can see the mic is actually working. */
.meter {
  width: min(320px, 80%);
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}

.meter > i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 80ms linear;
}

[hidden] { display: none !important; }

/* --- shared-password gate ------------------------------------------------- */
.gate { justify-content: center; }

.gatebox {
  width: min(360px, 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gatebox h1 { margin: 0 0 4px; font-size: 20px; font-weight: 600; }
.gatebox input { margin-top: 0; text-align: center; letter-spacing: 2px; }
.gatebox .error { margin: 0; }
