/* fit-makker: bos-thema.
   Same roles as Catppuccin (base, mantle, crust, surface, text, subtext,
   overlay, accents), forest tints. Contrast figures are in docs/03-schermen.md.
   Accent colours reach 4.5:1 on base and mantle only: on surface0 use --text. */

:root {
  --base: #f4efe6;
  --mantle: #ebe4d6;
  --crust: #dfd6c4;
  --surface0: #d6ccb8;
  --text: #2f2a22;
  --subtext: #5b5345;
  --overlay: #7a715f;
  --green: #3f6b3a;
  --brown: #7a5230;
  --amber: #8a5a0f;
  --red: #a13a28;
  --blue: #2f6585;
  --berry: #7d4a6b;
  --teal: #2c6e63;
  --on-accent: #ffffff;
  --radius: 14px;
  --gap: 16px;
  color-scheme: light;
}

:root[data-theme="donker"] {
  --base: #262b24;
  --mantle: #20241f;
  --crust: #1a1d19;
  --surface0: #343b31;
  --text: #e4dfd0;
  --subtext: #b9b3a2;
  --overlay: #928e7e;
  --green: #a3c585;
  --brown: #d0a276;
  --amber: #e0b867;
  --red: #e08a76;
  --blue: #8fb8cf;
  --berry: #c9a0bd;
  --teal: #86c5b6;
  --on-accent: #1a1d19;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="licht"]) {
    --base: #262b24;
    --mantle: #20241f;
    --crust: #1a1d19;
    --surface0: #343b31;
    --text: #e4dfd0;
    --subtext: #b9b3a2;
    --overlay: #928e7e;
    --green: #a3c585;
    --brown: #d0a276;
    --amber: #e0b867;
    --red: #e08a76;
    --blue: #8fb8cf;
    --berry: #c9a0bd;
    --teal: #86c5b6;
    --on-accent: #1a1d19;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--base);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}

a { color: var(--green); }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

h1, h2 { line-height: 1.25; margin: 0 0 12px; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; }
p { margin: 0 0 12px; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.95em; }

.muted { color: var(--subtext); font-size: 0.92rem; }

/* Layout */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px var(--gap);
  padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--crust);
}
.brand { color: var(--text); font-weight: 700; text-decoration: none; }
.brand i { color: var(--green); }

.page {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: var(--gap);
  flex: 1;
}
.narrow .page { max-width: 440px; }
.page-title { margin-bottom: var(--gap); }
.page-title::first-letter { text-transform: uppercase; }

.card {
  background: var(--mantle);
  border-radius: var(--radius);
  padding: var(--gap);
  margin-bottom: var(--gap);
}
.card > :last-child { margin-bottom: 0; }

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  justify-content: center;
  padding: 8px var(--gap) 16px;
  color: var(--subtext);
  font-size: 0.85rem;
}
.footer a { color: var(--subtext); }

/* Bottom tabs */
.tabs {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  background: var(--crust);
  border-top: 1px solid var(--surface0);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--subtext);
  text-decoration: none;
  font-size: 0.78rem;
}
.tab i { font-size: 1.15rem; }
.tab.is-active { color: var(--green); font-weight: 700; }

/* Forms */
.stack { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.inline { display: inline; margin: 0; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
input:not([type="hidden"]) {
  font: inherit;
  color: var(--text);
  background: var(--surface0);
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 12px;
  min-height: 48px;
  width: 100%;
}
input:focus { border-color: var(--green); }
.code-input { font-size: 1.4rem; letter-spacing: 0.15em; text-align: center; font-variant-numeric: tabular-nums; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 18px;
  border: 0;
  border-radius: 10px;
  background: var(--green);
  color: var(--on-accent);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.button-quiet { background: transparent; color: var(--green); border: 2px solid var(--surface0); }
.button-danger { background: var(--red); color: var(--on-accent); }
.button-small { min-height: 44px; padding: 6px 12px; font-size: 0.9rem; }
.button.is-done { border-color: var(--green); }

.icon-button {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
}

.segmented { display: flex; gap: 8px; }
.segmented button {
  flex: 1;
  min-height: 44px;
  border: 2px solid var(--surface0);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.segmented button.is-active { border-color: var(--green); color: var(--green); font-weight: 700; }

/* Notices: never colour alone, always an icon and text too */
.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 10px;
  border-left: 5px solid var(--overlay);
  background: var(--base);
}
.notice i { margin-top: 4px; }
.notice-ok { border-left-color: var(--green); }
.notice-ok i { color: var(--green); }
.notice-warn { border-left-color: var(--amber); }
.notice-warn i { color: var(--amber); }
.notice-error { border-left-color: var(--red); }
.notice-error i { color: var(--red); }

/* Lists */
.rows { list-style: none; margin: 0 0 12px; padding: 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 0; margin: 0; }
.rows .row + .row { border-top: 1px solid var(--surface0); }
.row-main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }

.dot {
  flex: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--on-accent);
  background: var(--overlay);
}
.dot-ok { background: var(--green); }
.dot-warn { background: var(--amber); }
.dot-error { background: var(--red); }

.menu { padding: 0; overflow: hidden; }
.menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 var(--gap);
  color: var(--text);
  text-decoration: none;
}
.menu a + a { border-top: 1px solid var(--surface0); }
.menu a i:first-child { color: var(--green); width: 22px; text-align: center; }
.menu .chev { margin-left: auto; color: var(--overlay); font-size: 0.8rem; }

details { margin-bottom: 12px; }
/* list-item keeps the browser's own disclosure triangle and semantics */
summary { cursor: pointer; display: list-item; padding: 10px 0; color: var(--green); font-weight: 600; }
details[open] summary { margin-bottom: 8px; }

.steps { margin: 0 0 12px; padding-left: 20px; }
.qr { display: block; margin: 0 auto 12px; background: #ffffff; border-radius: 10px; padding: 6px; max-width: 100%; height: auto; }
.secret { display: block; padding: 10px; border-radius: 8px; background: var(--surface0); overflow-wrap: anywhere; user-select: all; }
.codes { list-style: none; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.codes code { display: block; padding: 8px; border-radius: 8px; background: var(--surface0); text-align: center; font-variant-numeric: tabular-nums; }

@media (min-width: 720px) {
  body { padding-bottom: 0; }
  .tabs { position: static; order: -1; border-top: 0; justify-content: center; }
  .tabs .tab { flex: none; flex-direction: row; gap: 8px; padding: 0 20px; font-size: 0.95rem; }
  .topbar { order: -2; }
}
