/* SPARK-Demo — BlockBuilder CI (brand v1.0.0). Signatur: die Akte auf dem Laufzettel. */

@font-face { font-family: "Cabinet Grotesk"; src: url("fonts/cabinet-grotesk-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Cabinet Grotesk"; src: url("fonts/cabinet-grotesk-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Geist"; src: url("fonts/Geist-Regular.ttf"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Geist"; src: url("fonts/Geist-Medium.ttf"); font-weight: 500; font-display: swap; }

:root {
  --purple: #6C5CE7; --purple-deep: #3B3290; --navy: #1A1A2E; --lavender: #A99BF0;
  --offwhite: #F8F6FC; --green: #06D6A0; --ink: #23233a; --muted: #6b6b85;
  --papier: #ffffff; --linie: #e4e0f2;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Consolas, monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: "Geist", system-ui, sans-serif; background: var(--offwhite); color: var(--ink); line-height: 1.55; }
h1, h2, h3 { font-family: "Cabinet Grotesk", sans-serif; color: var(--navy); }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; border-radius: 4px; }

/* ---------- Demo-Leiste ---------- */
.demoleiste {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: .75rem;
  background: var(--lavender); color: var(--navy);
  padding: .45rem 1.25rem; font-size: .82rem; font-weight: 500;
  border-bottom: 1px solid rgba(26,26,46,.15);
}
.demoleiste-badge {
  font-family: "Cabinet Grotesk"; font-weight: 800; text-transform: uppercase;
  letter-spacing: .12em; font-size: .72rem;
  background: var(--navy); color: #fff; padding: .2rem .6rem; border-radius: 999px;
  flex: 0 0 auto;
}

/* ---------- Kopf ---------- */
.kopf { background: var(--navy); color: #fff; }
.kopf-innen { max-width: 1060px; margin: 0 auto; padding: 3.2rem 1.5rem 3.6rem; }
.kopf-logo { display: block; margin-bottom: 2.4rem; height: 34px; width: auto; }
.eyebrow { color: var(--lavender); text-transform: uppercase; letter-spacing: .14em; font-size: .8rem; font-weight: 500; margin-bottom: 1rem; }
.kopf h1 { color: #fff; font-size: clamp(1.9rem, 4.5vw, 3.1rem); font-weight: 800; line-height: 1.08; margin-bottom: 1.1rem; }
.kopf-sub { color: #c9c4e8; max-width: 46rem; font-size: 1.02rem; }

/* ---------- Abschnitte ---------- */
main { max-width: 1060px; margin: 0 auto; padding: 0 1.5rem 4rem; }
.abschnitt { padding-top: 3rem; }
.abschnitt-titel { font-size: 1.45rem; font-weight: 800; display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1.4rem; }
.abschnitt-titel .nr {
  font-family: "Geist"; font-weight: 500; font-size: .78rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--purple);
}

/* ---------- Fallkarten (Aktendeckel) ---------- */
.fallkarten { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.1rem; }
.fallkarte {
  position: relative; text-align: left; background: var(--papier);
  border: 1px solid var(--linie); border-radius: 10px; padding: 1.2rem 1.2rem 1rem;
  transition: transform .18s ease, box-shadow .18s ease;
  box-shadow: 0 1px 0 rgba(26,26,46,.04);
  display: flex; flex-direction: column; gap: .5rem;
}
/* der Aktendeckel: zwei "Blätter" hinter der Karte */
.fallkarte::before, .fallkarte::after {
  content: ""; position: absolute; inset: 0; border-radius: 10px;
  background: #fff; border: 1px solid var(--linie); z-index: -1;
  transition: transform .18s ease;
}
.fallkarte::before { transform: rotate(-1.1deg) translateY(3px); }
.fallkarte::after { transform: rotate(.9deg) translateY(6px); background: var(--offwhite); }
.fallkarte:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(59,50,144,.14); }
.fallkarte:hover::before { transform: rotate(-1.8deg) translateY(4px); }
.fallkarte:hover::after { transform: rotate(1.6deg) translateY(8px); }
.fallkarte .reiter {
  align-self: flex-start; font-size: .72rem; font-weight: 500; letter-spacing: .1em;
  text-transform: uppercase; color: var(--purple-deep);
  background: #efecfd; border-radius: 4px 4px 0 0; padding: .18rem .55rem;
  border: 1px solid var(--linie); border-bottom: none; margin-bottom: -.5rem;
}
.fallkarte h3 { font-size: 1.15rem; font-weight: 800; }
.fallkarte .unter { color: var(--muted); font-size: .85rem; }
.fallkarte .besch { font-size: .88rem; }
.fallkarte .meta { margin-top: auto; padding-top: .6rem; font-size: .78rem; color: var(--muted); border-top: 1px dashed var(--linie); font-family: var(--mono); }

/* ---------- Akte / Dokumente ---------- */
.akte-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.akte-beschreibung { max-width: 48rem; margin-bottom: 1.3rem; }
.dokumente { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.dokument {
  text-align: left; background: var(--papier); border: 1px solid var(--linie);
  border-radius: 6px; padding: .95rem 1rem; min-height: 165px;
  display: flex; flex-direction: column; gap: .45rem; position: relative; overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}
.dokument:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(59,50,144,.12); }
.dokument h3 { font-size: .95rem; font-weight: 700; }
.dok-art { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.dokument .vorschau { font-size: .78rem; color: var(--ink); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.dokument .lupe { margin-top: auto; font-size: .78rem; color: var(--purple); font-weight: 500; }
.dokument.ist-mail { border-top: 3px solid var(--purple); }
.dokument.ist-mail .vorschau::before { content: "Von: (geschwärzt)\AAn: Ordnungsamt\A—\A"; white-space: pre; color: var(--muted); font-family: var(--mono); font-size: .72rem; display: block; }
.dokument.ist-scan { background: #fbfaf6; }
.dokument.ist-scan .vorschau { font-family: var(--mono); transform: rotate(-.6deg); color: #3d3d52; filter: contrast(.92); }
.dokument.ist-scan::after { content: ""; position: absolute; inset: 0; pointer-events: none; background:
  repeating-linear-gradient(0deg, transparent 0 2px, rgba(26,26,46,.018) 2px 3px); }
.dokument.ist-formular .vorschau { font-family: var(--mono); font-size: .74rem; }
.dokument.ist-vermerk .vorschau { font-style: normal; }
.dok-stempel {
  position: absolute; top: .55rem; right: .6rem; font-family: var(--mono); font-size: .62rem;
  color: var(--purple-deep); border: 1.5px solid var(--purple-deep); border-radius: 3px;
  padding: .1rem .35rem; transform: rotate(6deg); opacity: .55; text-transform: uppercase; letter-spacing: .08em;
}

.run-zeile { display: flex; align-items: center; gap: 1rem; margin-top: 1.6rem; flex-wrap: wrap; }
.btn-run {
  display: inline-flex; align-items: center; gap: .6rem;
  background: var(--purple); color: #fff; border: none; border-radius: 999px;
  font-family: "Cabinet Grotesk"; font-weight: 700; font-size: 1.05rem;
  padding: .85rem 1.7rem; transition: background .15s ease, transform .15s ease;
}
.btn-run svg { width: 1.15rem; height: 1.15rem; }
.btn-run:hover { background: var(--purple-deep); transform: translateY(-1px); }
.btn-run[disabled] { opacity: .5; cursor: default; transform: none; }
.btn-sekundaer { background: var(--navy); }
.btn-sekundaer:hover { background: #2c2c4a; }
.btn-leise {
  background: none; border: 1px solid var(--linie); border-radius: 999px;
  color: var(--muted); font-size: .85rem; padding: .45rem 1rem; transition: color .15s, border-color .15s;
}
.btn-leise:hover { color: var(--navy); border-color: var(--lavender); }

/* ---------- Prüfstrecke (Laufzettel) ---------- */
.stationen { list-style: none; position: relative; margin-left: .4rem; }
.stationen::before {
  content: ""; position: absolute; left: 17px; top: 8px; bottom: 8px; width: 2px;
  background: var(--linie); border-radius: 2px;
}
.station { position: relative; padding: 0 0 1.5rem 3.2rem; opacity: .38; transition: opacity .3s ease; }
.station.aktiv, .station.fertig { opacity: 1; }
.station-punkt {
  position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%;
  background: #fff; border: 2px solid var(--linie); display: flex; align-items: center; justify-content: center;
  color: var(--muted); transition: border-color .2s, color .2s, background .2s;
}
.station-punkt svg { width: 18px; height: 18px; }
.station.aktiv .station-punkt { border-color: var(--purple); color: var(--purple); }
.station.aktiv .station-punkt { animation: pulsieren 1.2s ease-in-out infinite; }
.station.fertig .station-punkt { background: var(--navy); border-color: var(--navy); color: #fff; animation: stempel .35s ease-out; }
.station.fertig.warn .station-punkt { background: var(--purple); border-color: var(--purple); }
@keyframes pulsieren { 0%,100% { box-shadow: 0 0 0 0 rgba(108,92,231,.25); } 50% { box-shadow: 0 0 0 8px rgba(108,92,231,.08); } }
@keyframes stempel { 0% { transform: scale(1.45) rotate(-8deg); } 70% { transform: scale(.95) rotate(1deg); } 100% { transform: scale(1) rotate(0); } }
.station h3 { font-size: 1.05rem; font-weight: 700; display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.station .erklaer { font-size: .85rem; color: var(--muted); margin: .15rem 0 .5rem; max-width: 42rem; }
.station-log {
  font-family: var(--mono); font-size: .8rem; background: var(--navy); color: #d6d2f0;
  border-radius: 8px; padding: .7rem .9rem; max-width: 46rem; display: none;
}
.station.aktiv .station-log, .station.fertig .station-log { display: block; }
.station-log .zeile { display: block; animation: erscheinen .25s ease-out; }
.station-log .zeile.ok::before { content: "✓ "; color: var(--green); }
.station-log .zeile.warn::before { content: "! "; color: var(--lavender); }
.station-log .zeile.neutral::before { content: "· "; color: var(--lavender); }
@keyframes erscheinen { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.station-fazit { font-size: .85rem; font-weight: 500; color: var(--navy); margin-top: .45rem; }
.station.warn .station-fazit { color: var(--purple-deep); }

/* Konsens-Spuren */
.spuren { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; max-width: 46rem; margin-top: .4rem; }
.spur { background: #fff; border: 1px solid var(--linie); border-radius: 8px; padding: .55rem .8rem; font-size: .8rem; }
.spur strong { font-family: var(--mono); font-size: .78rem; }
.spur .spur-name { text-transform: uppercase; letter-spacing: .1em; font-size: .68rem; color: var(--muted); display: block; margin-bottom: .2rem; }

/* ---------- Ergebnis ---------- */
.ekarte { background: #fff; border: 1px solid var(--linie); border-radius: 12px; overflow: hidden; animation: erscheinen .4s ease-out; }
.ekarte-kopf { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--linie); flex-wrap: wrap; }
.ekarte-kopf h3 { font-size: 1.3rem; font-weight: 800; }
.badge { font-family: "Cabinet Grotesk"; font-weight: 700; font-size: .95rem; color: #fff; border-radius: 999px; padding: .45rem 1.1rem; white-space: nowrap; }
.badge.gruen { background: var(--green); }
.badge.lila { background: var(--purple); }
.ekarte-body { padding: 1.3rem 1.4rem 1.5rem; display: flex; flex-direction: column; gap: 1.15rem; }
.e-label { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--purple); font-weight: 500; margin-bottom: .35rem; }
.tb-box { border: 1.5px solid var(--purple); border-radius: 8px; padding: .9rem 1.1rem; }
.tb-box .tbnr { font-family: "Cabinet Grotesk"; font-weight: 800; font-size: 1.15rem; color: var(--navy); }
.tb-box .tbdetail { font-size: .88rem; margin-top: .2rem; }
.abgabe-box { border: 1.5px solid var(--lavender); background: #f6f4ff; border-radius: 8px; padding: .9rem 1.1rem; }
.abgabe-box .tbnr { font-family: "Cabinet Grotesk"; font-weight: 800; font-size: 1.05rem; color: var(--purple-deep); }
.e-text { font-size: .92rem; max-width: 52rem; }
table.merk { width: 100%; border-collapse: collapse; font-size: .84rem; }
table.merk th { text-align: left; background: var(--offwhite); padding: .45rem .7rem; font-family: "Cabinet Grotesk"; font-size: .8rem; color: var(--navy); }
table.merk td { padding: .45rem .7rem; border-bottom: 1px solid #efecf8; vertical-align: top; }
table.merk td.st { white-space: nowrap; font-weight: 500; }
table.merk tr.ok td.st { color: #049772; }
table.merk tr.nok td.st { color: #b3261e; }
details.e-mehr { border: 1px solid var(--linie); border-radius: 8px; }
details.e-mehr summary { cursor: pointer; padding: .7rem 1rem; font-weight: 500; font-size: .9rem; color: var(--purple-deep); list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.e-mehr summary::after { content: "+"; font-family: var(--mono); font-size: 1.1rem; }
details.e-mehr[open] summary::after { content: "−"; }
details.e-mehr .inhalt { padding: 0 1rem 1rem; display: flex; flex-direction: column; gap: .6rem; }
.hinweis-eintrag { font-size: .84rem; border-left: 3px solid var(--lavender); padding: .3rem .7rem; background: var(--offwhite); border-radius: 0 6px 6px 0; }
.konkurrenz { font-size: .84rem; border: 1px solid var(--linie); border-radius: 6px; padding: .5rem .8rem; }
.konkurrenz .rolle { display: inline-block; font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; background: #eceafd; color: var(--purple-deep); border-radius: 4px; padding: .12rem .45rem; margin-right: .4rem; }
.ergebnis-aktionen { display: flex; gap: 1rem; margin-top: 1.4rem; flex-wrap: wrap; }

/* ---------- Modal: die Dokument-Bühne ---------- */
.dok-modal { margin: auto; border: none; border-radius: 12px; padding: 0; max-width: min(760px, 94vw); width: 100%; box-shadow: 0 24px 60px rgba(26,26,46,.4); background: #e8e5f2; max-height: 90vh; }
.dok-modal::backdrop { background: rgba(26,26,46,.6); }
.dok-modal-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: .9rem 1.2rem; background: var(--navy); }
.dok-modal-kopf h3 { font-size: 1.05rem; color: #fff; }
.dok-modal-kopf .dok-art { color: var(--lavender); }
.dok-buehne { padding: 1.6rem; overflow: auto; max-height: calc(90vh - 70px); }

/* Das Blatt */
.blatt { position: relative; background: #fff; margin: 0 auto; max-width: 620px; padding: 2.4rem 2.6rem 2.2rem; box-shadow: 0 6px 24px rgba(26,26,46,.22), 0 1px 3px rgba(26,26,46,.18); font-size: .92rem; line-height: 1.65; }
.blatt .blatt-text { white-space: pre-wrap; }
.blatt .blatt-fuss { margin-top: 2rem; font-size: .82rem; color: var(--muted); }
.blatt .eingangsstempel { position: absolute; top: 1rem; right: 1.1rem; transform: rotate(7deg); border: 2px solid var(--purple-deep); color: var(--purple-deep); border-radius: 4px; padding: .25rem .6rem; font-family: var(--mono); font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; opacity: .7; text-align: center; line-height: 1.35; }

/* Look: E-Mail */
.blatt.look-mail { padding-top: 1.6rem; }
.blatt.look-mail .mail-header { font-size: .82rem; border-bottom: 2px solid var(--linie); padding-bottom: .8rem; margin-bottom: 1.2rem; display: grid; grid-template-columns: auto 1fr; gap: .15rem .8rem; }
.blatt.look-mail .mail-header dt { color: var(--muted); font-weight: 500; }
.blatt.look-mail .mail-header dd { margin: 0; font-family: var(--mono); font-size: .8rem; }

/* Look: Scan */
.blatt.look-scan { transform: rotate(-.7deg); background: #fbf9f2; font-family: var(--mono); font-size: .84rem; color: #2e2e44; }
.blatt.look-scan::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 2px, rgba(26,26,46,.02) 2px 3px),
              radial-gradient(ellipse 60px 18px at 82% 12%, rgba(26,26,46,.05), transparent),
              radial-gradient(ellipse 90px 26px at 12% 88%, rgba(26,26,46,.045), transparent); }
.blatt.look-scan .blatt-kopfzeile { filter: blur(.2px); }

/* Look: Formular / Vermerk */
.blatt .blatt-kopfzeile { font-family: var(--mono); font-weight: 700; font-size: .84rem; letter-spacing: .04em; border-bottom: 2px solid var(--navy); padding-bottom: .5rem; margin-bottom: .3rem; }
.blatt .blatt-datum { font-family: var(--mono); font-size: .76rem; color: var(--muted); margin-bottom: 1.2rem; }
.blatt.look-formular { font-family: var(--mono); font-size: .84rem; }
.blatt.look-formular .blatt-text { border-left: 3px solid var(--linie); padding-left: 1rem; }

/* ---------- Partner-Chip im Kopf ---------- */
.partner-zeile { display: flex; align-items: center; gap: 1.1rem; margin-bottom: 2.4rem; flex-wrap: wrap; }
.partner-zeile .kopf-logo { margin-bottom: 0; }
.partner-plus { color: var(--lavender); font-family: var(--mono); font-size: .9rem; }
.partner-chip { background: #fff; border-radius: 8px; padding: .45rem .8rem; display: flex; align-items: center; }
.partner-chip img { height: 22px; width: auto; display: block; }
.partner-label { font-size: .72rem; color: #c9c4e8; text-transform: uppercase; letter-spacing: .12em; }

/* ---------- Fuß ---------- */
.fuss { border-top: 1px solid var(--linie); background: #fff; padding: 1.6rem 1.5rem 2rem; }
.fuss p { max-width: 1060px; margin: 0 auto .5rem; font-size: .82rem; color: var(--muted); }
.fuss a { color: var(--purple-deep); }

/* ---------- Responsive & Motion ---------- */
@media (max-width: 640px) {
  .kopf-innen { padding: 2.2rem 1.25rem 2.6rem; }
  .spuren { grid-template-columns: 1fr; }
  .akte-kopf { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
