/* Valderas v2 language for the portal: ink on paper, colour only in tags and status. */
@font-face { font-family: 'Instrument Sans'; src: url('/static/fonts/instrument-sans-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('/static/fonts/instrument-sans-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('/static/fonts/instrument-sans-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/static/fonts/jetbrains-mono-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }

:root {
  --ink: #0a0a0a;
  --paper: #fafafa;
  --white: #ffffff;
  --g-100: #f0f0f0;
  --g-150: #ededed;
  --g-200: #e5e5e5;
  --g-300: #d4d4d4;
  --g-500: #6b6b6b;
  --g-600: #525252;
  --g-800: #262626;
  --live: #1f9d55;
  --t-preview: #e6ecf7; --i-preview: #2c4676;
  --t-live: #e5f0e7;    --i-live: #2e5a3b;
  --t-bad: #f6e7ea;     --i-bad: #76303e;
  --t-wait: #f5edda;    --i-wait: #74501d;
  --t-a: #ece7f5;       --i-a: #4a3a76;
  --t-b: #e4eff0;       --i-b: #235559;
  --notch: 2px 8px 8px 8px;
  --sans: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
/* The hidden attribute always wins over component display rules (.btn, .toolbar, ...). */
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/1.5 var(--sans); }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: rgba(10, 10, 10, 0.35); }
a:hover { text-decoration-color: var(--ink); }
h1, h2, h3 { margin: 0; font-weight: 600; text-wrap: balance; }
p { margin: 0; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--g-600); }
.small { font-size: 13px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons: pills that invert on hover. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 100px; border: 1px solid var(--ink); font: 500 14px/1 var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .3s var(--ease), color .3s var(--ease); }
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--paper); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-off, .btn:disabled { background: var(--g-200); border-color: var(--g-200); color: var(--g-600); cursor: not-allowed; }
.btn-sm { height: 32px; padding: 0 14px; font-size: 13px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn-block { width: 100%; }
.link-btn { border: 0; background: transparent; padding: 4px 0; font: 500 14px/1.4 var(--sans); color: var(--ink); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(10, 10, 10, 0.35); }

/* Tags: the notch shape; colour only here. */
.tag { display: inline-flex; align-items: center; gap: 6px; font: 500 12px/1 var(--sans); padding: 5px 8px; border-radius: var(--notch); background: var(--g-150); color: var(--g-800); white-space: nowrap; }
.tag-preview { background: var(--t-preview); color: var(--i-preview); }
.tag-live { background: var(--t-live); color: var(--i-live); }
.tag-bad { background: var(--t-bad); color: var(--i-bad); }
.tag-wait { background: var(--t-wait); color: var(--i-wait); }
.dot { width: 6px; height: 6px; border-radius: 99px; background: currentColor; flex: none; }
.dot-live { background: var(--live); }

/* Fields. */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 13px; font-weight: 500; }
.input { height: 48px; padding: 0 16px; border: 1px solid var(--g-300); border-radius: 12px; background: var(--white); font: 400 15px/1 var(--sans); color: var(--ink); }
.input::placeholder { color: #8a8a8a; }
.error-text { color: var(--i-bad); font-size: 13px; }

/* App shell. */
.topbar { min-height: 56px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 0 20px; background: var(--paper); border-bottom: 1px solid var(--g-200); }
.topbar-mark { display: flex; color: var(--ink); }
.topbar-org { font-weight: 600; }
.topbar-nav { display: flex; gap: 18px; font-size: 14px; }
.topbar-nav a { text-decoration: none; color: var(--g-500); }
.topbar-nav a[aria-current="page"] { color: var(--ink); font-weight: 500; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.avatar { width: 30px; height: 30px; border-radius: 999px; background: var(--t-a); color: var(--i-a); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; text-decoration: none; }

/* Phones: mark, organisation (cut off) and avatar on one row, the menu as a compact second row. */
@media (max-width: 759px) {
  .topbar { min-height: 52px; padding: 8px 16px; gap: 6px 12px; }
  .topbar-org { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar-nav { order: 3; flex-basis: 100%; gap: 16px; padding: 2px 0 4px; overflow-x: auto; white-space: nowrap; }
  .topbar-actions { margin-left: 0; }
}

/* Narrow centred column (sign-in, consent). */
body.narrow { padding: 72px max(16px, 2rem) 48px; display: flex; justify-content: center; }
.narrow-main { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 28px; }
.pair { display: flex; align-items: center; gap: 10px; }
.pair-tile { width: 48px; height: 48px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 18px; background: var(--g-150); }
.pair-tile-ink { background: var(--ink); color: var(--paper); }
.pair-line { width: 28px; border-top: 1.5px dashed #a3a3a3; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack-lg { display: flex; flex-direction: column; gap: 24px; }
.h-page { font-size: 28px; line-height: 1.12; letter-spacing: -0.02em; }
.h-display { font-size: 48px; line-height: 1.02; letter-spacing: -0.03em; }
.rule-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.rule-list > li { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--g-200); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
