/* TAM-Workshop · gemeinsames Design
   Konzept: ruhige Business-Präsentation – weißer Grund, dunkelblaue Schrift,
   je eine dezente Akzentfarbe pro TAM-Bereich. */
:root {
  --ink: #0f2a4a;
  --ink-2: #3a5372;
  --muted: #6b7f99;
  --line: #dbe3ee;
  --line-strong: #c3cfdf;
  --surface: #ffffff;
  --wash: #f4f7fb;
  --blue: #1f5fbf;
  --blue-wash: #eaf1fc;
  --green: #1d8a5a;
  --green-wash: #e7f5ee;
  --violet: #6650b4;
  --violet-wash: #f0edfa;
  --danger: #b42318;
  --danger-wash: #fdecea;
  --warn: #9a6100;

  --cat-PU: var(--blue);
  --cat-PU-wash: var(--blue-wash);
  --cat-PEOU: var(--green);
  --cat-PEOU-wash: var(--green-wash);
  --cat-EXT: var(--violet);
  --cat-EXT-wash: var(--violet-wash);

  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 42, 74, .06), 0 2px 8px rgba(15, 42, 74, .05);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
}
h1, h2, h3 { line-height: 1.2; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 55%, transparent); outline-offset: 2px; }

.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--wash); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #18406e; }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-green:hover { background: #17754c; }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.btn-danger:hover { background: var(--danger-wash); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: #8f1c13; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--wash); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn-lg { min-height: 56px; padding: 0 26px; font-size: 18px; }
.btn-block { width: 100%; }

/* ---------- Formulare ---------- */
.field {
  width: 100%; border: 1.5px solid var(--line-strong); border-radius: 8px;
  padding: 12px 14px; background: var(--surface); font-size: 17px;
}
.field:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px var(--blue-wash); }
textarea.field { resize: vertical; min-height: 110px; line-height: 1.45; }
label.lbl { display: block; font-weight: 600; margin-bottom: 6px; }

/* ---------- Toast ---------- */
.toast-wrap {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px max(16px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  pointer-events: none;
}
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 14px;
  max-width: 560px; padding: 12px 16px; border-radius: 10px;
  background: var(--ink); color: #fff; box-shadow: 0 6px 24px rgba(15, 42, 74, .25);
  animation: toast-in .2s ease-out;
}
.toast.is-ok { background: var(--green); }
.toast.is-error { background: var(--danger); }
.toast button { background: transparent; border: 1px solid rgba(255,255,255,.5); color: #fff; border-radius: 6px; padding: 4px 10px; cursor: pointer; font-weight: 600; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* ---------- Dialog ---------- */
dialog.dlg {
  border: none; border-radius: 14px; padding: 0; width: min(520px, calc(100vw - 32px));
  box-shadow: 0 20px 60px rgba(15, 42, 74, .3); color: var(--ink);
}
dialog.dlg::backdrop { background: rgba(15, 42, 74, .45); }
.dlg-body { padding: 24px; display: grid; gap: 16px; }
.dlg-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- Status-Punkt ---------- */
.live { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.live::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.live.is-on::before { background: var(--green); box-shadow: 0 0 0 4px var(--green-wash); }
.live.is-off::before { background: var(--warn); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
