/* Relay — shared design tokens and base components.
   Used by app.html and login.html. */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,600;1,9..144,500&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --ink: #1c1c1e; --ink-soft: #6b6b70; --ink-faint: #a5a5aa;
  --paper: #f7f6f3; --surface: #ffffff; --surface-sunk: #efeeea;
  --line: #dcdbd5; --line-strong: #bfbeb7;
  --accent: #3d5c78; --accent-bright: #4d719b; --accent-soft: #e9eef2;
  --signal: #3d5c78; --signal-soft: #e9eef2;
  --ok: #6b6b70; --ok-soft: #efeeea;
  --crit: #3d5c78; --crit-soft: #e9eef2;
  --danger: #8c3b32;
  --on-accent: #f7f6f3;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #eeeeef; --ink-soft: #a3a3a8; --ink-faint: #6c6c72;
    --paper: #101012; --surface: #17171a; --surface-sunk: #0c0c0e;
    --line: #2b2b2f; --line-strong: #3d3d42;
    --accent: #8fb0c9; --accent-bright: #a8c4d9; --accent-soft: #1c2830;
    --signal: #8fb0c9; --signal-soft: #1c2830;
    --ok: #a3a3a8; --ok-soft: #0c0c0e;
    --crit: #8fb0c9; --crit-soft: #1c2830;
    --danger: #d98b81;
    --on-accent: #101012;
  }
}
:root[data-theme="dark"] {
  --ink: #eeeeef; --ink-soft: #a3a3a8; --ink-faint: #6c6c72;
  --paper: #101012; --surface: #17171a; --surface-sunk: #0c0c0e;
  --line: #2b2b2f; --line-strong: #3d3d42;
  --accent: #8fb0c9; --accent-bright: #a8c4d9; --accent-soft: #1c2830;
  --signal: #8fb0c9; --signal-soft: #1c2830;
  --ok: #a3a3a8; --ok-soft: #0c0c0e;
  --crit: #8fb0c9; --crit-soft: #1c2830;
  --danger: #d98b81;
  --on-accent: #101012;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 14px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
code, .mono { font-family: var(--mono); }

/* --- brand mark --- */
.brand {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--serif); font-weight: 600; font-size: 17px;
  text-decoration: none; color: var(--ink);
}
.brand .mark {
  width: 24px; height: 24px; flex: none; border-radius: 6px;
  background: #f7f5f0; padding: 3px; display: inline-flex;
}
.brand .mark img { width: 100%; height: 100%; display: block; }

/* --- buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  padding: 9px 15px; border-radius: 8px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none;
}
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover:not(:disabled) { background: var(--accent-bright); }
.btn.ghost { border-color: var(--line-strong); background: var(--surface); color: var(--ink); }
.btn.ghost:hover:not(:disabled) { border-color: var(--ink-faint); }
.btn.danger { border-color: var(--line-strong); background: var(--surface); color: var(--danger); }
.btn.sm { padding: 6px 11px; font-size: 12.5px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.block { width: 100%; }

/* --- forms --- */
input[type="text"], input[type="url"], input[type="email"], input[type="password"] {
  font-family: var(--sans); font-size: 13.5px; padding: 10px 12px;
  border-radius: 7px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); width: 100%;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
label.field-label {
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--ink-soft); margin-bottom: 6px;
}
.field { margin-bottom: 14px; }

/* --- cards / badges --- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 22px 24px; margin-bottom: 18px;
}
.card h3 { font-size: 14.5px; margin: 0 0 4px; font-weight: 600; }
.card .desc { font-size: 13px; color: var(--ink-soft); margin: 0 0 16px; }

.badge {
  font-family: var(--mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .05em; padding: 3px 8px; border-radius: 999px; font-weight: 600;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--signal-soft); color: var(--signal); }
.badge.locked { background: var(--surface-sunk); color: var(--ink-faint); }

.notice {
  border-radius: 8px; padding: 10px 13px; font-size: 13px; margin-bottom: 14px;
  border: 1px solid var(--line-strong); background: var(--surface-sunk); color: var(--ink-soft);
}
.notice.error { color: var(--danger); border-color: var(--danger); background: transparent; }
.notice.good { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.toast {
  position: fixed; bottom: 22px; right: 22px; background: var(--ink); color: var(--paper);
  font-size: 13px; padding: 10px 16px; border-radius: 8px; opacity: 0;
  transform: translateY(6px); transition: all .18s ease; pointer-events: none; z-index: 100;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* --- config warning banner --- */
.config-warn {
  background: var(--danger); color: #fff; padding: 10px 18px;
  font-size: 13px; text-align: center;
}
.config-warn code { background: rgba(255,255,255,.18); padding: 1px 5px; border-radius: 4px; }
