/* formulare.css */
/* formulare.css – Formulare und Formularseiten (AW-10; Umsetzungsblatt 3.4, 5.4, 5.9). Farben nur über werte.css,
   Fehlerzustand mit --fehler…; Abfragen nur mit Namen aus umschaltbreiten.json. Gemeldet von formular(art) und den
   Danke-, Fehler- und Bestätigungsseiten. */

/* Seiten mit Formular */
.fo-seite { padding: 48px 0 80px; }
@media (min-width: 720px) { .fo-seite { padding: 72px 0 112px; } }
.fo-wrap { max-width: 880px; }
.fo-kopf { margin-bottom: 32px; }
.fo-kopf h1 { font-size: clamp(2.1rem, 1.5rem + 2.4vw, 3.1rem); line-height: 1.1; letter-spacing: -.035em; font-weight: 800; overflow-wrap: break-word; }
.fo-einleitung { font-size: 1.125rem; line-height: 1.6; color: var(--text-2); margin-top: 16px; max-width: 62ch; }
.fo-einleitung p + p { margin-top: .6em; }
.fo-karte { background: var(--karte); border: 1px solid var(--rahmen); border-radius: var(--r-l); box-shadow: var(--schatten-1); padding: 24px 16px; }
@media (min-width: 720px) { .fo-karte { padding: 40px; } }
.fo-karte > .platzhalter--block { margin-bottom: 20px; }
/* Platzhalter nach dem Formular nicht direkt am Knopf „bestellen“ (D8) */
.fo-karte > .formular + .platzhalter--block { margin-top: 32px; }
.fo-weiter { margin-top: 32px; list-style: none; display: flex; flex-wrap: wrap; gap: 12px 28px; }
.fo-wege { margin: 32px 0 0; display: grid; gap: 16px; }
@media (min-width: 720px) { .fo-wege { grid-template-columns: 1fr 1fr; } }
.fo-wege > div { background: var(--karte); border: 1px solid var(--rahmen); border-radius: var(--r); padding: 16px 20px; }
.fo-wege dt { font-size: .875rem; font-weight: 600; color: var(--text-2); }
.fo-wege dd { margin: 4px 0 0; font-size: 1.0625rem; font-weight: 600; overflow-wrap: anywhere; }

/* Formular */
.formular { display: grid; gap: 24px; }
.fo-pflichthinweis, .fo-feldhinweis { font-size: .9375rem; color: var(--text-2); }
.fo-gruppe { border: 0; margin: 0; padding: 0; min-width: 0; }
.fo-karte { container-type: inline-size; }
/* Gruppentitel an die Kartenbreite gebunden: „Rechnungsanschrift“ passt auch bei 320 px und 24 px Schrift (D3) */
.fo-gruppe-titel { padding: 0; font-size: min(1.25rem, 8.5cqi); font-weight: 750; letter-spacing: -.02em; margin-bottom: 16px; }
.fo-raster { display: grid; gap: 20px; }
@media (min-width: 720px) { .fo-raster { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px 24px; } .fo-feld--breit { grid-column: 1 / -1; } }
.fo-feld { display: grid; gap: 6px; align-content: start; min-width: 0; }
fieldset.fo-feld { border: 0; margin: 0; padding: 0; }
.fo-label { padding: 0; font-weight: 600; font-size: 1rem; color: var(--text); }
.fo-stern { color: var(--fehler); margin-left: .2em; }
.fo-eingabe { width: 100%; min-height: 48px; padding: .7rem .85rem; font: inherit; font-size: 1rem; line-height: 1.4; color: var(--text); background: var(--weiss); border: 1px solid var(--rahmen-2); border-radius: var(--knopf-r); }
textarea.fo-eingabe { min-height: 9rem; resize: vertical; }
.fo-eingabe:hover { border-color: var(--text-3); }
.fo-eingabe:focus { border-color: var(--blau); }
.fo-optionen-liste { display: flex; flex-wrap: wrap; gap: 10px; }
.fo-option { display: inline-flex; align-items: center; gap: .6rem; min-height: 48px; padding: .55rem 1rem; background: var(--weiss); border: 1px solid var(--rahmen-2); border-radius: var(--knopf-r); cursor: pointer; }
.fo-option:hover { border-color: var(--text-3); }
.fo-option:has(input:checked) { border-color: var(--blau); background: var(--blau-50); }
.fo-option input, .fo-haken input { width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--knopf); flex: none; }
.fo-haken { grid-template-columns: auto minmax(0, 1fr); column-gap: .75rem; align-items: start; }
.fo-haken input { margin-top: .2rem; }
.fo-haken .fo-fehlt { grid-column: 2; }
.fo-haken-text { font-size: .9375rem; line-height: 1.5; cursor: pointer; }
.fo-hinweise { display: grid; gap: 10px; border-top: 1px solid var(--rahmen); padding-top: 20px; }
.fo-hinweis { font-size: .875rem; line-height: 1.55; color: var(--text-2); }
.fo-hinweis--test { font-size: .9375rem; color: var(--text); background: var(--blau-50); border: 1px solid var(--blau-200); border-radius: var(--r); padding: 12px 16px; }
.fo-absenden { display: flex; }
@media print { .fo-absenden { display: none; } }

/* Fehlerzustand (Bestätigungsseite: fehlende Pflichtangaben) */
.fo-meldung { margin-top: 20px; padding: 12px 16px; color: var(--fehler-h); background: var(--fehler-grund); border: 1px solid var(--fehler-rand); border-radius: var(--r); font-weight: 600; }
.fo-fehlt { font-size: .9375rem; font-weight: 600; color: var(--fehler); }
.fo-feld--fehlt .fo-eingabe, .fo-feld--fehlt .fo-option { border-color: var(--fehler); background: var(--fehler-grund); }

/* Lockfeld (5.9): außerhalb des sichtbaren Bereichs, für Tastatur und Bildschirmleser nicht erreichbar */
.fo-lock { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
@media print { .fo-lock { display: none; } }
/* messung.css */
/* messung.css – Fenster zur Einwilligung in die Anzeigen-Messung (teile/messung.njk; B76, B86, B90, K68; AW-15, AW-17).
   Präfix mb-. Vorgeschobenes Fenster (<dialog>, showModal) in der Mitte; die Seite dahinter ist abgedunkelt und gesperrt
   (kein Klick, kein Rollen). Zwei Ebenen im selben Fenster, je mit rollendem Text und festem Knopfbereich: Passt bis
   320 px und 24 px Standardschrift in den Bildschirm, zu langer Text rollt im Fenster, die Knöpfe bleiben sichtbar.
   Knöpfe je Ebene gleich groß; schmal (auch 390 px) untereinander, breit nebeneinander (Container-Abfragen in em).
   Ohne JavaScript bleibt der <dialog> zu; deshalb steht display nur an .mb[open] und an sichtbaren Ebenen. */
.mb { container: mb / inline-size; width: min(40rem, calc(100% - 32px)); max-width: none; max-height: calc(100% - 32px); padding: 0; border: 0; border-radius: var(--r-l); background: var(--weiss); color: var(--text); box-shadow: var(--schatten-2); overflow: hidden; }
.mb[open] { display: flex; flex-direction: column; }
.mb::backdrop { background: var(--abdunkelung); }
/* Fokus beim Öffnen steht auf dem Fenster bzw. dem Titel der zweiten Ebene; beide sind keine Bedienelemente, daher ohne Rahmen */
.mb:focus, .mb-titel:focus { outline: none; }
.mb-ebene:not([hidden]) { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.mb-text { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 24px 24px 8px; font-size: .9375rem; line-height: 1.55; color: var(--text-2); overflow-wrap: break-word; }
.mb-titel { font-size: 1.1875rem; line-height: 1.3; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.mb-knoepfe { flex: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 16px 24px 24px; }
.mb-knoepfe .knopf { width: 100%; min-width: 0; padding-inline: .75rem; overflow-wrap: anywhere; }

/* zweite Ebene: Arten von Speicherung mit Titel und Status bzw. Schalter */
.mb-art { border-top: 1px solid var(--rahmen); padding-top: 14px; margin-top: 14px; }
.mb-art > * + * { margin-top: 6px; }
.mb-art-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mb-art-titel { min-width: 0; font-weight: 700; color: var(--text); }
label.mb-art-titel { cursor: pointer; }
.mb-art code { font-size: .875em; }
/* Schalter: echtes Kontrollkästchen (role="switch") unsichtbar über der gezeichneten Spur, damit Klick und Tastatur wirken */
.mb-schalter-ort { position: relative; flex: none; width: 44px; height: 26px; }
.mb-schalter-feld { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.mb-schalter { position: absolute; inset: 0; border-radius: 13px; background: var(--knopf-rahmen); transition: background-color .15s; }
.mb-schalter::before { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--weiss); box-shadow: var(--schatten-1); transition: transform .15s var(--ease); }
.mb-schalter-feld:checked + .mb-schalter { background: var(--blau); }
.mb-schalter-feld:checked + .mb-schalter::before { transform: translateX(18px); }
.mb-schalter-feld:focus-visible + .mb-schalter { outline: 3px solid var(--blau); outline-offset: 2px; }

/* breiter: erste Ebene zwei Hauptknöpfe nebeneinander, „Einstellungen“ darunter über die volle Breite;
   zweite Ebene drei Knöpfe nebeneinander */
@container mb (min-width: 30em) {
  .mb-text { padding: 32px 32px 8px; }
  .mb-knoepfe { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 20px 32px 32px; }
  .mb-mehr { grid-column: 1 / -1; }
}
@container mb (min-width: 36em) { .mb-knoepfe--drei { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container mb (min-width: 30em) and (max-width: 35.99em) { .mb-knoepfe--drei { grid-template-columns: minmax(0, 1fr); } }

/* Seite hinter dem offenen Fenster rollt nicht (nur am Bildschirm, damit der Druck nichts abschneidet) */
@media screen { :root:has(.mb[open]) { overflow: hidden; } }
/* sanftes Einblenden nur ohne Wunsch nach reduzierter Bewegung; in der ruhigen Fassung keine Bewegung */
@media (prefers-reduced-motion: no-preference) {
  .mb[open], .mb[open]::backdrop { animation: mb-ein .18s ease-out; }
}
@media (prefers-reduced-motion: reduce) { .mb-schalter, .mb-schalter::before { transition: none; } }
@keyframes mb-ein { from { opacity: 0; } }
@media print { .mb, .mb::backdrop { display: none !important; } }
/* Nach der Wahl steht der Fokus am Anfang der Seite (messung.js setzt ihn kurz auf body); ohne Rahmen um die ganze Seite */
body[tabindex="-1"]:focus { outline: none; }