/* PRÜF / Amtlich + Uncanny — Design Language */
@font-face {
  font-family: "LCD14";
  src: url("LCD14.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --deep-green: #1B4024;
  --dull-beige: #BFBFAA;
  --shadow-green: #737151;
  --paper-white: #D9D9D9;
  --pure-black: #0D0D0D;
  /* Aktenmarker-Orange: global primary CTA (Weiter / progression) */
  --aktenmarker-orange: #C46A2B;
  --aktenmarker-orange-hover: #a85a24;
  /* Queue-management-display red (dull red on black-ish, LED-style) */
  --display-red: #B03030;
  --line: rgba(13, 13, 13, 0.22);
  --muted: rgba(13, 13, 13, 0.62);
  --serif: "Georgia", "Times New Roman", serif;
  --sans: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Courier New", Courier, monospace;
  --lcd-font: "LCD14", var(--mono);
  --radius: 0px;
}

.demo {
  font-family: var(--serif);
  background-color: var(--deep-green);
  color: var(--pure-black);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 22px;
  padding: 40px 18px 70px;
  min-height: 100vh;
}

.screen {
  width: min(420px, 92vw);
  background: var(--dull-beige);
  border: 1px solid rgba(27, 64, 36, 0.65);
  box-shadow: 12px 12px 0px var(--pure-black);
  position: relative;
  overflow: hidden;
}

.screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--shadow-green) 0.55px, transparent 0.55px);
  background-size: 15px 15px;
  opacity: 0.09;
  pointer-events: none;
}

.screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, rgba(0,0,0,0.025), rgba(0,0,0,0)),
    repeating-linear-gradient(
      90deg,
      rgba(0,0,0,0.012) 0px,
      rgba(0,0,0,0.012) 1px,
      transparent 1px,
      transparent 22px
    );
  opacity: 0.35;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.paper {
  position: relative;
  z-index: 1;
  padding: 16px;
}

/* Institutional header — letterhead, Variant B: government form, static */
.institutional-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px 12px 20px;
  margin: -16px -16px 14px -16px;
  background: var(--paper-white);
  border-bottom: 1px solid rgba(27, 64, 36, 0.35);
  min-height: 0;
}

/* Three stripes: muted national colors, micro-symbol */
.inst-symbol {
  width: 16px;
  height: 10px;
  flex-shrink: 0;
  position: relative;
  border-top: 1px solid #0D0D0D;
}

.inst-symbol::before,
.inst-symbol::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 1px solid #A22F26;
}

.inst-symbol::before {
  top: 3px;
}

.inst-symbol::after {
  top: 6px;
  border-top-color: #AD8339;
}

.inst-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.inst-primary {
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--pure-black);
  text-transform: uppercase;
}

.inst-secondary {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-transform: none;
}

/* Start screen: administrative timestamp + layout (no overlap) */
.start-screen {
  position: relative;
}

.start-screen .eingang-timestamp {
  position: absolute;
  top: 10px;
  right: 15px;
  margin: 0;
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  z-index: 10;
}

.start-screen h1 {
  margin-top: 30px;
}

.topbar {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(27, 64, 36, 0.55);
  background: rgba(217, 217, 217, 0.18);
}

.brand .logo { font-family: var(--sans); font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; }
.brand .sub { font-family: var(--sans); font-size: 12px; color: rgba(13, 13, 13, 0.70); }

.chip {
  background: var(--deep-green);
  color: var(--paper-white);
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 10px;
  border: 1px solid rgba(13, 13, 13, 0.35);
  box-shadow: 2px 2px 0 rgba(13, 13, 13, 0.55);
}

h1, h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 2px solid rgba(27, 64, 36, 0.75);
  display: inline-block;
  padding-bottom: 6px;
}

.lede {
  margin: 6px 0 14px;
  color: rgba(13, 13, 13, 0.68);
  line-height: 1.35;
}

/* Counter: machine/office device — queue-display style (red on black-ish) */
.counter {
  padding: 14px 16px;
  margin: 18px 0 16px;
  position: relative;
}

.counter .counter-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}

.counter .k { font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.12em; font-size: 11px; color: var(--muted); }

/* Display panel: dark background, red LCD digits (queue-management style) */
.counter-display {
  background: #0f0f0f;
  border: 2px inset rgba(0, 0, 0, 0.5);
  padding: 12px 16px;
  margin-top: 6px;
  margin-bottom: 4px;
  box-shadow:
    inset 3px 3px 6px rgba(0, 0, 0, 0.5),
    inset -1px -1px 2px rgba(80, 80, 80, 0.15),
    0 0 0 1px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.counter-display::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 1px,
    rgba(0, 0, 0, 0.15) 1px,
    rgba(0, 0, 0, 0.15) 2px
  );
  pointer-events: none;
}

.counter .counter-display .n {
  font-family: var(--lcd-font);
  font-size: 2.4rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  color: var(--display-red);
  margin: 0;
  position: relative;
  z-index: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: clip;
}

.counter .s { font-family: var(--sans); font-size: 12px; color: var(--muted); margin-top: 8px; }

.form { background: rgba(217, 217, 217, 0.22); border: 1px solid rgba(13, 13, 13, 0.20); }

.row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid rgba(13, 13, 13, 0.18);
}

.row:first-child { border-top: 0; }
.row .k { font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.10em; font-size: 11px; color: var(--muted); }
/* Typewriter glitch: pre-printed form filled by typewriter */
.row .v {
  font-family: "Courier New", Courier, monospace;
  font-size: 14px;
  color: #2b2b2b;
  letter-spacing: -0.5px;
  filter: opacity(0.9);
}

.row:nth-child(1) .v { transform: rotate(-0.4deg); }
.row:nth-child(2) .v { transform: rotate(0.25deg); }
.row:nth-child(3) .v { transform: rotate(-0.35deg); }

.actions { display: flex; gap: 10px; align-items: center; margin-top: 16px; flex-wrap: wrap; }

.btn {
  font-family: var(--sans);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  border: none;
  text-decoration: none;
  display: inline-block;
  font-size: 1rem;
}

/* Global primary CTA: Aktenmarker-Orange (Weiter / progression on all screens) */
.btn.primary {
  background: var(--aktenmarker-orange);
  color: var(--paper-white);
  border: 1px solid rgba(13, 13, 13, 0.35);
  box-shadow: 3px 3px 0 rgba(13, 13, 13, 0.55);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.btn.primary:hover {
  background: var(--aktenmarker-orange-hover);
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 rgba(13, 13, 13, 0.6);
}

.btn.primary:active {
  transform: translate(0, 0);
  box-shadow: 2px 2px 0 rgba(13, 13, 13, 0.5);
}

.btn.primary:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

.btn:focus-visible {
  outline: 3px solid var(--shadow-green);
  outline-offset: 3px;
}

.btn.ghost {
  background: transparent;
  border: 1px solid transparent;
  color: var(--deep-green);
  text-decoration: underline;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.btn.tiny {
  background: transparent;
  border: 1px solid rgba(13,13,13,0.25);
  color: rgba(13,13,13,0.80);
  padding: 10px 12px;
  font-size: 12px;
  box-shadow: 2px 2px 0 rgba(13,13,13,0.35);
}

/* Secondary re-check button (final screen): smaller, neutral, real button */
.btn.recheck {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(13, 13, 13, 0.3);
  color: rgba(13, 13, 13, 0.85);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 1px 1px 0 rgba(13, 13, 13, 0.25);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn.recheck:hover {
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 2px 2px 0 rgba(13, 13, 13, 0.3);
  transform: translate(-1px, -1px);
}

.btn.recheck:active {
  transform: translate(0, 0);
  box-shadow: 1px 1px 0 rgba(13, 13, 13, 0.2);
}

.bescheid-head .title { font-family: var(--sans); font-weight: 900; letter-spacing: 0.18em; }
.az, .mono { font-family: var(--mono); font-size: 12px; color: var(--muted); }

.result {
  background: rgba(27, 64, 36, 0.08);
  border-left: 6px solid var(--deep-green);
  border-top: 1px solid rgba(13,13,13,0.15);
  border-right: 1px solid rgba(13,13,13,0.15);
  border-bottom: 1px solid rgba(13,13,13,0.15);
  padding: 10px 12px;
  font-style: italic;
}

.result .result-status {
  font-weight: 700;
}

.no { color: var(--display-red); font-style: normal; font-weight: 700; }

.legal {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid rgba(13,13,13,0.18);
  font-family: var(--sans);
  font-size: 12px;
  display: flex;
  justify-content: center;
  gap: 8px;
  color: rgba(13,13,13,0.70);
}

.legal a {
  color: rgba(13,13,13,0.80);
  text-decoration: none;
  border-bottom: 1px dotted rgba(13,13,13,0.35);
}

.legal a:hover { border-bottom-style: solid; }

/* Legal documents (Impressum, Datenschutz): official printed-document style */
.legal-document {
  color: var(--pure-black);
}

.legal-document .legal-protokoll {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 12px;
}

.legal-document .legal-lede {
  margin: 6px 0 18px;
  color: rgba(13, 13, 13, 0.85);
  line-height: 1.45;
}

.legal-document h1 {
  margin-bottom: 14px;
}

.legal-document h2 {
  margin-top: 20px;
  margin-bottom: 10px;
}

.legal-document h2:first-of-type {
  margin-top: 0;
}

.legal-document p {
  margin: 0 0 12px;
  line-height: 1.45;
}

.legal-document ul {
  margin: 8px 0 16px;
  padding-left: 1.4em;
}

.legal-document li {
  margin-bottom: 8px;
  line-height: 1.45;
}

.legal-document code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: rgba(13, 13, 13, 0.08);
  padding: 1px 4px;
}

.err-msg {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(176, 48, 48, 0.12);
  border-left: 4px solid var(--display-red);
  font-family: var(--sans);
  font-size: 14px;
  color: var(--pure-black);
}

/* Spinner: amtlich — slow, monochrome, low-contrast (Screen 3 + Widerspruch) */
.spinner-amtlich {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(13, 13, 13, 0.15);
  border-top-color: rgba(13, 13, 13, 0.5);
  border-radius: 50%;
  animation: spin-amtlich 1.5s linear infinite;
  flex-shrink: 0;
}

@keyframes spin-amtlich {
  to { transform: rotate(360deg); }
}

.status-with-spinner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.status-with-spinner .status-line {
  margin: 0;
}

/* Prüfprozess — paper workflow (documents advancing) */
.paper-workflow {
  margin-top: 18px;
}

.workflow-sheet {
  position: relative;
  overflow: hidden;
  background: rgba(217, 217, 217, 0.35);
  border: 1px solid rgba(13, 13, 13, 0.2);
  padding: 14px 16px;
  min-height: 52px;
  transition: opacity 0.25s ease;
}

.workflow-sheet--scan::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--deep-green);
  box-shadow: 0 0 8px rgba(27, 64, 36, 0.4);
  animation: scan-line 3s linear infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes scan-line {
  0% { top: 0%; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

.workflow-sheet--transition {
  opacity: 0.4;
}

.workflow-status {
  margin: 0;
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--pure-black);
}

.workflow-hint {
  font-family: var(--sans);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-left: 12px;
}

.paper-workflow > .workflow-hint-below {
  margin-top: 10px;
  margin-left: 0;
}

/* Bescheid — formal notice and emphasis blocks */
.bescheid-notice {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(13, 13, 13, 0.18);
}

.bescheid-notice p {
  margin: 0;
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--pure-black);
}

/* Bescheid: manual stamp — "Und genau das soll sich ändern." */
.bescheid-emphasis {
  margin-top: 24px;
  padding: 0;
}

.bescheid-emphasis p {
  display: inline-block;
  margin: 0;
  margin-top: 8px;
  padding: 8px 15px;
  border: 3px double var(--deep-green);
  color: var(--deep-green);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transform: rotate(-4deg);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
  text-shadow: 0.5px 0.5px 1px rgba(27, 64, 36, 0.3);
  line-height: 1.3;
}

/* Was nun? — larger CTAs, label + sublabel */
.info-links {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 20px;
}

.info-links .btn {
  text-align: center;
  padding: 18px 20px;
  font-size: 1.05rem;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.info-links .cta-label {
  font-weight: 800;
}

.info-links .cta-sublabel {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0.9;
}

/* Was nun?: only the progression CTA (Zu PRÜF) uses orange when .primary is added */
.info-links .btn.primary.cta-pruef,
.info-links .btn.cta-pruef {
  background: var(--aktenmarker-orange);
  color: var(--paper-white);
  border: 1px solid rgba(13, 13, 13, 0.35);
  box-shadow: 3px 3px 0 rgba(13, 13, 13, 0.55);
}

.info-links .btn.primary.cta-pruef:hover,
.info-links .btn.cta-pruef:hover {
  background: var(--aktenmarker-orange-hover);
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 rgba(13, 13, 13, 0.6);
}

.info-links .btn.cta-spenden {
  background: rgba(139, 119, 101, 0.35);
  color: var(--pure-black);
  border: 1px solid rgba(115, 113, 81, 0.5);
  box-shadow: 2px 2px 0 rgba(13, 13, 13, 0.35);
}

.info-links .btn.cta-spenden:hover {
  background: rgba(139, 119, 101, 0.5);
  transform: translate(-2px, -2px);
  box-shadow: 3px 3px 0 var(--shadow-green);
}

.info-links .btn.cta-stand {
  background: rgba(115, 113, 81, 0.25);
  color: var(--pure-black);
  border: 1px solid rgba(13, 13, 13, 0.25);
  box-shadow: 2px 2px 0 rgba(13, 13, 13, 0.3);
}

.info-links .btn.cta-stand:hover {
  background: rgba(115, 113, 81, 0.4);
  transform: translate(-2px, -2px);
  box-shadow: 3px 3px 0 var(--shadow-green);
}

/* Widerspruch result — reveal lines one by one */
.result .result-line {
  opacity: 0;
  animation: reveal-line 0.4s ease forwards;
}

.result .result-line:nth-child(1) { animation-delay: 0.1s; }
.result .result-line:nth-child(2) { animation-delay: 0.35s; }
.result .result-line:nth-child(3) { animation-delay: 0.6s; }
.result .result-line:nth-child(4) { animation-delay: 0.85s; }

@keyframes reveal-line {
  to { opacity: 1; }
}
