/* ======== Der Zugang für Autohäuser (seit 2026-11-15) ========
 *
 * autohaus.eförderungen.de: die Anmeldeseite (Zusätze zu
 * verwaltung/quelle/anmeldung.css, die bauen.mjs --autohaus mitkopiert) und
 * die Übersicht des Autohauses. Maße, Farben und Texte wie in der
 * abgenommenen Vorschau („Du kannst es so übernehmen“). Farben aus
 * ../logo/tokens.css (über /stil.css), die Töne der Plaketten wie in der
 * Verwaltung. Kein Inline-Stil: Die CSP sperrt ihn.
 */

.ah [hidden] { display: none !important; }

/* ---------------- Anmeldeseite: was zu Entwurf B dazukommt ---------------- */

.ah-marke-mitte {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ah-marke-mitte .anm-marke-text {
  margin: 0;
}

.ah-chip {
  align-self: flex-start;
  margin: 0;
  padding: 5px 12px;
  border-radius: 999px;
  background: #1E4478; /* Navy, aufgehellt; Weiß darauf 9,6 : 1 */
  color: var(--weiss);
  font-size: 13px;
  font-weight: var(--schrift-gewicht-betont);
}

.ah-haken {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  color: var(--weiss);
  font-size: 15px;
  line-height: 1.45;
}

.ah-haken li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.ah-haken svg {
  flex: none;
  inline-size: 20px;
  block-size: 20px;
  margin-top: 1px;
  color: var(--marke-gruen); /* Zierde auf Navy, keine Schrift */
}

.ah-hinweis {
  margin: 20px 0 0;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--grund);
  color: var(--text-leise);
  font-size: 14px;
  line-height: 1.5;
}

.ah-hinweis a {
  color: var(--marke-navy);
  font-weight: var(--schrift-gewicht-betont);
}

@media (max-width: 860px) {
  .ah-marke-mitte {
    gap: 10px;
  }

  .ah-haken {
    display: none;
  }
}

/* ---------------- Übersicht ---------------- */

body.ah {
  min-block-size: 100vh;
  background: var(--grund);
  color: var(--text);
}

.ah a {
  color: var(--marke-navy);
}

.ah button:focus-visible,
.ah a:focus-visible,
.ah input:focus-visible {
  outline: 2px solid var(--marke-navy);
  outline-offset: 2px;
}

.ah-leise {
  margin: 0;
  color: var(--text-leise);
  font-size: 13.5px;
}

.ah-leise.klein {
  font-size: 12.5px;
  font-weight: var(--schrift-gewicht-betont);
}

/* Kopf */
.ah-kopf {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  min-block-size: 64px;
  padding: 10px 24px;
  border-bottom: 1px solid #E3E7EC;
  background: var(--weiss);
}

.ah-marke {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ah-marke img {
  display: block;
  inline-size: auto;
  block-size: 32px;
}

.ah-marke span {
  padding-left: 12px;
  border-left: 1px solid var(--linie);
  color: var(--marke-navy);
  font-size: 15px;
  font-weight: 700;
}

.ah-kopf-rechts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.ah-wer {
  display: flex;
  flex-direction: column;
  margin: 0;
  line-height: 1.3;
}

.ah-wer strong {
  font-size: 14px;
  font-weight: 700;
}

.ah-wer span {
  color: var(--text-leise);
  font-size: 12.5px;
}

.ah-abmelden {
  display: inline-flex;
  align-items: center;
  min-block-size: 40px;
  padding: 0 14px;
  border: 1px solid var(--linie);
  border-radius: 8px;
  background: var(--weiss);
  color: var(--marke-navy);
  font: inherit;
  font-size: 14px;
  font-weight: var(--schrift-gewicht-betont);
  cursor: pointer;
}

.ah-abmelden:hover {
  border-color: var(--marke-navy);
}

/* Inhalt */
/* inline-size: 100 %: body ist eine Flex-Spalte (stil.css), und mit
   margin: auto nähme der Inhalt sonst die Breite seines breitesten Kindes an
   — am Handy die Filterleiste, die dort in einer Zeile scrollen soll. */
.ah-haupt {
  display: flex;
  flex-direction: column;
  gap: 24px;
  inline-size: 100%;
  max-inline-size: 1280px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.ah-haupt:focus {
  outline: none;
}

.ah-einleitung {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ah-einleitung h1 {
  margin: 0;
  color: var(--marke-navy);
  font-size: 28px;
  font-weight: var(--schrift-gewicht-titel);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.ah-einleitung p:not(.ah-leise) {
  max-inline-size: 70ch;
  margin: 0;
  font-size: 15.5px;
  line-height: 1.55;
}

.ah-laden,
.ah-fehler {
  margin: 0;
  font-size: 15px;
}

.ah-fehler {
  padding: 14px 16px;
  border-radius: 10px;
  background: #FDECEC;
  color: #9B1C1C;
}

/* Kennzahlen */
.ah-kennzahlen {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.ah-kachel {
  flex: 1 1 200px;
  padding: 18px 20px;
  border: 1px solid #E3E7EC;
  border-radius: 12px;
  background: var(--weiss);
}

.ah-kachel p {
  margin: 0;
}

.ah-kachel-titel {
  color: var(--text-leise);
  font-size: 13px;
  font-weight: var(--schrift-gewicht-betont);
}

.ah-kachel-wert {
  margin-top: 6px !important;
  color: var(--marke-navy);
  font-size: 30px;
  font-weight: var(--schrift-gewicht-titel);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.ah-kachel-unter {
  margin-top: 6px !important;
  color: var(--text-leise);
  font-size: 12.5px;
  line-height: 1.4;
}

/* Suche und Filter */
.ah-werkzeuge {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

.ah-suche {
  position: relative;
  display: block;
  flex: 1 1 260px;
  max-inline-size: 360px;
}

.ah-suche svg {
  position: absolute;
  inset-inline-start: 14px;
  inset-block-start: 14px;
  inline-size: 18px;
  block-size: 18px;
  color: var(--text-leise);
}

.ah-suche input {
  inline-size: 100%;
  block-size: 46px;
  padding: 0 14px 0 42px;
  border: 1px solid #C4CDD8;
  border-radius: 8px;
  background: var(--weiss);
  color: var(--text);
  font: inherit;
  font-size: 15px;
}

.ah-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ah-filter-knopf {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-block-size: 40px;
  padding: 0 14px;
  border: 1px solid #C4CDD8;
  border-radius: 999px;
  background: var(--weiss);
  color: var(--marke-navy);
  font: inherit;
  font-size: 14px;
  font-weight: var(--schrift-gewicht-betont);
  cursor: pointer;
}

.ah-filter-knopf[aria-pressed="true"] {
  border-color: var(--marke-navy);
  background: var(--marke-navy);
  color: var(--weiss);
}

.ah-filter-knopf .zahl {
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
}

/* Liste und Einzelheiten */
.ah-raster {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 24px;
}

.ah-liste {
  flex: 999 1 560px;
  min-inline-size: 0;
  overflow: hidden;
  border: 1px solid #E3E7EC;
  border-radius: 12px;
  background: var(--weiss);
}

.ah-liste-kopf {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  background: var(--grund);
  color: var(--text-leise);
  font-size: 12.5px;
  font-weight: var(--schrift-gewicht-betont);
}

.ah-liste ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ah-zeile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  inline-size: 100%;
  padding: 14px 18px;
  border: 0;
  border-top: 1px solid #E3E7EC;
  background: var(--weiss);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ah-zeile:hover {
  background: #F8FAFC;
}

.ah-zeile[aria-pressed="true"] {
  background: var(--marke-navy-hell);
}

.ah-zeile:focus-visible {
  outline-offset: -2px !important;
}

.ah-zeile-links,
.ah-zeile-rechts {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-inline-size: 0;
}

.ah-zeile-rechts {
  align-items: flex-end;
  gap: 4px;
}

.ah-zeile-name {
  font-size: 15px;
  font-weight: 700;
}

.ah-zeile-unter {
  color: var(--text-leise);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.ah-zeile-marken {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.ah-liste-leer {
  margin: 0;
  padding: 24px 18px;
  border-top: 1px solid #E3E7EC;
  color: var(--text-leise);
  font-size: 14px;
  line-height: 1.5;
}

/* Plaketten: Text immer dabei, der Punkt ist nur Zierde. Die Töne wie in
   der Verwaltung (verwaltung/quelle/admin.css), jede Schrift mindestens
   4,5 : 1 auf ihrem Grund. */
.ton-grau { background: #EEF0F3; color: #3C4858; }
.ton-gelb { background: #FFF1CC; color: #6E4B00; }
.ton-blau { background: var(--marke-navy-hell); color: var(--marke-navy); }
.ton-gruen { background: var(--marke-gruen-hell); color: var(--marke-gruen-dunkel); }
.ton-gruen-voll { background: var(--marke-gruen-dunkel); color: var(--weiss); }
.ton-rot { background: #FDECEC; color: #9B1C1C; }

.ah-plakette {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: var(--schrift-gewicht-betont);
  white-space: nowrap;
}

.ah-plakette .punkt {
  inline-size: 7px;
  block-size: 7px;
  border-radius: 50%;
  background: currentColor;
}

.ah-plakette.gross {
  align-self: flex-start;
  padding: 4px 12px;
  font-size: 13.5px;
  font-weight: 700;
}

.ah-plakette.gross .punkt {
  inline-size: 8px;
  block-size: 8px;
}

.ah-gutschrift-marke {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border: 1px solid #B9D9AD;
  border-radius: 999px;
  background: var(--weiss);
  color: var(--marke-gruen-dunkel);
  font-size: 12px;
  font-weight: var(--schrift-gewicht-betont);
  white-space: nowrap;
}

.ah-detail {
  display: flex;
  flex: 1 1 380px;
  flex-direction: column;
  gap: 20px;
  min-inline-size: 0;
  padding: 24px;
  border: 1px solid #E3E7EC;
  border-radius: 12px;
  background: var(--weiss);
  scroll-margin-top: 16px;
}

.ah-detail-kopf {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ah-detail h2 {
  margin: 0;
  color: var(--marke-navy);
  font-size: 22px;
  font-weight: var(--schrift-gewicht-titel);
  line-height: 1.25;
}

.ah-detail h3 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
}

.ah-angaben {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  margin: 0;
}

.ah-angaben dt {
  color: var(--text-leise);
  font-size: 12.5px;
  font-weight: var(--schrift-gewicht-betont);
}

.ah-angaben dd {
  margin: 3px 0 0;
  font-size: 14px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

.ah-stand {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border-radius: 10px;
  background: var(--grund);
}

.ah-stand p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

/* Der Verlauf: Punkte mit Linie; grün, was erledigt ist. */
.ah-verlauf {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ah-verlauf li {
  position: relative;
  display: flex;
  gap: 14px;
  padding-bottom: 14px;
}

.ah-verlauf li:not(:last-child)::before {
  content: "";
  position: absolute;
  inset-block: 24px 2px;
  inset-inline-start: 8px;
  inline-size: 2px;
  background: var(--linie);
}

.ah-verlauf li.linie-gruen::before {
  background: var(--marke-gruen-dunkel);
}

.ah-verlauf-punkt {
  flex: none;
  inline-size: 16px;
  block-size: 16px;
  margin: 2px 1px 0;
  border: 2px solid #C4CDD8;
  border-radius: 50%;
  background: var(--weiss);
}

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

.ah-verlauf .label {
  color: var(--text-leise);
  font-size: 14px;
}

.ah-verlauf .datum {
  color: var(--text-leise);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.ah-verlauf .erledigt .ah-verlauf-punkt { border-color: var(--marke-gruen-dunkel); background: var(--marke-gruen-dunkel); }
.ah-verlauf .erledigt .label { color: var(--text); font-weight: var(--schrift-gewicht-betont); }
.ah-verlauf .naechster .ah-verlauf-punkt { border-color: var(--marke-navy); box-shadow: 0 0 0 4px var(--marke-navy-hell); }
.ah-verlauf .naechster .label { color: var(--marke-navy); font-weight: var(--schrift-gewicht-betont); }
.ah-verlauf .hinweis .ah-verlauf-punkt { border-color: #C98A00; background: #FFF1CC; box-shadow: 0 0 0 4px #FFF4D6; }
.ah-verlauf .hinweis .label { color: #6E4B00; font-weight: 700; }
.ah-verlauf .abgelehnt .ah-verlauf-punkt { border-color: #9B1C1C; background: #9B1C1C; box-shadow: 0 0 0 4px #FDECEC; }
.ah-verlauf .abgelehnt .label { color: #9B1C1C; font-weight: 700; }
.ah-verlauf .zurueckgezogen .ah-verlauf-punkt { border-color: #3C4858; background: #3C4858; box-shadow: 0 0 0 4px #EEF0F3; }
.ah-verlauf .zurueckgezogen .label { color: #3C4858; font-weight: 700; }

.ah-gutschrift {
  margin: 0;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--marke-gruen-hell);
  color: var(--marke-gruen-dunkel);
  font-size: 14px;
  font-weight: var(--schrift-gewicht-betont);
  line-height: 1.45;
}

.ah-schutz {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid #E3E7EC;
  border-radius: 10px;
}

.ah-schutz p {
  margin: 0;
  color: var(--text-leise);
  font-size: 13px;
  line-height: 1.5;
}

/* Das Schloss als Maske: ein SVG als Hintergrund aus der eigenen Datei wäre
   ein Bild mehr; so färbt es sich mit der Schrift. */
.ah-schutz-zeichen {
  flex: none;
  inline-size: 20px;
  block-size: 20px;
  margin-top: 1px;
  background: var(--text-leise);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Autohaus-ID und QR-Code */
.ah-qr {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px 32px;
  padding: 24px;
  border: 1px solid #E3E7EC;
  border-radius: 12px;
  background: var(--weiss);
}

.ah-qr-bild {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.ah-qr-bild img {
  display: block;
  inline-size: 168px;
  block-size: 168px;
  border: 1px solid var(--linie);
  border-radius: 8px;
}

.ah-qr-bild a {
  font-size: 13px;
  font-weight: var(--schrift-gewicht-betont);
}

.ah-qr-text {
  display: flex;
  flex: 1 1 320px;
  flex-direction: column;
  gap: 10px;
  min-inline-size: 0;
}

.ah-qr-text h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.ah-qr-text p {
  max-inline-size: 64ch;
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
}

.ah-qr-text .ah-qr-kennung {
  color: var(--marke-navy);
  font-size: 28px;
  font-weight: var(--schrift-gewicht-titel);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.ah-fuss {
  margin: 0;
  color: var(--text-leise);
  font-size: 13.5px;
}

.ah-fuss a:first-child {
  font-weight: var(--schrift-gewicht-betont);
}

.ah-fuss a:not(:first-child) {
  color: var(--text-leise);
}

/* Handy: wie die Ansicht „Übersicht am Handy“ der Vorschau — kompakter Kopf,
   die Zeilen als Karten, das Detail unter der Liste. */
@media (max-width: 899px) {
  .ah-detail {
    flex-basis: 100%;
  }
}

@media (max-width: 600px) {
  .ah-kopf {
    padding: 8px 16px;
  }

  .ah-marke img {
    block-size: 26px;
  }

  .ah-marke span {
    padding-left: 10px;
    font-size: 13px;
  }

  .ah-wer {
    display: none;
  }

  .ah-haupt {
    gap: 18px;
    padding: 20px 16px 40px;
  }

  .ah-einleitung h1 {
    font-size: 22px;
  }

  .ah-kachel {
    flex-basis: calc(50% - 8px);
    padding: 14px 16px;
  }

  .ah-kachel-wert {
    font-size: 24px;
  }

  .ah-filter {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .ah-filter-knopf {
    flex: none;
    min-block-size: 36px;
    font-size: 13px;
  }

  .ah-liste {
    flex-basis: 100%;
    overflow: visible;
    border: 0;
    background: none;
  }

  .ah-liste-kopf {
    display: none;
  }

  .ah-liste ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  /* Die Karte: oben Name und „seit“, darunter Nummer und Weg, dann die
     Plaketten. display: contents legt die Teile beider Spalten in ein Raster. */
  .ah-zeile {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name   seit"
      "unter  unter"
      "marken marken";
    gap: 4px 12px;
    border: 1px solid #E3E7EC;
    border-radius: 12px;
  }

  .ah-zeile-links,
  .ah-zeile-rechts {
    display: contents;
  }

  .ah-zeile-links .ah-zeile-name { grid-area: name; }
  .ah-zeile-links .ah-zeile-unter { grid-area: unter; }
  .ah-zeile-rechts > .ah-zeile-unter { grid-area: seit; align-self: center; font-size: 12px; }

  .ah-zeile-marken {
    grid-area: marken;
    justify-content: flex-start;
    margin-top: 4px;
  }

  .ah-liste-leer {
    border: 1px solid #E3E7EC;
    border-radius: 12px;
    background: var(--weiss);
  }

  .ah-detail,
  .ah-qr {
    padding: 18px 16px;
  }

  .ah-angaben {
    grid-template-columns: minmax(0, 1fr);
  }
}
