/* Pruefportal: eine Aufgabe, viel Ruhe, Systemschriften. Keine Webfonts, keine
   Abhaengigkeiten.

   BEWUSST NUR HELL. Das Portal zeigt Befunde, die jemand ausdruckt, abfotografiert
   oder neben ein Blatt Papier haelt -- und Papier ist weiss. Eine dunkle Fassung
   waere ein zweiter Satz Farben, dessen Kontraste bei jedem neuen Zustand
   mitgeprueft werden muesste, ohne dass irgendwer sie in dieser Lage braucht. */

:root {
  --marke: #1b46f5;
  --marke-text: #1b46f5;
  --marke-ecke: #0f6b72;
  --grund: #f3f3f0;
  --flaeche: #ffffff;
  --text: #191b20;
  --leise: #6a6e78;
  --rand: #e6e6e0;

  --gut-text: #0c6b3a;
  --gut-flaeche: #eaf7f0;
  --gut-rand: #86ceaa;

  --schlecht-text: #b3231b;
  --schlecht-flaeche: #fdecea;
  --schlecht-rand: #eda49d;
  --schlecht-marke: #fbd5d0;

  --neutral-text: #2f3a54;
  --neutral-flaeche: #eef0f6;
  --neutral-rand: #c6cddf;

  --warn-text: #8a5300;
  --warn-flaeche: #fdf3e2;
  --warn-rand: #e8c893;

  --schatten: 0 1px 2px rgba(20, 22, 28, 0.05), 0 8px 24px rgba(20, 22, 28, 0.06);
}


* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font-family:
    ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.seite {
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 4rem) clamp(1rem, 4vw, 2rem) 4rem;
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 3vw, 1.75rem);
}

/* --- Kopf ---------------------------------------------------------------- */

.kopf {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.marke {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Kasseneck-Zeichen wie in der Kunden-App und auf der Marketing-Website:
   Quadrat-Umriss in Ink, darueber ein kleines Teal-Quadrat ueber der rechten
   unteren Ecke. Aus zwei Rechtecken gebaut statt als Bilddatei -- es bleibt bei
   jeder Groesse scharf, braucht keinen zweiten Abruf und faellt nicht unter
   img-src. */
.marke-zeichen {
  position: relative;
  display: inline-block;
  flex: none;
  width: 22px;
  height: 22px;
  border: 2px solid var(--text);
}

.marke-zeichen::after {
  content: '';
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 8px;
  height: 8px;
  background: var(--marke-ecke);
}

h1 {
  margin: 0;
  font-size: clamp(1.6rem, 5vw, 2.35rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 650;
}

.lead {
  margin: 0;
  max-width: 38rem;
  font-size: clamp(1rem, 2.4vw, 1.1rem);
  color: var(--leise);
}

.lead--klein {
  font-size: 0.9rem;
}

.vertraulich {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin: 0.5rem 0 0;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--rand);
  border-radius: 12px;
  background: var(--flaeche);
  font-size: 0.9rem;
  color: var(--leise);
}

.vertraulich strong {
  color: var(--text);
  font-weight: 600;
}

.vertraulich-zeichen {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 0.15rem;
  border-radius: 4px;
  border: 2px solid var(--marke-text);
  border-top-width: 9px;
  border-top-left-radius: 9px;
  border-top-right-radius: 9px;
}

/* --- Erwarteter Wert ------------------------------------------------------ */

.erwartet {
  padding: 1rem 1.15rem;
  border: 1px solid var(--rand);
  border-radius: 14px;
  background: var(--flaeche);
}

.erwartet-titel {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--leise);
}

/* --- Ablage --------------------------------------------------------------- */

.ablage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 15rem;
  padding: clamp(1.5rem, 5vw, 2.5rem);
  border: 2px dashed var(--rand);
  border-radius: 20px;
  background: var(--flaeche);
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    transform 0.15s ease;
}

.ablage:hover {
  border-color: var(--marke);
}

.ablage--aktiv {
  border-style: solid;
  border-color: var(--marke);
  background: color-mix(in srgb, var(--marke) 8%, var(--flaeche));
  transform: scale(1.005);
}

.ablage-zeichen {
  position: relative;
  width: 44px;
  height: 44px;
  margin-bottom: 0.35rem;
  border: 2px solid var(--marke-text);
  border-radius: 10px;
  border-top-color: transparent;
  border-left-color: transparent;
  border-right-color: transparent;
  border-bottom-width: 3px;
}

.ablage-zeichen::before,
.ablage-zeichen::after {
  content: "";
  position: absolute;
  background: var(--marke-text);
}

.ablage-zeichen::before {
  left: 50%;
  top: -14px;
  width: 3px;
  height: 30px;
  margin-left: -1.5px;
  border-radius: 2px;
}

.ablage-zeichen::after {
  left: 50%;
  top: 3px;
  width: 13px;
  height: 13px;
  margin-left: -7.5px;
  border-radius: 2px;
  transform: rotate(45deg);
  clip-path: polygon(0 100%, 100% 100%, 100% 0, 82% 0, 82% 82%, 0 82%);
}

.ablage-titel {
  margin: 0;
  font-size: clamp(1.15rem, 3vw, 1.4rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.ablage-hinweis {
  margin: 0;
  max-width: 26rem;
  font-size: 0.9rem;
  color: var(--leise);
}

.knopf {
  margin-top: 0.9rem;
  padding: 0.7rem 1.4rem;
  border: 0;
  border-radius: 10px;
  background: var(--marke);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}

.knopf:hover {
  filter: brightness(1.08);
}

.knopf:focus-visible,
.ablage:focus-visible,
.herkunft:focus-visible {
  outline: 3px solid var(--marke);
  outline-offset: 3px;
}

.knopf--leise {
  margin-top: 1rem;
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
}

.knopf--leise[disabled] {
  opacity: 0.6;
  cursor: default;
}

.versteckt {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --- Fortschritt ---------------------------------------------------------- */

.fortschritt {
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--rand);
  border-radius: 14px;
  background: var(--flaeche);
}

.fortschritt-titel {
  margin: 0 0 0.7rem;
  font-weight: 600;
}

.balken {
  height: 8px;
  border-radius: 999px;
  background: var(--rand);
  overflow: hidden;
}

.balken-fuell {
  display: block;
  height: 100%;
  width: calc(var(--anteil, 0) * 100%);
  border-radius: 999px;
  background: var(--marke);
  transition: width 0.12s linear;
}

.fortschritt-text {
  margin: 0.55rem 0 0;
  font-size: 0.85rem;
  color: var(--leise);
  font-variant-numeric: tabular-nums;
}

/* --- Befund --------------------------------------------------------------- */

.befund {
  padding: clamp(1.25rem, 4vw, 1.9rem);
  border: 2px solid var(--rand);
  border-radius: 18px;
  background: var(--flaeche);
  box-shadow: var(--schatten);
}

.befund-kopf {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.befund-titel {
  margin: 0;
  font-size: clamp(1.35rem, 4.5vw, 1.95rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.befund-satz {
  margin: 0.45rem 0 0;
  color: var(--leise);
  max-width: 34rem;
}

.befund-datei {
  margin: 1.1rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid var(--rand);
  font-size: 0.82rem;
  color: var(--leise);
  word-break: break-word;
}

.zeichen {
  flex: none;
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
}

.zeichen::before {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
}

.zeichen--gut {
  background: var(--gut-text);
}

.zeichen--gut::before {
  content: "✓";
}

.zeichen--schlecht {
  background: var(--schlecht-text);
}

.zeichen--schlecht::before {
  content: "✕";
}

.zeichen--neutral {
  background: var(--neutral-text);
}

.zeichen--neutral::before {
  content: "?";
  font-size: 1.9rem;
  font-weight: 600;
}

/* Zwei versetzte Blaetter: ein Buendel, kein Urteil. Deshalb aus Rechtecken
   gebaut und nicht aus einem Haken, Kreuz oder Rufzeichen. */
.zeichen--buendel {
  background: var(--neutral-text);
}

.zeichen--buendel::before,
.zeichen--buendel::after {
  content: "";
  position: absolute;
  inset: auto;
  display: block;
  width: 19px;
  height: 24px;
  /* Nicht #fff wie bei den Glyphen: im dunklen Schema ist die Kreisflaeche
     selbst hell, weisse Striche waeren darauf nicht zu sehen. */
  border: 2px solid var(--flaeche);
  border-radius: 3px;
}

.zeichen--buendel::before {
  left: 12px;
  top: 12px;
  opacity: 0.55;
}

.zeichen--buendel::after {
  left: 22px;
  top: 19px;
  background: var(--neutral-text);
}

.zeichen--warnung {
  background: var(--warn-text);
}

.zeichen--warnung::before {
  content: "!";
  font-size: 1.9rem;
  font-weight: 700;
}

.befund--gleich {
  border-color: var(--gut-rand);
  background: var(--gut-flaeche);
}

.befund--gleich .befund-titel {
  color: var(--gut-text);
}

.befund--abweichend {
  border-color: var(--schlecht-text);
  border-width: 3px;
  background: var(--schlecht-flaeche);
}

.befund--abweichend .befund-titel {
  color: var(--schlecht-text);
}

.befund--kein-vergleichswert {
  border-color: var(--neutral-rand);
  background: var(--neutral-flaeche);
}

.befund--kein-vergleichswert .befund-titel {
  color: var(--neutral-text);
}

/* Uebergabebuendel: eine Feststellung darueber, welche Datei vorliegt -- kein
   Befund ueber ihre Echtheit. Also weder Rot noch Gruen, sondern die neutrale
   Flaeche, und ein Zeichen, das nach "zwei Dateien" aussieht statt nach
   Urteil. */
.befund--buendel {
  border-color: var(--neutral-rand);
  background: var(--neutral-flaeche);
}

.befund--buendel .befund-titel {
  color: var(--neutral-text);
  font-size: clamp(1.2rem, 3.6vw, 1.6rem);
}

.befund--buendel .befund-satz,
.befund--buendel .befund-datei {
  color: color-mix(in srgb, var(--text) 72%, transparent);
}

.befund-inhalt {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
  margin: 1.25rem 0 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--rand);
  border-radius: 12px;
  background: var(--flaeche);
  font-size: 0.92rem;
  color: var(--leise);
}

.befund-inhalt-datei {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9rem;
  color: var(--text);
  word-break: break-all;
}

/* Unbrauchbarer Vergleichswert: es wurde nicht verglichen. Bernstein statt Rot
   -- der Befund gilt dem Wert im Adressteil, nicht der Datei. */
.befund--unbrauchbar,
.befund--fehler {
  border-color: var(--warn-rand);
  background: var(--warn-flaeche);
}

.befund--unbrauchbar .befund-titel,
.befund--fehler .befund-titel {
  color: var(--warn-text);
}

.befund-roh {
  margin: 1rem 0 0;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--warn-rand);
  border-radius: 10px;
  background: var(--flaeche);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85rem;
  color: var(--leise);
  word-break: break-all;
}

.befund--gleich .befund-satz,
.befund--abweichend .befund-satz,
.befund--kein-vergleichswert .befund-satz,
.befund--unbrauchbar .befund-satz,
.befund--unbrauchbar .befund-datei,
.befund--abweichend .befund-datei,
.befund--gleich .befund-datei,
.befund--kein-vergleichswert .befund-datei {
  color: color-mix(in srgb, var(--text) 72%, transparent);
}

/* --- Hash-Darstellung ------------------------------------------------------ */

.hash {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  word-break: break-all;
}

.hash--gruppen {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.5rem;
  word-break: normal;
}

.gruppe {
  padding: 0.05rem 0.15rem;
  border-radius: 4px;
}

.gruppe--bruch {
  background: var(--schlecht-marke);
  color: var(--schlecht-text);
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--schlecht-text);
}

.gegenueber {
  display: grid;
  gap: 0.9rem;
  margin-top: 1.35rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--schlecht-rand);
  border-radius: 12px;
  background: var(--flaeche);
}

.gegenueber-hinweis {
  margin: 0;
  font-size: 0.82rem;
  color: var(--leise);
}

.hash-titel {
  margin: 0 0 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--leise);
}

.befund--kein-vergleichswert .hash--gruppen,
.befund--unbrauchbar .hash--gruppen,
.befund--gleich .hash--gruppen {
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--rand);
  border-radius: 12px;
  background: var(--flaeche);
}

/* --- Herkunft ------------------------------------------------------------- */

.herkunft {
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--rand);
  border-left-width: 5px;
  border-radius: 14px;
  background: var(--flaeche);
}

.herkunft-titel {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--leise);
}

.herkunft-satz {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.herkunft-hinweis {
  margin: 0.4rem 0 0;
  font-size: 0.88rem;
  color: var(--leise);
  max-width: 34rem;
}

/* Die Farbe folgt dem Ton, nicht dem Abfrageergebnis: ein bekannter Export
   bestaetigt nur dann, wenn auch die Pruefsumme stimmt. */

.herkunft--bestaetigend {
  border-color: var(--gut-rand);
  border-left-color: var(--gut-text);
}

.herkunft--bestaetigend .herkunft-satz {
  color: var(--gut-text);
}

/* Bekannter Export bei abweichender Pruefsumme: die Auskunft bleibt, aber
   sachlich -- kein Gruen, das unter einem roten Befund entlastend wirkt. */
.herkunft--neutral {
  border-color: var(--neutral-rand);
  border-left-color: var(--neutral-text);
  background: var(--neutral-flaeche);
}

.herkunft--neutral .herkunft-satz {
  color: var(--neutral-text);
  font-weight: 500;
}

.herkunft--warnend {
  border-color: var(--warn-rand);
  border-left-color: var(--warn-text);
  background: var(--warn-flaeche);
}

.herkunft--warnend .herkunft-satz {
  color: var(--warn-text);
}

.herkunft--unklar {
  border-color: var(--rand);
  border-left-color: var(--leise);
  border-left-style: dashed;
}

.herkunft--unklar .herkunft-satz {
  color: var(--leise);
  font-weight: 500;
}

.herkunft--laeuft .herkunft-satz {
  color: var(--leise);
  font-weight: 500;
}

.angaben {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.3rem 1.25rem;
  margin: 0.9rem 0 0;
  font-size: 0.92rem;
}

.angaben dt {
  color: var(--leise);
}

.angaben dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

/* --- Fuss ----------------------------------------------------------------- */

.fuss {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--leise);
}

.fuss p {
  margin: 0;
  max-width: 34rem;
}

@media (max-width: 30rem) {
  .befund-kopf {
    flex-direction: column;
    gap: 0.75rem;
  }

  .angaben {
    grid-template-columns: 1fr;
    gap: 0 0;
  }

  .angaben dd {
    margin-bottom: 0.5rem;
  }
}

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

/* --- Fehlerseite (404.html) -------------------------------------------------
   Eigene Seite statt der Firebase-Standardseite: die sieht aus, als waere
   etwas kaputt. Sie teilt sich dieses Stylesheet mit der Pruefseite, damit
   Marke, Farben und das Hell/Dunkel-Verhalten nicht auseinanderlaufen. */

.wege {
  display: grid;
  gap: 0.75rem;
  margin-top: 2rem;
}

.weg {
  display: block;
  padding: 1.1rem 1.25rem;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.weg:hover {
  border-color: var(--marke);
}

/* Sichtbarer Fokus fuer die Tastaturbedienung -- die Wege sind auf dieser
   Seite die einzige Bedienmoeglichkeit. */
.weg:focus-visible {
  outline: 2px solid var(--marke);
  outline-offset: 2px;
}

.weg-titel {
  display: block;
  font-weight: 600;
  color: var(--marke-text);
  margin-bottom: 0.2rem;
}

.weg-text {
  display: block;
  color: var(--leise);
  font-size: 0.95rem;
  line-height: 1.5;
}
