/* Zanora onboarding console — local dev UI. No build step, no dependencies. */
:root {
  color-scheme: light dark;
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1e222b;
  --line: #2a2f3a;
  --text: #e7e9ee;
  --muted: #939aa8;
  --accent: #6ea8fe;
  --good: #4ade80;
  --warn: #fbbf24;
  --bad: #f87171;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* -- chrome ---------------------------------------------------------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 20px;
  border-bottom: 1px solid var(--line); background: var(--panel);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand small { display: block; color: var(--muted); font-family: var(--mono); font-size: 11px; }
.mark {
  display: grid; place-items: center; width: 30px; height: 30px;
  border-radius: 8px; background: var(--accent); color: #0b0d12; font-weight: 700;
}
.status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-family: var(--mono); font-size: 12px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.dot.up { background: var(--good); }
.dot.down { background: var(--bad); }

.tabs { display: flex; gap: 4px; padding: 10px 20px 0; border-bottom: 1px solid var(--line); background: var(--panel); }
.tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--muted); padding: 8px 14px; font: inherit; cursor: pointer;
}
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }

main { padding: 20px; max-width: 1180px; margin: 0 auto; }
.panel { display: flex; flex-direction: column; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; }

/* -- cards ----------------------------------------------------------------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.card h2 { margin: 0 0 4px; font-size: 15px; }
.card h3 { margin: 18px 0 6px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.hint { margin: 0 0 12px; color: var(--muted); font-size: 12.5px; }

/* -- forms ----------------------------------------------------------------- */
form { display: flex; flex-direction: column; gap: 10px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); flex: 1; }
label.check { flex-direction: row; align-items: center; gap: 8px; flex: 0 0 auto; }
/* `label { display: flex }` above outranks the UA's [hidden] rule, so the
   role-dependent fields on the Sign up tab would stay visible without this. */
[hidden] { display: none !important; }
input, select, textarea {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); padding: 8px 10px; font: inherit; min-width: 0; width: 100%;
}
input[type="checkbox"] { width: auto; }
textarea { font-family: var(--mono); font-size: 12.5px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.row { display: flex; gap: 10px; align-items: flex-end; }
.row.wrap { flex-wrap: wrap; }

button {
  background: var(--accent); color: #0b0d12; border: none; border-radius: 8px;
  padding: 9px 14px; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
}
button:hover { filter: brightness(1.08); }
button:disabled { opacity: .5; cursor: progress; }
button.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); font-weight: 500; }
button.danger { background: transparent; border: 1px solid var(--bad); color: var(--bad); font-weight: 500; }
button.small { padding: 5px 9px; font-size: 12px; }

/* -- output ---------------------------------------------------------------- */
.out:empty { display: none; }
.out { margin-top: 12px; }
.note { border-radius: 8px; padding: 10px 12px; font-size: 12.5px; border: 1px solid var(--line); background: var(--panel-2); }
.note.ok { border-color: color-mix(in srgb, var(--good) 45%, var(--line)); }
.note.err { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.note.warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.note strong { display: block; margin-bottom: 4px; }

dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; font-size: 12.5px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; font-family: var(--mono); word-break: break-all; }

.secret {
  display: flex; gap: 8px; align-items: center; margin-top: 8px;
  background: #241f13; border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--line));
  border-radius: 8px; padding: 8px 10px;
}
.secret code { font-family: var(--mono); font-size: 11.5px; word-break: break-all; flex: 1; }

table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th { text-align: left; color: var(--muted); font-weight: 500; padding: 6px 8px; border-bottom: 1px solid var(--line); }
td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td.mono, th.mono { font-family: var(--mono); }
td.num { text-align: right; font-family: var(--mono); }
.empty { color: var(--muted); font-size: 12.5px; padding: 8px 0; }

/* The one-time key panel. Deliberately the loudest thing on the page: it is
   the only moment the token exists outside the gateway's digest. */
.credential-card {
  border-color: color-mix(in srgb, var(--warn) 55%, var(--line));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--warn) 18%, transparent);
}
.credential-card h2 { color: var(--warn); }
.credential-card .secret { margin-top: 10px; }
.credential-card .secret button { background: var(--warn); color: #0b0d12; border: none; }
.credential-card pre { white-space: pre-wrap; }
.note pre { margin: 8px 0 0; white-space: pre-wrap; }

.pill { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; border: 1px solid var(--line); color: var(--muted); }
.pill.ok { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, var(--line)); }
.pill.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.pill.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }

pre { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
      padding: 10px; overflow: auto; max-height: 320px; font-family: var(--mono); font-size: 11.5px; margin: 8px 0 0; }

.item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 10px; background: var(--panel-2); }
.item header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.item header strong { font-size: 13px; }
.item .actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 14px; font-size: 13px; box-shadow: 0 6px 24px rgba(0,0,0,.45); z-index: 10;
}
