/*
 * Gestaltung des Vorab-Fragebogens.
 *
 * Uebernommen aus der visuellen Identitaet von Mace Woodville: eine einzige
 * Akzentfamilie in Mineralgruen, warmes Knochenweiss statt reinem Weiss,
 * Haarlinien statt Kaesten, Serifenschrift fuer Ueberschriften, Grotesk fuer
 * den Text, Kennzeilen in Versalien. Die Referenz ist eine dunkle Welt; ein
 * Fragebogen wird gelesen, ausgedruckt und ausgefuellt, deshalb ist das hier
 * die helle Fassung derselben Sprache.
 *
 * Keine externe Schrift, kein CDN, kein Bild von fremden Servern.
 */

:root {
  /* Flaechen */
  --papier: #ffffff;
  --flaeche: #f4f1ea;
  --flaeche-tief: #ebe7dd;

  /* Text */
  --ton: #101210;
  --ton-leise: #55564d;

  /* Kanten */
  --kante: #ddd8cb;
  --kante-klar: #b9b2a1;

  /* Akzent - eine Familie */
  --akzent: #33604a;
  --akzent-tief: #244435;
  --akzent-hell: #7fb394;
  --akzent-schleier: #e8f0ea;
  --auf-akzent: #ffffff;

  /* Zustaende */
  --warnung: #8c2f1f;
  --warnung-schleier: #fbeae6;

  /* Schrift: Systemschriften, damit nichts nachgeladen wird. */
  --serife: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, ui-serif, serif;
  --grotesk: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Rhythmus */
  --spiegel: 46rem;
  --rand: clamp(1.25rem, 5vw, 2.5rem);
  --tippziel: 2.75rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background-color: var(--papier);
  color: var(--ton);
  font-family: var(--grotesk);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

main {
  flex: 1 1 auto;
  padding-block: clamp(2rem, 5vw, 3.5rem) clamp(3rem, 7vw, 5rem);
}

.spiegel {
  width: 100%;
  max-width: var(--spiegel);
  margin-inline: auto;
  padding-inline: var(--rand);
}

h1,
h2,
h3 {
  font-family: var(--serife);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.15;
  text-wrap: balance;
}

h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.6rem);
}

h2 {
  font-size: clamp(1.45rem, 3.4vw, 1.9rem);
}

h3 {
  font-size: 1.0625rem;
  font-family: var(--grotesk);
  font-weight: 600;
  letter-spacing: 0;
}

p {
  text-wrap: pretty;
}

a {
  color: var(--akzent);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--akzent-tief);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  background-color: var(--flaeche);
  border: 1px solid var(--kante);
  border-radius: 4px;
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------------ */
/* Fokus - eine Regel fuer das ganze Dokument                          */
/* ------------------------------------------------------------------ */

:where(a[href], button, input, textarea, select, summary, [tabindex]):not([tabindex='-1']):focus-visible {
  outline: 2px solid var(--ton);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 10;
  transform: translateY(-200%);
  display: inline-flex;
  align-items: center;
  min-height: var(--tippziel);
  padding-inline: 1rem;
  background-color: var(--papier);
  border: 1px solid var(--kante-klar);
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ton);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

/* ------------------------------------------------------------------ */
/* Kopf und Fuss                                                       */
/* ------------------------------------------------------------------ */

.kopf {
  border-bottom: 1px solid var(--kante);
  background-color: var(--papier);
}

.kopf__inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
  padding-block: 0.75rem;
}

.wortzeichen {
  font-family: var(--serife);
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.marginalie {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ton-leise);
}

.fuss {
  padding-block: 0 2rem;
}

.fuss__text {
  font-size: 0.875rem;
  color: var(--ton-leise);
  padding-top: 1rem;
}

.haarlinie {
  border: 0;
  border-top: 1px solid var(--kante);
}

/* ------------------------------------------------------------------ */
/* Schritte                                                            */
/* ------------------------------------------------------------------ */

.schritt > * + * {
  margin-top: 1rem;
}

.schritt__kopf {
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--kante);
  margin-bottom: 1.5rem;
}

.schritt__zaehler {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--akzent);
  margin-bottom: 0.5rem;
}

.schritt__hinweis {
  color: var(--ton-leise);
  margin-top: 0.75rem;
  max-width: 60ch;
}

.kursiv {
  font-family: var(--serife);
  font-style: italic;
}

/* Fortschritt */

.fortschritt {
  margin-bottom: 2rem;
}

.fortschritt__balken {
  display: block;
  height: 5px;
  margin-top: 0.5rem;
  background-color: var(--flaeche-tief);
  border: 1px solid var(--kante);
  border-radius: 999px;
  overflow: hidden;
}

.fortschritt__fuellung {
  display: block;
  height: 100%;
  background-color: var(--akzent);
  transition: width 180ms ease-out;
}

/* ------------------------------------------------------------------ */
/* Felder                                                              */
/* ------------------------------------------------------------------ */

.feld {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-top: 1.5rem;
}

.feld__label {
  font-size: 0.9375rem;
  font-weight: 600;
}

.feld__pflicht {
  font-weight: 400;
  color: var(--ton-leise);
}

.feld__eingabe {
  width: 100%;
  min-height: var(--tippziel);
  padding: 0.5rem 0.75rem;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ton);
  background-color: var(--papier);
  border: 1px solid var(--kante-klar);
  border-radius: 8px;
}

textarea.feld__eingabe {
  resize: vertical;
  min-height: 6rem;
}

.feld__eingabe:focus-visible {
  border-color: var(--akzent);
}

.feld__hinweis {
  font-size: 0.875rem;
  color: var(--ton-leise);
  margin-top: -0.125rem;
}

.feld__fehler {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--warnung);
}

.feld__fehler::before {
  content: '! ';
}

.feld__eingabe[aria-invalid='true'] {
  border-color: var(--warnung);
  border-width: 2px;
  background-color: var(--warnung-schleier);
}

/* Auswahlgruppen */

.gruppe {
  border: 0;
  padding: 0;
  margin: 1.5rem 0 0;
  min-width: 0;
}

.gruppe__legende {
  padding: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.gruppe__liste {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  list-style: none;
  padding: 0;
}

.wahl {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-height: var(--tippziel);
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--kante);
  border-radius: 8px;
  cursor: pointer;
}

.wahl:hover {
  background-color: var(--akzent-schleier);
  border-color: var(--akzent-hell);
}

.wahl:has(input:checked) {
  border-color: var(--akzent);
  background-color: var(--akzent-schleier);
}

.wahl input {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.28rem;
  accent-color: var(--akzent);
}

.wahl__text {
  flex: 1 1 auto;
}

/* Angaben zum Dokument auf dem Einstiegsschritt */

.kopfangaben {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--kante);
}

.kopfangaben .feld {
  margin-top: 0;
  max-width: 26rem;
}

/* Datenschutzhinweis vor dem Absenden */

.datenschutz {
  margin-top: 2rem;
}

.datenschutz h3 {
  margin-bottom: 0.25rem;
}

/* ------------------------------------------------------------------ */
/* Aktionen                                                            */
/* ------------------------------------------------------------------ */

.aktionen {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--kante);
}

.aktionen--rechts {
  justify-content: flex-end;
}

.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--tippziel);
  padding-inline: 1.25rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 140ms ease-out, border-color 140ms ease-out;
}

.knopf--haupt {
  background-color: var(--akzent);
  border-color: var(--akzent);
  color: var(--auf-akzent);
}

.knopf--haupt:hover {
  background-color: var(--akzent-tief);
  border-color: var(--akzent-tief);
}

.knopf--rand {
  background-color: transparent;
  border-color: var(--kante-klar);
  color: var(--ton);
}

.knopf--rand:hover {
  border-color: var(--akzent);
  background-color: var(--akzent-schleier);
}

.knopf--still {
  background: none;
  border-color: transparent;
  color: var(--ton-leise);
  text-decoration: underline;
  padding-inline: 0.5rem;
}

.knopf--still:hover {
  color: var(--warnung);
}

.knopf__abstand {
  margin-left: auto;
}

/* ------------------------------------------------------------------ */
/* Hinweise                                                            */
/* ------------------------------------------------------------------ */

.hinweis {
  padding: 1rem;
  border-radius: 8px;
  border-left: 3px solid var(--akzent);
  background-color: var(--akzent-schleier);
  font-size: 0.9375rem;
  margin-top: 1.5rem;
}

.hinweis > * + * {
  margin-top: 0.5rem;
}

.hinweis--warnung {
  border-left-color: var(--warnung);
  background-color: var(--warnung-schleier);
  color: var(--warnung);
}

.hinweis--warnung code {
  background-color: var(--papier);
  border-color: currentColor;
}

/* ------------------------------------------------------------------ */
/* Zusammenfassung                                                     */
/* ------------------------------------------------------------------ */

.zusammenfassung {
  margin-top: 1.5rem;
}

.zusammenfassung__block {
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 1px solid var(--kante);
}

.zusammenfassung__frage {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.zusammenfassung__titel {
  flex: 1 1 16rem;
  min-width: 0;
  font-family: var(--serife);
  font-size: 1.125rem;
}

.zusammenfassung__liste {
  list-style: none;
  padding: 0;
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.zusammenfassung__label {
  display: block;
  font-size: 0.8125rem;
  color: var(--ton-leise);
}

.zusammenfassung__wert {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.zusammenfassung__wert--offen {
  color: var(--ton-leise);
  font-style: italic;
}

.zusammenfassung__springen {
  flex: 0 0 auto;
  font-size: 0.875rem;
}

/* Export */

.export {
  margin-top: 1.5rem;
}

.export__feld {
  width: 100%;
  min-height: 14rem;
  padding: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ton);
  background-color: var(--flaeche);
  border: 1px solid var(--kante-klar);
  border-radius: 8px;
  resize: vertical;
}

@media (min-width: 40rem) {
  .schritt__kopf {
    padding-bottom: 1.5rem;
  }

  .gruppe__liste--zweispaltig {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }
}

/* Druckfassung: der Bildschirmablauf ist kein Ausdruck. Wer die Seite
   dennoch druckt, bekommt einen Hinweis auf die PDF. */
@media print {
  .aktionen,
  .fortschritt,
  .skip-link,
  .export {
    display: none;
  }
}

/* ------------------------------------------------------------------ */
/* Honigtopf                                                          */
/* ------------------------------------------------------------------ */

/*
 * Bewusst NICHT `display: none` und nicht `hidden`. Beides ueberspringen
 * einfache Ausfuellroboter. Aus dem Bild geschoben wird das Feld dagegen
 * ausgefuellt - und verraet damit den Absender. Fuer Menschen ist es
 * unerreichbar: kein Tabstopp, aria-hidden, ausserhalb des Sichtfelds.
 */
.honigtopf {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
