/* HubStork Formulare: Gestaltung „Platte“ (Wahl von Anna, 06.11.2026; Entwurf: docs/entwuerfe-formulare/).
   Lädt nur auf den Seiten mit Formularen und nach dem CSS des Theme. :root hält die Spezifität gleich, damit diese Regeln
   auch Bereichsregeln wie .uz-form .field__label und .section--white .uz-form übersteuern. */
.hsf-fang {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
form[data-hsf-fertig] > :not(.hsf-erfolg) { display: none !important; }

/* --------------------------------------------------------------------------
   Kopf: Zeile in Mono mit roter Linie, Titel, Haarlinie
   -------------------------------------------------------------------------- */
:root .uz-form,
:root .sv-form {
  border-color: var(--steel-0);
  background: linear-gradient(color-mix(in srgb, var(--steel-0) 38%, transparent) 0 0), var(--surface-plate);   /* dieselbe Platte, im unteren Teil heller */
  box-shadow: var(--shadow-md), inset 0 1px 0 var(--steel-0);
}
:root .uz-signup .uz-form { box-shadow: var(--shadow-xl), inset 0 1px 0 var(--steel-0); }   /* die Karte im Newsletter-Kopf schwebt weiter */
:root .uz-form { gap: var(--space-6); }
:root .uz-form__head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3) var(--space-4);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--color-divider);
}
:root .uz-form__head::before,
:root .uz-form__head::after {
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-weight: var(--fw-medium);
  line-height: 1.3;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  white-space: nowrap;
}
:root .uz-form__head::before {
  content: "Ihre Angaben";
  content: "Ihre Angaben" / "";
  grid-area: 1 / 1;
  padding-left: 1.875rem;
  background: linear-gradient(var(--color-accent), var(--color-accent)) left center / 1.25rem 2px no-repeat;
  font-size: var(--fs-label);
}
:root .uz-form__head::after {
  content: "* Pflichtangabe";
  content: "* Pflichtangabe" / "";
  grid-area: 1 / 2;
  font-size: var(--fs-micro);
}
:root .uz-form__head > * { grid-column: 1 / -1; }
@media (max-width: 349.98px) {   /* beide Zeilen passen nicht nebeneinander: Pflichtangabe rückt unter den Titel */
  :root .uz-form__head::after { grid-area: auto; grid-column: 1 / -1; }
}
:root .uz-form__title {
  font-size: var(--fs-h3);
  font-weight: var(--fw-semibold);
  line-height: 1.15;
  letter-spacing: var(--tracking-h3);
}

/* --------------------------------------------------------------------------
   Beschriftungen und Felder
   -------------------------------------------------------------------------- */
:root .uz-form__grid { gap: var(--space-5) var(--space-4); }
:root .field { gap: var(--space-2); }
:root .field__label {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: var(--fw-medium);
  line-height: 1.3;
  transition: color var(--dur-fast) var(--ease-out);
}
:root form .req { color: inherit; }   /* Rot bleibt dem Knopf, das Sternchen wird in .uz-form__head erklärt */
:root .field__label .req { margin-left: 0.0625rem; }
:root .field__hint,
:root .form-note,
:root .sv-consent__text,
:root .uz-signup__privacy { color: var(--color-text-muted); }   /* auf dem unteren Teil der Platte sonst unter 4,5 : 1 */
:root .field:focus-within .field__label,
:root .field:has([aria-invalid="true"]) .field__label { color: var(--color-text); }

:root .input,
:root .select,
:root .textarea {
  min-height: 3.25rem;
  padding: 0.8125rem 1rem;
  border-color: var(--steel-500);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  box-shadow: var(--shadow-inset);
}
:root .select { padding-right: 2.75rem; }
:root .textarea { min-height: 8rem; }
:root .input:hover,
:root .select:hover,
:root .textarea:hover { border-color: var(--graphite-700); }
:root .input:focus-visible,
:root .select:focus-visible,
:root .textarea:focus-visible { border-color: var(--graphite-900); box-shadow: var(--focus-ring); }

/* Auswahl: 44 px, sonst die Sprache der Website (Graphit mit rotem Punkt) */
:root .uz-picks legend { margin-bottom: var(--space-2); }
:root .uz-pick span { min-height: var(--tap-min); border-color: var(--steel-500); font-size: 0.875rem; }
:root .uz-pick:hover span { border-color: var(--graphite-900); }
:root .uz-pick input:checked + span { border-color: var(--graphite-900); }
@media (max-width: 599.98px) {
  :root .uz-picks__row { display: grid; grid-template-columns: minmax(0, 1fr); }
  :root .uz-pick { display: flex; }
  :root .uz-pick span { flex: 1; }
}

/* Einwilligung und einzelne Häkchen: 44 px Tippfläche, das Zeilenbild bleibt */
:root .check { padding-block: 0.625rem; margin-block: -0.625rem; }
:root .sv-radio { padding-inline: var(--space-2); margin-inline: calc(var(--space-2) * -1); }
:root .sv-checks legend,
:root .sv-radios legend { margin-bottom: var(--space-2); }
:root .sv-consent__text { margin-left: 2.125rem; }
:root .check input {
  width: 1.375rem;
  height: 1.375rem;
  margin-top: 0;
  border-color: var(--steel-500);
}
:root .check input:checked { border-color: var(--graphite-900); }
:root .uz-consent { line-height: 1.55; }
:root .uz-consent a { position: relative; font-weight: var(--fw-medium); white-space: nowrap; }
:root .uz-consent a::after { content: ""; position: absolute; inset: -0.9375rem -0.25rem; }
:root .sv-consent a { padding-block: 0.9375rem; color: var(--color-text); font-weight: var(--fw-medium); }   /* langer Link, muss umbrechen dürfen */

/* Handlung: Haarlinie darüber, Rot bleibt allein der Knopf */
:root .uz-form__actions { padding-top: var(--space-6); border-top: 1px solid var(--color-divider); }
:root .uz-form__actions .btn,
:root .sv-form__submit .btn { --btn-h: 3.25rem; --btn-icon: 2.5rem; }
@media (max-width: 599.98px) {
  :root .uz-form__actions .btn,
  :root .sv-form__submit .btn { flex: 1 1 100%; min-width: 0; justify-content: space-between; white-space: normal; text-align: left; }
}

/* --------------------------------------------------------------------------
   Fehler am Feld: feine rote Kante, Text in Graphit, Zeichen und Worte tragen die Aussage
   -------------------------------------------------------------------------- */
:root .input[aria-invalid="true"],
:root .select[aria-invalid="true"],
:root .textarea[aria-invalid="true"],
:root .input[aria-invalid="true"]:hover,
:root .select[aria-invalid="true"]:hover,
:root .textarea[aria-invalid="true"]:hover,
:root .check input[aria-invalid="true"],
:root .check:has(+ .field__error:not([hidden])) input:not(:checked),
:root .sv-checks:has(.field__error:not([hidden])) input:not(:checked),
:root .sv-radios:has(.field__error:not([hidden])) input:not(:checked),
:root .uz-pick input[aria-invalid="true"] + span { border-color: var(--red-600); }
:root .input[aria-invalid="true"]:focus-visible,
:root .select[aria-invalid="true"]:focus-visible,
:root .textarea[aria-invalid="true"]:focus-visible { border-color: var(--graphite-900); }   /* Fokus sieht immer gleich aus: dunkle Kante plus Ring */

:root .field__error {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin: 0;
  color: var(--color-text);
  font-size: 0.8125rem;
  font-weight: var(--fw-medium);
  line-height: 1.35;
  text-wrap: balance;
}
/* Meldet nur der Server ein Feld (ohne Text darunter), steht das Zeichen an der Beschriftung: nie nur Farbe */
:root .field__error::before,
:root .field:has([aria-invalid="true"]):not(:has(.field__error:not([hidden]))) .field__label::after { content: "!"; content: "!" / ""; }
:root .field__error::before,
:root .field:has([aria-invalid="true"]):not(:has(.field__error:not([hidden]))) .field__label::after,
:root .hsf-hinweis__zeichen {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 1.0625rem;
  height: 1.0625rem;
  margin: 0;
  border-radius: var(--radius-round);
  background: var(--graphite-900);
  color: var(--steel-0);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: var(--fw-medium);
  line-height: 1;
}
:root .field:has([aria-invalid="true"]):not(:has(.field__error:not([hidden]))) .field__label::after { margin: -0.1875rem 0 -0.1875rem var(--space-1); vertical-align: -0.1875rem; }
:root .uz-consent + .field__error { margin-top: calc(var(--space-4) * -1); padding-left: 2.125rem; }

/* Sammelmeldung der Garantie: ohne rote Fläche */
:root .sv-form__summary { border-color: var(--color-border-strong); border-radius: var(--radius-sm); background: var(--color-bg-raised); box-shadow: var(--shadow-xs); }
:root .sv-form__summary a { color: var(--color-text); }

/* --------------------------------------------------------------------------
   Hinweis im Formular: weiße Leiste auf der Platte
   -------------------------------------------------------------------------- */
:root .hsf-meldung:focus { outline: none; }
:root .hsf-hinweis {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-raised);
  box-shadow: var(--shadow-xs);
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}
:root .sv-form > .hsf-hinweis,
:root .sv-form > .hsf-sendet { margin-top: var(--space-5); }
:root .hsf-hinweis p { margin: 0; }
:root .hsf-hinweis__zeichen { width: 1.375rem; height: 1.375rem; font-size: 0.8125rem; }
:root .hsf-hinweis__text { display: grid; gap: 0.125rem; min-width: 0; }
:root .hsf-hinweis__titel { color: var(--color-text); font-weight: var(--fw-medium); }

/* Telefon: Tippfläche 44 px, ohne die Zeile zu sprengen */
:root .hsf-tel {
  position: relative;
  color: var(--color-text);
  font-weight: var(--fw-medium);
  white-space: nowrap;
  border-radius: var(--radius-xs);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
:root .hsf-tel:hover { color: var(--color-accent-text); }
:root .hsf-tel::after { content: ""; position: absolute; inset: -0.875rem -0.25rem; }

/* --------------------------------------------------------------------------
   Wird gesendet: der Knopf ist gesperrt, der rote Punkt läuft die Haarlinie entlang
   -------------------------------------------------------------------------- */
:root form .btn[type="submit"][disabled] {
  border-color: var(--steel-400);
  background: var(--steel-200);
  box-shadow: none;
  color: var(--steel-700);
  opacity: 1;
  pointer-events: auto;
  cursor: progress;
  transform: none;
}
:root form .btn[type="submit"][disabled] .btn__icon { background: var(--steel-0); color: var(--steel-700); transform: none; }
:root .hsf-sendet {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-top: calc(var(--space-2) * -1);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: var(--fw-medium);
  line-height: 1.3;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  white-space: nowrap;
}
:root .hsf-sendet__spur { position: relative; flex: 1; min-width: 3rem; height: 1px; background: var(--color-border-strong); }
:root .hsf-sendet__spur::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 0.5rem;
  height: 0.5rem;
  margin-top: -0.25rem;
  border-radius: var(--radius-round);
  background: var(--color-accent);
}
@media (prefers-reduced-motion: no-preference) {
  :root .hsf-sendet__spur::after { animation: hsf-spur 1.6s var(--ease-in-out) infinite alternate; }
}
@keyframes hsf-spur { from { left: 0; } to { left: calc(100% - 0.5rem); } }

/* --------------------------------------------------------------------------
   Bestätigung: Graphitscheibe, roter Punkt, große Zeile, Haarlinie, Telefon
   -------------------------------------------------------------------------- */
:root .hsf-danke {
  --hsf-scheibe: 5.5rem;
  --hsf-ring: var(--space-2);
  --hsf-schatten: var(--shadow-md);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-6) var(--space-7);
  padding: var(--space-3) 0 0;
}
:root .hsf-danke p { margin: 0; }
:root .hsf-danke__marke {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: var(--hsf-scheibe);
  height: var(--hsf-scheibe);
  margin: var(--hsf-ring);
  border-radius: var(--radius-round);
  background: linear-gradient(180deg, var(--graphite-700) 0%, var(--graphite-950) 100%);
  box-shadow: 0 0 0 var(--hsf-ring) var(--steel-0), 0 0 0 calc(var(--hsf-ring) + 1px) var(--color-border-strong), var(--hsf-schatten);
  color: var(--steel-0);
}
:root .hsf-danke__marke .icon { width: 76%; height: 76%; stroke-width: 1.5; stroke-dasharray: 21; stroke-dashoffset: 0; }
:root .hsf-danke__marke::after {
  content: "";
  position: absolute;
  top: 15%;
  right: 15%;
  width: 0.5625rem;
  height: 0.5625rem;
  border-radius: var(--radius-round);
  background: var(--color-accent);
}
:root .hsf-danke__kopf { flex: 1 1 15rem; display: grid; gap: var(--space-2); min-width: 0; }
:root .hsf-danke__titel {
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: var(--fw-medium);
  line-height: var(--lh-display);
  letter-spacing: var(--tracking-h2);
}
:root .hsf-danke__satz { color: var(--color-text-muted); font-size: var(--fs-lead); line-height: 1.35; text-wrap: balance; }
:root .hsf-danke__kontakt {
  flex: 1 0 100%;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-divider);
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}
:root .hsf-danke__kontakt .icon { flex: none; width: 1.25rem; height: 1.25rem; margin: 0.0625rem 0 0 -0.1875rem; color: var(--color-text); }   /* Hörer steht optisch auf der Linie */

/* Klein: im Newsletter-Kasten */
:root .hsf-danke--klein { --hsf-scheibe: 3.75rem; --hsf-ring: var(--space-1); --hsf-schatten: var(--shadow-sm); gap: var(--space-4) var(--space-5); padding: var(--space-2) 0; }
:root .hsf-danke--klein .hsf-danke__marke::after { width: 0.375rem; height: 0.375rem; }
:root .hsf-danke--klein .hsf-danke__titel { font-size: var(--fs-h3); line-height: 1.1; }
:root .hsf-danke--klein .hsf-danke__satz { font-size: var(--fs-body); }
:root .hsf-danke--klein .hsf-danke__kopf { flex-basis: 10rem; gap: var(--space-1); }

/* Bewegung: Scheibe kommt, Haken zieht sich, zuletzt der Punkt; ohne Bewegung steht alles sofort */
@media (prefers-reduced-motion: no-preference) {
  :root .hsf-danke__marke { animation: hsf-scheibe var(--dur-slow) var(--ease-out) both; }
  :root .hsf-danke__marke .icon { animation: hsf-haken var(--dur-slow) var(--ease-out) 120ms both; }
  :root .hsf-danke__marke::after { animation: hsf-punkt var(--dur-base) var(--ease-spring) 380ms both; }
}
@keyframes hsf-scheibe { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
@keyframes hsf-haken { from { stroke-dashoffset: 21; } to { stroke-dashoffset: 0; } }
@keyframes hsf-punkt { from { opacity: 0; transform: scale(.2); } to { opacity: 1; transform: none; } }

/* Hoher Kontrast: Formen tragen die Aussage */
@media (forced-colors: active) {
  :root .hsf-danke__marke, :root .hsf-hinweis__zeichen, :root .field__error::before { border: 1px solid CanvasText; }
  :root .hsf-hinweis { border-color: CanvasText; }
  :root .hsf-danke__marke::after, :root .hsf-sendet__spur::after { background: Highlight; }
  :root .hsf-sendet__spur { background: CanvasText; }
}

/* Die beiden Zeilen im Formularkopf stehen im CSS, deshalb hier die englische Fassung */
:root:lang(en) .uz-form__head::before { content: "Your details"; content: "Your details" / ""; }
:root:lang(en) .uz-form__head::after { content: "* Required"; content: "* Required" / ""; }
