/* OD-Sign · gemeinsame Gestaltung. Zwei Grundtöne (Papier, Tinte) und ein Signal: Siegelrot, nur für das Wichtigste. */
:root {
  --papier: #f4f3f0; --papier-2: #ebe9e4; --weiss: #fff; --tinte: #15161a; --tinte-2: #2a2b31; --leise: #6b6b72; --linie: #15161a1f; --linie-2: #15161a33;
  --siegel: #d9452b; --siegel-hell: #fbe9e5; --gut: #1f8a5b; --gut-hell: #e3f3ea; --warn: #b7791f; --warn-hell: #fbf1de;
  --rund: 12px; --rund-gross: 18px; --schatten: 0 1px 2px #15161a14, 0 8px 28px -14px #15161a40;
  --aus: cubic-bezier(.19, 1, .22, 1); --feder: cubic-bezier(.34, 1.56, .64, 1);
  --schrift: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --anzeige: 'Bricolage Grotesque', 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
  --mono: 'DM Mono', ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* Empfängerfarben in fester Reihenfolge */
  --e0: #2f6fde; --e1: #1f9d6b; --e2: #7b4bd6; --e3: #e08a1e; --e4: #148a9c; --e5: #c2417f; --e6: #6f7f1f; --e7: #8a5a3c;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--papier); color: var(--tinte); font: 400 16px/1.5 var(--schrift); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-family: var(--anzeige); font-weight: 640; letter-spacing: -.03em; line-height: 1.08; font-variation-settings: 'opsz' 48; }
h1 { font-size: clamp(26px, 3.2vw, 36px); } h2 { font-size: 22px; } h3 { font-size: 17px; }
p { margin: 0 0 .8em; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--siegel); outline-offset: 2px; }
[hidden] { display: none !important; }
.leise { color: var(--leise); } .klein { font-size: 14px; } .mono { font-family: var(--mono); font-size: 13px; }

/* Marke */
.marke { display: inline-flex; align-items: center; gap: 8px; font-family: var(--anzeige); font-weight: 750; letter-spacing: -.03em; text-decoration: none; font-size: 19px; }
.marke i { width: 18px; height: 18px; border: 3.5px solid var(--siegel); border-radius: 50%; display: inline-block; }

/* Knöpfe */
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
  background: var(--tinte); color: #fff; font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .2s var(--aus), background .2s var(--aus), box-shadow .2s var(--aus); }
.knopf:hover { background: var(--tinte-2); } .knopf:active { transform: scale(.97); }
.knopf.siegel { background: var(--siegel); } .knopf.siegel:hover { background: color-mix(in srgb, var(--siegel) 85%, black); }
.knopf.leer { background: var(--weiss); color: var(--tinte); border-color: var(--linie-2); } .knopf.leer:hover { background: var(--papier-2); }
.knopf.still { background: none; color: var(--tinte); border-color: transparent; } .knopf.still:hover { background: var(--papier-2); }
.knopf.klein { min-height: 32px; padding: 0 12px; font-size: 13.5px; }
.knopf.gefahr { background: var(--weiss); color: var(--siegel); border-color: #d9452b55; }
.knopf[disabled] { opacity: .5; pointer-events: none; }

/* Formulare */
.feldreihe { display: grid; gap: 6px; }
label.titel, .feldreihe > span { font-weight: 600; font-size: 14px; }
input[type=text], input[type=email], input[type=password], input[type=number], input:not([type]), select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--linie-2); border-radius: 10px; background: var(--weiss); font-size: 16px; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--tinte); box-shadow: 0 0 0 3px #15161a14; }
.haken { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.haken input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--tinte); flex: none; }
.meldung { padding: 10px 14px; border-radius: 10px; font-size: 14.5px; }
.meldung.fehler { background: var(--siegel-hell); color: #8f2a17; } .meldung.ok { background: var(--gut-hell); color: #13603e; }

/* Karten und Abzeichen */
.karte { background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--rund-gross); box-shadow: var(--schatten); }
.abz { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--papier-2); color: var(--tinte-2); white-space: nowrap; }
.abz::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .7; }
.abz.entwurf { color: var(--leise); } .abz.unterwegs { background: var(--warn-hell); color: #8a5a10; } .abz.fertig, .abz.unterschrieben { background: var(--gut-hell); color: #13603e; }
.abz.abgelehnt, .abz.storniert { background: var(--siegel-hell); color: #8f2a17; } .abz.angesehen, .abz.offen { background: #e7eefc; color: #1f4fa8; }

/* Hinweis unten */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--tinte); color: #fff; padding: 12px 18px; border-radius: 12px;
  font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .3s var(--aus), transform .3s var(--aus); z-index: 100; max-width: calc(100vw - 32px); }
.toast.an { opacity: 1; transform: translate(-50%, 0); }

/* Dialog */
dialog { border: 0; border-radius: var(--rund-gross); padding: 0; width: min(560px, calc(100vw - 24px)); box-shadow: 0 30px 80px -20px #000a; }
dialog::backdrop { background: #15161a80; }
.dlg { padding: 22px; display: grid; gap: 14px; }
.dlg .reihe { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* Unterschriftsfeld zum Zeichnen */
.pad { width: 100%; height: 200px; border: 1.5px dashed var(--linie-2); border-radius: 12px; touch-action: none; cursor: crosshair;
  background: #fff linear-gradient(transparent 72%, #15161a26 72%, #15161a26 calc(72% + 1px), transparent calc(72% + 1px)); }

/* PDF-Seiten mit Feldern */
.seiten { display: grid; gap: 18px; }
.seite { position: relative; background: #fff; box-shadow: 0 1px 0 var(--linie), 0 10px 30px -18px #15161a66; border-radius: 4px; overflow: hidden; }
.seite canvas { display: block; width: 100%; height: 100%; }
.seite .schicht { position: absolute; inset: 0; }
.seite .nr { position: absolute; right: 8px; bottom: 6px; font: 600 11px var(--mono); color: var(--leise); background: #fffc; padding: 1px 6px; border-radius: 6px; }

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