/* eventserver dashboard: tokens and shared parts for the login page and the app.
   Direction: DESIGN.md. No inline styles anywhere; values reach the page through
   classes, native progress/meter and SVG attributes. */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/assets/schibsted-grotesk.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ground: #000000;
  --surface: #111111;
  --raised: #2a2a2a;
  --control: #444444;
  --pill: #222222;
  --text: #ffffff;
  --muted: #b4b4b4;
  --faint: #949494;
  --ident: #949494; /* grey until the host is known */
  --fault: #f52346;
  --focus: #ffffff;
  --chart-light: #e6e6e6;
  --chart-grey: #6b6b6b;
  --radius: 20px;
  --gap: 14px;
  --column: 1152px;
  --dur: 120ms;
  --font: "Schibsted Grotesk", system-ui, sans-serif;
}
:root[data-host="se"] { --ident: #00aaff; }
:root[data-host="de"] { --ident: #ecc824; }

*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--ground);
  color: var(--text);
  font: 400 14px/1.45 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body { margin: 0; min-height: 100vh; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.icon { width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: -3px; }

/* The ident plate: filled with the host hue and a black code = where you are. */
.plate {
  display: inline-grid; place-items: center;
  background: var(--ident); color: #000;
  font-weight: 700; line-height: 1; letter-spacing: 0.02em;
  border-radius: 6px; text-decoration: none;
}
.plate--bar { height: 28px; min-width: 42px; padding: 0 8px; font-size: 15px; }
.plate--other {
  background: transparent; color: var(--muted);
  border: 1.5px solid var(--control);
}

/* Pills: neutral attention, solid fault. */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 24px; padding: 3px 10px; border-radius: 12px;
  background: var(--pill); color: var(--text);
  font-size: 12px; font-weight: 500; line-height: 1.3; white-space: nowrap;
}
.pill--fault { background: var(--fault); color: #000; font-weight: 600; }
.pill .icon { width: 14px; height: 14px; }

/* Buttons. Primary = white pill, destructive confirm = fault pill. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 16px; border: 0; border-radius: 18px;
  background: var(--control); color: var(--text);
  font-weight: 600; white-space: nowrap; text-decoration: none; cursor: pointer;
}
.btn--primary { background: #fff; color: #000; }
.btn--fault { background: var(--fault); color: #000; }
.btn--quiet { background: transparent; color: var(--muted); padding: 0 10px; }
.btn--tall { height: 44px; border-radius: 22px; }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--raised); color: var(--faint); cursor: not-allowed; }
.btn--quiet:disabled { background: transparent; }

/* Fields */
.field { display: grid; gap: 6px; }
.field > span, .field > label { font-size: 12px; font-weight: 500; line-height: 1.3; color: var(--muted); }
.input {
  height: 40px; width: 100%; padding: 0 12px;
  background: var(--ground); color: var(--text);
  border: 1px solid var(--control); border-radius: 10px;
}
.input:focus-visible { outline-offset: 1px; }
.input[aria-invalid="true"] { border-color: var(--fault); }
select.input { appearance: none; padding-right: 32px; }
.field-error { color: var(--fault); font-size: 12px; font-weight: 500; line-height: 1.3; }

.fault-line { display: flex; gap: 8px; align-items: flex-start; color: var(--fault); }
.fault-line .icon { margin-top: 2px; }

@media (prefers-reduced-motion: no-preference) {
  .btn, .input, a, .tab, .count { transition: background-color var(--dur) ease-out, color var(--dur) ease-out, border-color var(--dur) ease-out; }
}
@media (hover: hover) {
  .btn--primary:hover { background: #e6e6e6; }
  .btn:not(.btn--primary):not(.btn--fault):not(.btn--quiet):not(:disabled):hover { background: #555555; }
  .btn--quiet:not(:disabled):hover { color: var(--text); }
  .btn--fault:hover { background: #ff3d5c; }
}
