/* Arbity: clean and calm. Blues and green for the brand; orange and red are
   kept for warnings only (CLAUDE.md §2). Swap the brand colours for the
   logo's exact ones when Paul sends it. */
:root {
  --navy: #0f3b66;
  --blue: #1f6fb2;
  --blue-soft: #e8f1fa;
  --green: #2f9e6f;
  --green-soft: #e6f5ee;
  --orange: #d9822b;
  --orange-soft: #fdf1e4;
  --red: #c8423b;
  --red-soft: #fbeaea;
  --ink: #17212b;
  --muted: #5d6b7a;
  --line: #e2e8ef;
  --bg: #f4f7fb;
  --card: #ffffff;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(15, 59, 102, 0.06), 0 8px 24px rgba(15, 59, 102, 0.06);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }

h1 { font-size: 1.5rem; margin: 0 0 0.75rem; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; margin: 1.25rem 0 0.5rem; }
p { line-height: 1.5; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

.test-banner {
  background: var(--orange); color: #fff; text-align: center; font-weight: 600;
  padding: 6px 16px; font-size: 0.875rem; position: sticky; top: 0; z-index: 10;
}
.version-warning {
  background: var(--red-soft); color: var(--red); border-bottom: 1px solid var(--red);
  padding: 10px 16px; text-align: center; font-weight: 600;
}

.screen { min-height: 100vh; }
.screen.center { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }

.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 28px; border: 1px solid var(--line);
}
.card.narrow { width: 100%; max-width: 420px; }
.card.wide { width: 100%; max-width: 860px; }

.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--blue), var(--green)); color: #fff; font-weight: 700;
}
.brand-mark.big { width: 64px; height: 64px; border-radius: 18px; font-size: 1.8rem; }
.brand-name { font-weight: 700; font-size: 1.15rem; color: var(--navy); letter-spacing: 0.01em; }

label { display: block; font-size: 0.9rem; font-weight: 600; margin: 14px 0 0; color: var(--ink); }
input {
  display: block; width: 100%; margin-top: 6px; padding: 12px 14px; font-size: 1rem;
  border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; color: var(--ink);
}
input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); background: #fff; }
.code-input { font-size: 1.4rem; letter-spacing: 0.3em; text-align: center; font-variant-numeric: tabular-nums; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; font-size: 1rem; font-weight: 600; border-radius: 12px; border: 1px solid transparent; cursor: pointer;
}
.button.primary { background: var(--navy); color: #fff; width: 100%; margin-top: 18px; }
.button.primary:hover { background: var(--blue); }
.button.primary:disabled { opacity: 0.7; cursor: progress; }
.button.ghost { background: #fff; color: var(--navy); border-color: var(--line); }
.button.ghost:hover { border-color: var(--blue); }
.link { background: none; border: 0; color: var(--blue); font-size: 0.95rem; margin-top: 14px; cursor: pointer; padding: 6px 0; width: 100%; }

.message { min-height: 1.5em; margin: 12px 0 0; font-size: 0.95rem; }
.message.error { color: var(--red); background: var(--red-soft); padding: 10px 12px; border-radius: 10px; }
.message.warn { color: #8a4b0f; background: var(--orange-soft); padding: 10px 12px; border-radius: 10px; }
.message.ok { color: #1d6b4a; background: var(--green-soft); padding: 10px 12px; border-radius: 10px; }
.message:empty { padding: 0; background: none; }
.caps-warning { color: #8a4b0f; font-size: 0.875rem; margin: 6px 0 0; }

.spinner {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff;
  animation: spin 0.8s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.step {
  display: inline-flex; width: 24px; height: 24px; border-radius: 50%; align-items: center; justify-content: center;
  background: var(--blue-soft); color: var(--navy); font-size: 0.85rem; margin-right: 6px;
}
.qr { background: #fff; padding: 8px; border: 1px solid var(--line); border-radius: 12px; display: inline-block; margin: 6px 0 10px; }
.qr svg { display: block; width: 200px; height: 200px; }
.secret { font-size: 1rem; word-break: break-all; background: var(--blue-soft); padding: 6px 8px; border-radius: 8px; letter-spacing: 0.08em; }

.shell { display: flex; }
.sidebar {
  width: 220px; flex-shrink: 0; background: var(--card); border-right: 1px solid var(--line);
  padding: 22px 14px; min-height: 100vh; display: flex; flex-direction: column; gap: 4px;
}
.nav-item { display: block; padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 500; }
.nav-item.active { background: var(--blue-soft); color: var(--navy); }
.nav-item.soon { color: #a0acb9; }
.content { flex: 1; min-width: 0; padding: 28px 32px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.topbar h1 { margin: 0; }
.account { display: flex; gap: 8px; flex-wrap: wrap; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.cards .card h2 { margin-top: 0; }
.footer { margin-top: 28px; }

dialog { border: 0; padding: 0; }
dialog.card { padding: 28px; }
dialog::backdrop { background: rgba(15, 33, 51, 0.35); }
.row { display: flex; gap: 10px; }
.row .button { flex: 1; margin-top: 18px; }

@media (max-width: 760px) {
  .setup-grid { grid-template-columns: 1fr; gap: 8px; }
  .shell { flex-direction: column; }
  .sidebar { width: 100%; min-height: 0; flex-direction: row; align-items: center; overflow-x: auto; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .brand { margin: 0 10px 0 0; }
  .sidebar .brand-name { display: none; }
  .nav-item { white-space: nowrap; padding: 8px 10px; }
  .content { padding: 20px 16px; }
  .card { padding: 22px; }
}
