/* Sucheinsatz-Dashboard – itfog-Gestaltung (Nebel, Tinte, Signalorange). */

@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-wdth.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --bg: #DCE2E3;
  --paper: #EBEFF0;
  --field: #F7F9F9;
  --fg: #13293D;
  --muted: #566A73;
  --border: #9DB0B7;
  --rule: #13293D;
  --accent: #E8590C;
  --accent-ink: #B8440A;
  --btn: #13293D;
  --btn-fg: #F7F9F9;
  --danger: #C62828;
  --ok: #2E7D4F;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Dunkle Variante: Tinte als Grund, für Nachteinsätze. */
:root[data-theme="dark"] {
  --bg: #0E1F2E; --paper: #15293A; --field: #0A1824; --fg: #DCE2E3; --muted: #93A6AE;
  --border: #355064; --rule: #9DB0B7; --accent: #F2702A; --accent-ink: #F2702A;
  --btn: #DCE2E3; --btn-fg: #0E1F2E; --danger: #FF6B6B; --ok: #5BC48A;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1F2E; --paper: #15293A; --field: #0A1824; --fg: #DCE2E3; --muted: #93A6AE;
    --border: #355064; --rule: #9DB0B7; --accent: #F2702A; --accent-ink: #F2702A;
    --btn: #DCE2E3; --btn-fg: #0E1F2E; --danger: #FF6B6B; --ok: #5BC48A;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-variation-settings: "wdth" 100;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 56px max(16px, env(safe-area-inset-left));
}

h1 {
  font-size: clamp(1.75rem, 7vw, 2.5rem);
  line-height: 1.05;
  font-weight: 800;
  font-variation-settings: "wdth" 125;
  letter-spacing: -.02em;
  margin: 0 0 6px;
}
h2 {
  font-size: 1.2rem;
  font-weight: 700;
  font-variation-settings: "wdth" 112;
  margin: 24px 0 8px;
}
p { margin: 8px 0; }
.muted { color: var(--muted); font-size: .94rem; }
a { color: var(--accent-ink); text-underline-offset: .18em; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Kopfzeile mit Herkunft itfog */
.brand {
  display: inline-block;
  margin-bottom: 18px;
  font-weight: 800;
  font-variation-settings: "wdth" 125;
  font-size: 1rem;
  color: var(--fg);
  text-decoration: none;
}
.brand::before {
  content: "";
  display: inline-block;
  width: .6rem; height: .6rem;
  margin-right: .45rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--accent);
  vertical-align: .05em;
}

.hero-code {
  display: block;
  font-size: clamp(4.5rem, 26vw, 8rem);
  line-height: .82;
  font-weight: 800;
  font-variation-settings: "wdth" 125;
  letter-spacing: -.04em;
  color: var(--accent);
  margin: 0 0 10px;
}

/* Abschnitte statt Karten: eine Linie oben, keine Schatten. */
.card {
  border-top: 1.5px solid var(--rule);
  padding: 18px 0 8px;
  margin: 28px 0 0;
}
.card h2:first-child { margin-top: 0; }
.card.primary {
  border-top: 0;
  background: var(--paper);
  border-radius: 14px;
  padding: 20px 18px;
  margin-top: 22px;
}

label { display: block; font-size: .9rem; font-weight: 600; color: var(--muted); margin: 14px 0 6px; }
input, select, button {
  font: inherit;
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--field);
  color: var(--fg);
  font-size: 1rem; /* ≥16px: kein Auto-Zoom auf iOS */
}
input:focus, select:focus { outline: 3px solid var(--accent); outline-offset: 0; border-color: transparent; }
button {
  background: var(--btn);
  color: var(--btn-fg);
  border: 1.5px solid var(--btn);
  font-weight: 600;
  cursor: pointer;
  margin-top: 14px;
  min-height: 48px;
  border-radius: 999px;
  touch-action: manipulation;
}
button:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
button.secondary { background: transparent; color: var(--fg); border-color: var(--border); }
button.secondary:hover { border-color: var(--fg); background: transparent; color: var(--fg); }
button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
button:disabled { opacity: .5; cursor: not-allowed; }
a > button { display: block; }
a:has(> button), #ssoLogin, #ssoLink { text-decoration: none; }

.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 130px; }

/* Umschalter Einsätze / Einstellungen */
.tabs {
  display: flex;
  gap: 4px;
  margin: 16px 0 0;
  padding: 4px;
  border-radius: 999px;
  background: var(--paper);
}
.tabs button { width: auto; flex: 1; margin-top: 0; min-height: 44px; border: 0; }
.tabs button.secondary { background: transparent; font-weight: 500; color: var(--muted); }
.tabs button.secondary:hover { color: var(--fg); }

.note {
  background: var(--paper);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 12px 14px;
  font-size: .94rem;
  margin: 12px 0;
}
.msg { margin-top: 10px; font-size: .94rem; min-height: 1.2em; }
.msg.err { color: var(--danger); }
.msg.ok { color: var(--ok); }

.topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.topbar h1 { flex: 0 1 auto; margin: 0; }
.topbar-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.topbar-actions .theme-toggle { width: auto; white-space: nowrap; }
.theme-toggle {
  width: auto; min-width: 44px; min-height: 44px; padding: 8px 16px; margin: 0;
  background: transparent; color: var(--fg); border: 1.5px solid var(--border);
}

/* Einsatzliste */
.oplist { list-style: none; padding: 0; margin: 8px 0 0; }
.oplist li {
  background: var(--paper);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}
.oplist li.muted { background: transparent; padding: 4px 0; }
.oplist li strong { font-size: 1.1rem; font-variation-settings: "wdth" 112; }
.oplist .share { font-size: .85rem; word-break: break-all; }
.badge {
  font-size: .8rem; font-weight: 600;
  padding: 3px 10px; border-radius: 999px;
  border: 1.5px solid var(--border); color: var(--muted);
  flex: 0 0 auto !important; min-width: 0 !important;
}
.badge.on { border-color: var(--accent); color: var(--accent-ink); }
.hidden { display: none !important; }

.linkrow { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.linklabel { font-size: .9rem; font-weight: 600; margin-bottom: 4px; }
.linkrow .share { margin-bottom: 4px; }
section { margin: 0; }

.modal { position: fixed; inset: 0; z-index: 2000; background: rgba(14, 31, 46, .7); display: none; align-items: center; justify-content: center; padding: 16px; }
.modal.on { display: flex; }
.modal .box { background: var(--bg); color: var(--fg); border-radius: 18px; padding: 22px; width: min(340px, 100%); text-align: center; }
.modal .qrimg { width: 240px; height: 240px; max-width: 100%; image-rendering: pixelated; background: #fff; border-radius: 10px; padding: 10px; }
.modal .qrurl { font-size: .8rem; word-break: break-all; margin: 10px 0; color: var(--muted); }

/* Code-Eingabe auf der Startseite */
.code-input {
  font-size: 2rem !important;
  font-weight: 700;
  font-variation-settings: "wdth" 125;
  letter-spacing: .45em;
  text-align: center;
  padding-left: .45em !important;
}

.foot { margin-top: 40px; color: var(--muted); font-size: .88rem; }
.foot a { color: inherit; }

@media (max-width: 30rem) {
  .card.primary { margin-left: -6px; margin-right: -6px; }
}
