/* EventHub — wspólne tokeny i elementy. Paleta "scena": granat sceny, bursztyn lampy. */
:root {
  --stage: #10162B;      /* tło sceny */
  --deck: #1A2140;       /* powierzchnie */
  --deck-2: #232C52;     /* powierzchnie podniesione */
  --rail: #2F3A68;       /* linie, obramowania */
  --paper: #F2F4FA;      /* tekst główny */
  --mist: #A9B2D0;       /* tekst drugorzędny */
  --accent: #FFB400;     /* lampa — kolor wydarzenia */
  --on-accent: #10162B;
  --signal: #E5484D;     /* błąd / X */
  --go: #2BB673;         /* poprawnie */
  --a0: #E5484D; --a1: #3E7BFA; --a2: #F5A524; --a3: #2BB673; /* odpowiedzi ABCD */
  --font: 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --r-sm: 6px; --r-md: 12px; --r-lg: 20px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); font-size: 16px; line-height: 1.45;
  background: var(--stage); color: var(--paper);
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  min-height: 44px; padding: 0 18px; border-radius: var(--r-sm);
  border: 1px solid var(--rail); background: var(--deck-2); color: var(--paper);
  font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .12s, border-color .12s, transform .06s;
}
.btn:hover { border-color: var(--mist); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(1.08); border-color: var(--accent); }
.btn-danger { background: transparent; border-color: color-mix(in srgb, var(--signal) 60%, transparent); color: #ff8a8d; }
.btn-go { background: var(--go); border-color: var(--go); color: #062b18; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--mist); }
.btn-ghost:hover { color: var(--paper); border-color: var(--rail); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 14px; }

.field { display: grid; gap: 6px; }
.field > span { font-size: 14px; color: var(--mist); }
.input, textarea.input, select.input {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--rail); background: var(--stage); color: var(--paper);
}
textarea.input { resize: vertical; min-height: 88px; }
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { appearance: none; width: 42px; height: 24px; border-radius: 12px; background: var(--rail); position: relative; cursor: pointer; transition: background .15s; margin: 0; flex: none; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--paper); transition: transform .15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(18px); background: var(--on-accent); }

#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 1000; width: min(92vw, 440px); pointer-events: none; }
.toast { padding: 12px 16px; border-radius: var(--r-sm); background: var(--paper); color: var(--stage); font-weight: 600; box-shadow: 0 8px 30px rgba(0,0,0,.35); animation: toast-in .18s ease-out; }
.toast-error { background: var(--signal); color: #fff; }
.toast-ok { background: var(--go); color: #062b18; }
.toast.out { opacity: 0; transition: opacity .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.conn { position: fixed; top: 0; left: 0; right: 0; padding: 6px; text-align: center; font-size: 14px; background: var(--signal); color: #fff; z-index: 999; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
