/* Same look as the other services: keep the variables and controls in step with
   web/style.css. See docs/ui-ux.md. */
:root {
  color-scheme: light dark;
  --page: light-dark(#f6effa, #1d0b21);
  --field: light-dark(#ffffff, #2b1430);
  --ink: light-dark(#2b1030, #f7eefa);
  --muted: light-dark(#6b5270, #bda6c3);
  --line: light-dark(#d9c8e0, #4b3052);
  --accent: light-dark(#c2184f, #ff7aa5);
  --on-accent: light-dark(#ffffff, #2b1030);
  --good: light-dark(#0f6b63, #62d2c6);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 1rem/1.5 ui-rounded, "SF Pro Rounded", Quicksand, Nunito, "Segoe UI", system-ui, sans-serif;
}

h1, h2 { margin: 0; line-height: 1.15; text-wrap: balance; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem); font-weight: 800; }
h2 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0; }
a { color: inherit; text-underline-offset: .2em; text-decoration-color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.muted { color: var(--muted); font-size: .9rem; }
.saved { color: var(--good); font-size: .9rem; font-weight: 700; }
.error { color: var(--accent); font-weight: 600; }
.error:empty { display: none; }
.plain { list-style: none; margin: 0; padding: 0; }

.bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; padding: .75rem clamp(1rem, 4vw, 3rem); }
.brand { font-weight: 800; font-size: 1.25rem; text-decoration: none; }

/* Controls */
button, .button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.75rem; padding: .4rem 1.1rem;
  border: 2px solid var(--line); border-radius: 999px;
  background: var(--field); color: var(--ink);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
button:hover, .button:hover { border-color: var(--ink); }
button:disabled { cursor: default; opacity: .6; }
.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.quiet { background: none; border-color: transparent; }
.danger { color: var(--accent); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
nav { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; min-width: 0; }

label { font-weight: 700; }
input, textarea, select {
  width: 100%; padding: .65rem .85rem;
  border: 2px solid var(--line); border-radius: .75rem;
  background: var(--field); color: inherit; font: inherit;
}
textarea { resize: vertical; }
select {
  /* Safari ignores height and padding on its own style, so the arrow is drawn here. */
  appearance: none; min-height: 3rem; padding-right: 2.5rem;
  background-image: linear-gradient(45deg, transparent 50%, currentcolor 50%), linear-gradient(-45deg, transparent 50%, currentcolor 50%);
  background-position: right 1.35rem center, right 1rem center;
  background-size: .4rem .4rem; background-repeat: no-repeat;
}
fieldset { margin: 0; padding: 0; border: 0; display: grid; gap: .25rem; }
legend { padding: 0; font-weight: 700; margin-bottom: .25rem; }
.inline { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; }
.inline > div { flex: 1 1 12rem; }
.check { display: flex; align-items: center; gap: .6rem; min-height: 2rem; font-weight: 400; cursor: pointer; }
.check input { flex: none; width: 1.25rem; height: 1.25rem; margin: 0; accent-color: var(--accent); }
form { display: grid; gap: .6rem; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }

.notice { display: grid; gap: 1rem; justify-items: start; max-width: 28rem; margin: 10vh auto; padding: 1rem; }
.notice form, .notice .label-row { width: 100%; }
.notice form + form { margin-top: 1.5rem; }

.admin { max-width: 60rem; margin: 0 auto; padding: 1rem clamp(1rem, 4vw, 3rem) 3rem; display: grid; gap: 1rem; }
.admin > section { display: grid; gap: 1rem; min-width: 0; }
.admin h2 { margin-top: 1rem; }
.admin footer { margin-top: 1rem; }
.tabs { justify-content: flex-start; gap: .25rem 1.25rem; }
.tabs a { padding: .6rem 0; border-bottom: 3px solid transparent; font-weight: 700; text-decoration: none; }
.tabs a:hover { border-color: var(--line); }
.tabs a[aria-current] { border-color: var(--accent); }

dl, dd { margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); gap: .75rem; }
.tile { padding: 1rem; border: 2px solid var(--line); border-radius: .75rem; background: var(--field); }
.tile dt { font-size: .9rem; }
.tile .value { font-size: 2rem; line-height: 1.3; font-weight: 800; }
.tile.warn { border-color: var(--accent); }
.facts > div { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-top: 1px solid var(--line); }
.facts dd { font-weight: 700; text-align: right; }

.link { min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; font-weight: inherit; text-align: left; overflow-wrap: anywhere; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: .2em; }
.rows .link { font-weight: 700; }
.events li { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: 0 1rem; padding: .6rem 0; border-top: 1px solid var(--line); }
.events time { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.events .what { font-weight: 700; overflow-wrap: anywhere; }
.events .warn .what { color: var(--accent); }
.admin-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem 1.5rem; padding: 1rem 0; border-top: 1px solid var(--line); }
.admin-list .info { flex: 1 1 18rem; min-width: 0; }
.admin-list .info a { font-weight: 700; font-size: 1.1rem; overflow-wrap: anywhere; }

.side-by-side { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.user-form { display: grid; gap: .5rem; flex: 1 1 100%; }
.badge { padding: .1rem .6rem; border: 2px solid var(--line); border-radius: 999px; font-size: .85rem; font-weight: 700; }
.badge.warn { border-color: var(--accent); color: var(--accent); }
.info .actions { margin-bottom: .25rem; }

/* Cameras need dark on light, also in dark mode */
.qr { width: min(100%, 14rem); padding: .75rem; border-radius: .75rem; background: #fff; }
.qr svg { display: block; width: 100%; }
.qr path { fill: #000; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.code { font-size: 1.5rem; letter-spacing: .3em; font-variant-numeric: tabular-nums; }

@media (max-width: 52rem) {
  .bar .quiet { padding-inline: .6rem; }
  .events li { grid-template-columns: minmax(0, 1fr); }
}
