/* Champion Cards social media: the server rendered pages (login, dashboard, password, Verbruik).
   The editor's tokens (src/index.css: the same --editor-* RGB triplets, light by default and dark
   when theme-init.js puts `dark` on <html>), so these pages look like the editor and follow its
   theme switch. The header is app-header.css; the class names of the card scanner's stats page are
   a contract with /verbruik (server/pages/verbruik.ts): card, search, field, btn, tiles, tilebox,
   data, report, hint, notice. Fira Sans italic for headings, Poppins for the rest, like the editor. */
:root {
  --editor-bg: 238 237 245;
  --editor-surface: 255 255 255;
  --editor-border: 221 220 233;
  --editor-text: 34 46 80;
  --editor-muted: 75 84 113;
  --editor-accent: 225 29 63;
  --gradient: linear-gradient(135deg, #ff2c4a 0%, #d6102f 100%);
  --field-border: 201 204 216;
  --wash: linear-gradient(to bottom, rgb(255 44 74 / 0.07), rgb(34 46 80 / 0.05) 50%, rgb(238 237 245));
  --shadow: 0 1px 2px rgb(34 46 80 / 0.05);
  /* Notices: a tint and a text color per tone, each at 4.5:1 or more. */
  --info-bg: 232 236 250;
  --info-text: 34 46 80;
  --warn-bg: 255 243 214;
  --warn-text: 138 90 0;
  --error-bg: 253 228 232;
  --error-text: 172 16 16;
  --ok-bg: 222 243 229;
  --ok-text: 23 128 61;
  --radius: 10px;
  color-scheme: light;
}
.dark {
  --editor-bg: 15 20 36;
  --editor-surface: 21 27 36;
  --editor-border: 34 46 80;
  --editor-text: 240 241 247;
  --editor-muted: 160 170 196;
  --editor-accent: 255 44 74;
  --field-border: 52 64 102;
  --wash: linear-gradient(to bottom, rgb(255 44 74 / 0.06), rgb(34 46 80 / 0.3) 50%, rgb(15 20 36));
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3);
  --info-bg: 30 40 70;
  --info-text: 214 222 245;
  --warn-bg: 58 44 12;
  --warn-text: 255 214 128;
  --error-bg: 66 20 30;
  --error-text: 255 170 182;
  --ok-bg: 16 52 34;
  --ok-text: 140 222 168;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: rgb(var(--editor-bg));
  background-image: var(--wash);
  background-attachment: fixed;
  color: rgb(var(--editor-text));
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

h1, h2 { font-family: "Fira Sans", "Poppins", system-ui, sans-serif; font-weight: 600; font-style: italic; line-height: 1.25; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 5vw, 2.1rem); }
h2 { font-size: 1.3rem; }
p { margin: 0 0 .75rem; }
a { color: rgb(var(--editor-accent)); }
.muted { color: rgb(var(--editor-muted)); }
.hint { color: rgb(var(--editor-muted)); font-size: .9rem; }

/* The bar of the pages without a session: only the logo. */
.brandbar {
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px 0; padding-top: max(24px, env(safe-area-inset-top));
}
.brand { display: inline-flex; border-radius: var(--radius); background: #ffffff; padding: 6px 12px; box-shadow: var(--shadow); }
.brand img { display: block; height: 44px; width: auto; }
.brand:focus-visible { outline: 2px solid rgb(var(--editor-accent)); outline-offset: 2px; }

.page { width: 100%; min-width: 0; max-width: 960px; margin: 0 auto; padding: 24px 16px 40px; flex: 1; }
.footer { text-align: center; color: rgb(var(--editor-muted)); font-size: .8rem; padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }

.card {
  background: rgb(var(--editor-surface)); border: 1px solid rgb(var(--editor-border)); border-radius: 1.25rem;
  padding: 20px; margin: 0 0 16px; box-shadow: var(--shadow);
}
.card-narrow { max-width: 420px; margin: 24px auto; }

[hidden] { display: none !important; }
.form { display: grid; gap: 14px; }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: grid; gap: 4px; }
.field > span { font-size: .85rem; color: rgb(var(--editor-muted)); }
.grow { flex: 1; }
img, svg { max-width: 100%; }
input, select {
  min-width: 0;
  font: inherit; color: rgb(var(--editor-text)); background: rgb(var(--editor-surface));
  border: 1px solid rgb(var(--field-border)); border-radius: 10px; padding: 12px; min-height: 48px; width: 100%;
}
input:focus, select:focus { outline: 2px solid rgb(var(--editor-accent) / .45); outline-offset: 1px; border-color: rgb(var(--editor-accent)); }
.btn:focus-visible { outline: 2px solid rgb(var(--editor-accent)); outline-offset: 2px; }

.btn {
  font: inherit; font-weight: 600;
  border: 0; border-radius: 9999px; padding: 12px 20px; min-height: 48px; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.btn-primary { background: rgb(var(--editor-accent)); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { filter: brightness(.92); }
.btn-primary[disabled] { opacity: .6; cursor: wait; }
.btn-ghost { background: transparent; color: rgb(var(--editor-text)); border: 1px solid rgb(var(--editor-border)); }
.btn-ghost:hover { background: rgb(var(--editor-border)); }
.btn-ghost[disabled] { color: rgb(var(--editor-muted)); cursor: not-allowed; }
.btn-wide { width: 100%; }

.search { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.search .field { min-width: 0; flex: 1 1 220px; }

.notice { border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; font-size: .95rem; }
.notice-info { background: rgb(var(--info-bg)); color: rgb(var(--info-text)); }
.notice-warn { background: rgb(var(--warn-bg)); color: rgb(var(--warn-text)); }
.notice-error { background: rgb(var(--error-bg)); color: rgb(var(--error-text)); }
.notice-ok { background: rgb(var(--ok-bg)); color: rgb(var(--ok-text)); }
.notice a { color: inherit; font-weight: 600; }

.check { display: flex; gap: 8px; align-items: center; font-size: .9rem; color: rgb(var(--editor-muted)); margin-top: 6px; }
.check input { width: 18px; min-height: 18px; accent-color: rgb(var(--editor-accent)); }

@media (prefers-reduced-motion: no-preference) {
  .btn, .dash-tile { transition: filter .15s, box-shadow .15s, border-color .15s, background-color .15s; }
}

/* password screens */
.meter { height: 8px; background: rgb(var(--editor-border)); border-radius: 4px; overflow: hidden; margin-top: -6px; }
.meter span { display: block; height: 100%; width: 0; background: rgb(var(--editor-accent)); transition: width .2s; }
.meter span[data-level="ok"] { background: #d99a00; }
.meter span[data-level="strong"] { background: #17803d; }

/* usage page (/verbruik), the scanner's stats markup */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 16px 0; }
.tilebox { background: rgb(var(--editor-bg)); border: 1px solid rgb(var(--editor-border)); border-radius: 14px; padding: 14px; display: grid; gap: 2px; }
.tilebox b { font-family: "Fira Sans", "Poppins", system-ui, sans-serif; font-size: 1.6rem; font-weight: 600; font-style: italic; color: rgb(var(--editor-text)); line-height: 1.2; }
.tilebox span { color: rgb(var(--editor-muted)); font-size: .9rem; }
table.data { border-collapse: collapse; width: 100%; font-size: .95rem; }
table.data th, table.data td { text-align: left; padding: 8px 10px; border-bottom: 1px solid rgb(var(--editor-border)); }
table.data th { font-weight: 600; }
table.data.wide td:not(:first-child), table.data.wide th:not(:first-child) { text-align: right; }
.table-scroll { overflow-x: auto; }
pre.report { background: rgb(var(--editor-bg)); border: 1px solid rgb(var(--editor-border)); border-radius: 14px; padding: 14px; overflow-x: auto; font-size: .85rem; line-height: 1.5; white-space: pre; color: rgb(var(--editor-text)); }

/* dashboard tiles */
.dash-tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin: 16px 0; padding: 0; list-style: none; }
.dash-tile {
  position: relative; display: grid; grid-template-columns: 48px 1fr; gap: 4px 14px; align-items: start; align-content: start;
  background: rgb(var(--editor-surface)); border: 1px solid rgb(var(--editor-border)); border-radius: 1.25rem; padding: 18px;
  color: rgb(var(--editor-text)); text-decoration: none; min-height: 100%; box-shadow: var(--shadow);
}
a.dash-tile:hover { border-color: rgb(var(--editor-accent)); box-shadow: 0 0 0 2px rgb(var(--editor-accent) / .2); }
a.dash-tile:focus-visible { outline: 2px solid rgb(var(--editor-accent)); outline-offset: 2px; border-color: rgb(var(--editor-accent)); }
.dash-icon {
  grid-row: span 2; width: 48px; height: 48px; border-radius: 14px; background: rgb(var(--editor-accent) / .1);
  color: rgb(var(--editor-accent)); display: flex; align-items: center; justify-content: center;
}
.dash-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dash-title { font-weight: 600; font-size: 1.05rem; line-height: 1.3; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dash-text { color: rgb(var(--editor-muted)); font-size: .92rem; line-height: 1.45; }
.dash-ext { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; color: rgb(var(--editor-muted)); }
.dash-tile.is-disabled { background: rgb(var(--editor-bg)); color: rgb(var(--editor-muted)); box-shadow: none; cursor: default; }
.dash-tile.is-disabled .dash-icon { background: rgb(var(--editor-border)); color: rgb(var(--editor-muted)); }
.badge { display: inline-block; font-size: .72rem; font-style: normal; font-weight: 600; letter-spacing: .3px; background: rgb(var(--editor-text)); color: rgb(var(--editor-bg)); border-radius: 999px; padding: 1px 9px; }

@media (max-width: 720px) {
  .page { padding-top: 18px; }
  h1 { margin-bottom: .75rem; }
}

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