/* VenaPass console. Tokens follow the VenaPass design system; light and dark. */
:root {
  --bg: #f4f7f6; --surface: #ffffff; --ink: #0d1b1e; --muted: #4a5e62; --line: #cfdcda;
  --brand: #0b5f5c; --brand-ink: #ffffff; --brand-soft: #dcefeb; --ir: #ff6a3d;
  --ok: #1b7a43; --ok-soft: #e3f2e9; --warn: #8a5a00; --warn-soft: #fbf0d9; --bad: #b3261e; --bad-soft: #fbe4e2;
  --display: 'Sora', 'Avenir Next', system-ui, sans-serif; --text: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace; --r-sm: 8px; --r-md: 12px; --r-lg: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root {
  --bg: #0b1416; --surface: #13211f; --ink: #e7f1ef; --muted: #9db2ae; --line: #2b4c47;
  --brand: #45b8ad; --brand-ink: #04211f; --brand-soft: #16302d;
  --ok: #4cc27f; --ok-soft: #12301f; --warn: #f0b84a; --warn-soft: #33270d; --bad: #ff8a80; --bad-soft: #3a1714;
  color-scheme: dark } }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--text); }
h1, h2 { font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
h1 { font-size: 28px; line-height: 36px; } h2 { font-size: 20px; line-height: 28px; }
p { margin: 0; }
a { color: var(--brand); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.muted { color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; } .row.end { justify-content: flex-end; }

/* Auth pages */
.auth { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 48px 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; color: var(--ink); font: 600 20px var(--display); }
.card { width: 100%; max-width: 480px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 32px; display: flex; flex-direction: column; gap: 20px; }
.card-wide { max-width: 640px; }
.help { color: var(--muted); font-size: 14px; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
label { font-weight: 600; font-size: 14px; line-height: 20px; }
.hint { font-size: 14px; color: var(--muted); }
input, select { font: inherit; min-height: 44px; padding: 10px 12px; border: 1px solid var(--muted); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); width: 100%; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--bad); }
.code-input { font: 24px var(--mono); letter-spacing: 6px; text-align: center; }
.error { color: var(--bad); font-size: 14px; }
fieldset.group { border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 20px 20px; margin: 0; display: flex; flex-direction: column; gap: 16px; }
legend { font-weight: 600; padding: 0 6px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; font-size: 16px; line-height: 24px; min-height: 44px; }
.check input { width: 22px; min-height: 22px; height: 22px; margin-top: 1px; flex: none; accent-color: var(--brand); }
.summary { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 0; }
.summary dt { color: var(--muted); } .summary dd { margin: 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: var(--r-md); border: 1px solid transparent; font: 600 16px var(--text); text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-quiet { background: transparent; color: var(--brand); border-color: var(--line); }
.btn-danger { background: var(--bad); color: #ffffff; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.htmx-request.btn, .htmx-request .btn-primary { opacity: .7; }

/* Feedback */
.notice { padding: 12px 14px; border-radius: var(--r-md); font-size: 15px; }
.notice-info { background: var(--brand-soft); } .notice-warn { background: var(--warn-soft); color: var(--warn); } .notice-error { background: var(--bad-soft); color: var(--bad); }
.banner { padding: 16px 20px; border-radius: var(--r-md); }
.banner-success { background: var(--ok-soft); color: var(--ink); border: 1px solid var(--ok); }
.chip { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 9999px; font-size: 13px; font-weight: 600; }
.chip-sandbox { background: var(--warn-soft); color: var(--warn); } .chip-review { background: var(--brand-soft); color: var(--brand); }
.chip-live { background: var(--ok-soft); color: var(--ok); } .chip-stop { background: var(--bad-soft); color: var(--bad); }

/* Sign-up progress */
.progress { display: flex; flex-direction: column; gap: 8px; }
.progress-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; font-size: 13px; color: var(--muted); }
.steps li { border-top: 4px solid var(--line); padding-top: 6px; }
.steps li.done { border-color: var(--brand); } .steps li.current { border-color: var(--ir); color: var(--ink); font-weight: 600; }

/* Signed-in shell */
.topbar { display: flex; align-items: center; gap: 16px; padding: 10px max(16px, 4vw); background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .org { color: var(--muted); font-weight: 600; }
.menu { margin-left: auto; position: relative; }
.menu summary { list-style: none; cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-md); font-weight: 600; }
.menu summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 6px); width: 260px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; display: flex; flex-direction: column; gap: 10px; z-index: 5; }
.menu-item { width: 100%; justify-content: flex-start; }
.page { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 32px max(16px, 4vw) 64px; display: flex; flex-direction: column; gap: 24px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.checklist li { display: flex; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.checklist li:first-child { border-top: 0; }
.checklist div { display: flex; flex-direction: column; gap: 4px; }
.tick { flex: none; width: 28px; height: 28px; border-radius: 9999px; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand); font-weight: 600; font-size: 14px; }
.checklist li.done .tick { background: var(--ok); color: #ffffff; }

/* Dialog */
.modal-backdrop { position: fixed; inset: 0; background: rgba(4, 12, 13, .55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 20; }
.modal { width: 100%; max-width: 420px; background: var(--surface); border-radius: var(--r-lg); padding: 24px; display: flex; flex-direction: column; gap: 16px; }

.site-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; padding: 16px; color: var(--muted); font-size: 14px; }
.site-footer a { color: var(--muted); display: inline-flex; align-items: center; min-height: 44px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Console navigation, tables and one-time secrets */
.tabs { display: flex; gap: 4px; padding: 0 max(16px, 4vw); background: var(--surface); border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 14px; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--ink); border-color: var(--ir); }
.lead { max-width: 46em; }
details.add > summary { list-style: none; align-self: flex-start; }
details.add > summary::-webkit-details-marker { display: none; }
details.add[open] > summary { margin-bottom: 4px; }
.panel-key { border-color: var(--brand); }
.setup-code { font: 600 clamp(28px, 6vw, 40px)/1.2 var(--mono); letter-spacing: .12em; color: var(--brand); }
.secret { font: 15px/1.5 var(--mono); word-break: break-all; padding: 12px 14px; background: var(--brand-soft); border-radius: var(--r-sm); }
.mono { font-family: var(--mono); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
