/* UWFZ Radar — shared tokens and components (visitor site + admin) */
:root {
  --bg: #070a0e;
  --surface: #0d1319;
  --surface-2: #141c24;
  --surface-3: #1c2631;
  --line: rgba(170, 205, 225, .13);
  --line-strong: rgba(170, 205, 225, .28);
  --text: #eaf2f5;
  --muted: #96a7b2;
  --dim: #74848f;
  --speaking: #ffb23e;
  --popup: #7ab2dd;
  --drop: #ff5c7a;
  --ok: #57e39b;
  --danger: #ff7a7a;
  --font-display: 'Anton', 'Arial Narrow', Impact, sans-serif;
  --font-body: 'Work Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
  --r: 12px;
  --r-sm: 7px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --top-h: 60px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, video, iframe { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

[data-type="speaking"] { --c: var(--speaking); }
[data-type="popup"] { --c: var(--popup); }
[data-type="drop"] { --c: var(--drop); }

/* type glyph: circle = speaking, diamond = pop-up, teardrop = drop (shape as well as color) */
.glyph { display: inline-block; width: 9px; height: 9px; background: var(--c, var(--muted)); border-radius: 50%; flex: none; }
[data-type="popup"] > .glyph, .glyph[data-type="popup"] { border-radius: 1.5px; transform: rotate(45deg) scale(.9); }
[data-type="drop"] > .glyph, .glyph[data-type="drop"] { border-radius: 0 50% 50% 50%; transform: rotate(45deg); }

.tag {
  display: inline-flex; align-items: center; gap: 7px;
  font: 600 11px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase;
  color: var(--c, var(--muted));
}

.flag-sample { font: 600 10px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 4px 7px; border: 1px dashed var(--line-strong); border-radius: 999px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: transparent; color: var(--text);
  font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .15s var(--ease);
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn:active { transform: scale(.97); }
.btn--solid { background: var(--text); color: #070a0e; border-color: var(--text); }
.btn--solid:hover { background: #fff; border-color: #fff; }
.btn--quiet { border-color: transparent; color: var(--muted); padding: 0 12px; }
.btn--quiet:hover { color: var(--text); border-color: transparent; }
.btn--danger { color: var(--danger); }
.btn--sm { min-height: 36px; padding: 0 13px; font-size: 13px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* segmented control */
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button, .seg label {
  min-height: 38px; padding: 0 16px; border-radius: 999px; display: inline-flex; align-items: center; gap: 7px;
  font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; transition: color .15s, background .15s;
}
.seg button[aria-selected="true"], .seg button[aria-pressed="true"], .seg input:checked + label { background: var(--text); color: #070a0e; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:focus-visible + label { outline: 2px solid var(--text); outline-offset: 2px; }

/* form fields */
.field { display: grid; gap: 6px; }
.field > span, .label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field small { color: var(--dim); font-size: 12.5px; }
.input, .field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .field textarea, .field select {
  width: 100%; min-height: 46px; padding: 10px 13px; border-radius: var(--r-sm);
  background: var(--bg); border: 1px solid var(--line-strong); color: var(--text); font-size: 16px;
}
.field textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus, .input:focus { outline: none; border-color: var(--text); }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--text); flex: none; }

/* dialogs */
dialog { border: 0; padding: 0; background: var(--surface); color: var(--text); }
dialog::backdrop { background: rgba(3, 6, 9, .82); }
dialog.sheet {
  margin: 0 0 0 auto; width: min(720px, 100%); max-width: none;
  height: 100dvh; max-height: none; overflow: auto; overscroll-behavior: contain;
  border-left: 1px solid var(--line);
}
dialog.sheet[open] { animation: sheet-in .3s var(--ease); }
dialog.modal {
  width: min(500px, calc(100% - 24px)); max-height: calc(100dvh - 24px); overflow: auto;
  border-radius: var(--r); border: 1px solid var(--line-strong);
}
dialog.modal[open] { animation: modal-in .22s var(--ease); }
@keyframes sheet-in { from { transform: translateX(40px); opacity: 0; } }
@keyframes modal-in { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.close-x {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(7, 10, 14, .7); border: 1px solid var(--line-strong); font-size: 20px; line-height: 1;
}
.close-x:hover { background: var(--surface-3); }

/* toasts */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 3000; display: grid; gap: 8px; width: max-content; max-width: calc(100vw - 32px); }
.toast {
  background: var(--text); color: #070a0e; font-weight: 600; font-size: 14px;
  padding: 12px 18px; border-radius: 999px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  animation: modal-in .22s var(--ease); transition: opacity .3s, transform .3s;
}
.toast.is-out { opacity: 0; transform: translateY(6px); }

/* map (Leaflet) dark treatment + pins */
.leaflet-container { background: #0a1016; font-family: var(--font-body); }
.leaflet-tile-pane { filter: invert(1) hue-rotate(185deg) saturate(.35) brightness(.82) contrast(.92); }
.leaflet-control-attribution { background: rgba(7, 10, 14, .75) !important; color: var(--dim) !important; font-size: 10px; }
.leaflet-control-attribution a { color: var(--muted) !important; }
.leaflet-bar { border: 1px solid var(--line-strong) !important; box-shadow: none !important; border-radius: 10px !important; overflow: hidden; }
.leaflet-bar a { background: var(--surface) !important; color: var(--text) !important; border-color: var(--line) !important; width: 38px !important; height: 38px !important; line-height: 38px !important; }
.leaflet-bar a:hover { background: var(--surface-3) !important; }

.pin { display: block; width: 30px; height: 30px; position: relative; cursor: pointer; }
.pin i { position: absolute; inset: 9px; background: var(--c); border-radius: 50%; box-shadow: 0 0 0 2.5px #070a0e; transition: transform .2s var(--ease); }
.pin[data-type="popup"] i { border-radius: 2px; transform: rotate(45deg); }
.pin[data-type="drop"] i { border-radius: 0 50% 50% 50%; transform: rotate(45deg); }
.pin::before, .pin::after {
  content: ''; position: absolute; inset: 9px; border-radius: 50%; border: 1.5px solid var(--c);
  pointer-events: none; display: none;
}

.pin.is-hot i { transform: scale(1.5); }
.pin[data-type="popup"].is-hot i, .pin[data-type="drop"].is-hot i { transform: rotate(45deg) scale(1.5); }
@keyframes ping { from { transform: scale(1); opacity: .85; } to { transform: scale(3.8); opacity: 0; } }

/* only the next event on the map pings */
@media (prefers-reduced-motion: no-preference) {
  .pin.is-next::before, .pin.is-next::after { display: block; animation: ping 3s infinite cubic-bezier(0, .5, .4, 1); }
  .pin.is-next::after { animation-delay: 1.5s; }
}

/* the parts the browser draws */
::selection { background: var(--popup); color: #070a0e; }
:root { caret-color: var(--popup); scrollbar-color: var(--surface-3) transparent; -webkit-tap-highlight-color: transparent; }
::placeholder { color: var(--dim); opacity: 1; }
a { text-underline-offset: .18em; }
a, button, label, summary { touch-action: manipulation; }
.ic { display: block; flex: none; }
.btn .ic { width: 16px; height: 16px; }

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