/* ==========================================================================
   Umfrage zur neuen Dorfhomepage – Werkel
   Farben, Schriften und Bauteile sind aus dem Design-System des
   Homepage-Entwurfs übernommen, damit die Umfrage wie ein Teil der Seite wirkt.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Schriften liegen lokal auf dem eigenen Server (assets/fonts/).
   Kein Google-Fonts-CDN – dadurch wird keine IP-Adresse der Besucherinnen und
   Besucher an Dritte übertragen (DSGVO).
   -------------------------------------------------------------------------- */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/inter-var-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+20AC, U+2122, U+2212;
}

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("assets/fonts/fraunces-var-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+20AC, U+2122, U+2212;
}

@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 500 600;
  font-display: swap;
  src: url("assets/fonts/fraunces-var-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+20AC, U+2122, U+2212;
}

:root {
  /* Damit Browser-Elemente (Checkbox, Scrollbalken) zum Design passen */
  color-scheme: light;
  --bg: #f7f3ea;
  --bg-alt: #f1ebdd;
  --surface: #ffffff;
  --surface-2: #fbf8f1;
  --text: #1e262c;
  --muted: #5d6a72;
  --accent: #3f7a4f;
  --accent-deep: #2c5a39;
  --accent-soft: #e7f0e5;
  --gold: #b5883a;
  --border: #e3dccc;
  --border-strong: #d3c9b3;
  --shadow-sm: 0 1px 2px rgba(30, 38, 44, 0.06), 0 2px 8px rgba(30, 38, 44, 0.04);
  --shadow-md: 0 4px 12px rgba(30, 38, 44, 0.07), 0 16px 40px rgba(30, 38, 44, 0.07);
  --radius: 18px;
  --radius-lg: 28px;
  --shell: 860px;
  --font-body: Inter, "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --font-display: Fraunces, "Iowan Old Style", Georgia, "Times New Roman", serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

/* Sprungziele nicht direkt an den oberen Rand kleben lassen */
[id] {
  scroll-margin-top: 1rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent-deep);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(1.95rem, 7.5vw, 3.1rem);
}

h2 {
  font-size: clamp(1.3rem, 4.4vw, 1.75rem);
}

p {
  margin: 0 0 1rem;
  text-wrap: pretty;
}

p,
li,
a,
h1,
h2,
h3 {
  overflow-wrap: break-word;
}

p:last-child {
  margin-bottom: 0;
}

.shell {
  width: min(var(--shell), calc(100% - 2.5rem));
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ------------------------------- Buttons -------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 1.6rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease), background-color 160ms var(--ease),
    border-color 160ms var(--ease), color 160ms var(--ease);
}

/* Mindestgröße für die Bedienung mit dem Daumen */
.btn {
  min-height: 52px;
  -webkit-tap-highlight-color: transparent;
}

/*
 * Das Anheben beim Überfahren nur dort, wo es eine Maus gibt. Auf dem
 * Smartphone bliebe der Zustand nach dem Tippen sonst hängen.
 */
@media (hover: hover) {
  .btn:hover {
    transform: translateY(-2px);
  }
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(63, 122, 79, 0.28);
}

.btn-primary:active {
  background: var(--accent-deep);
}

/* Kein Rahmen, sondern Fläche: der Zweitknopf muss auch am Handy klar sichtbar sein */
.btn-outline {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text);
}

.btn-outline:active {
  border-color: var(--accent);
  color: var(--accent-deep);
}

@media (hover: hover) {
  .btn-primary:hover {
    background: var(--accent-deep);
    box-shadow: 0 10px 24px rgba(63, 122, 79, 0.34);
  }

  .btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent-deep);
  }
}

.btn-block {
  display: flex;
  width: 100%;
}

/* -------------------------------- Header -------------------------------- */

.site-header {
  background: rgba(247, 243, 234, 0.86);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 88px;
}

.brand img {
  width: auto;
  height: 56px;
  object-fit: contain;
}

.header-note {
  color: var(--muted);
  font-size: 0.86rem;
  text-align: right;
}

/* --------------------------------- Intro -------------------------------- */

.intro {
  padding: clamp(2.5rem, 7vw, 4rem) 0 clamp(1.5rem, 3vw, 2rem);
}

/* Panoramabild hinter dem Einstieg – wie auf der Startseite des Entwurfs */
.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: clamp(3rem, 8vw, 5rem) 0 clamp(2rem, 5vw, 3rem);
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Dorf und Horizont liegen im oberen Bilddrittel – Ausschnitt dorthin verschoben */
  object-position: 50% 38%;
  /*
   * Stark zurückgenommen: Das Foto ist Stimmung, nicht Inhalt. Entsättigt,
   * aufgehellt und halbtransparent liegt es wie ein Wasserzeichen hinter dem
   * Text – der Sandton der Seite scheint überall durch.
   */
  filter: saturate(0.62) brightness(1.1) contrast(0.92);
  opacity: 0.6;
}

/*
 * Zusätzlicher Schleier in der Grundfarbe. Anders als auf der Startseite hellt
 * er die ganze Breite gleichmäßig auf: Dort ist die Überschrift auf 20 Zeichen
 * begrenzt und der Text bleibt links, hier läuft er über die volle Spalte.
 * Nach unten geht das Bild vollständig in den Seitenhintergrund über.
 */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    180deg,
    rgba(247, 243, 234, 0.68) 0%,
    rgba(247, 243, 234, 0.48) 45%,
    rgba(247, 243, 234, 0.82) 85%,
    var(--bg) 100%
  );
}

.hero-inner {
  position: relative;
}

/* Vor dem Foto braucht die kleine Kennzeile den dunkleren Grünton */
.hero .eyebrow {
  color: var(--accent-deep);
}

/* Die Angabe zur Dauer soll sich vom Bild abheben */
.hero .meta-pill {
  background: rgba(255, 255, 255, 0.92);
}

.eyebrow {
  display: inline-block;
  margin: 0 0 0.4rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.intro h1 {
  max-width: 22ch;
  margin-bottom: 1rem;
}

.intro h1 em {
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
}

.lead {
  max-width: 62ch;
  font-size: 1.08rem;
  color: var(--muted);
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.92rem;
}

/* -------------------------------- Karten -------------------------------- */

.formular {
  padding-bottom: clamp(3rem, 7vw, 4.5rem);
}

.card {
  padding: clamp(1.4rem, 4vw, 2rem);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}

.card--optional {
  background: var(--surface-2);
}

.card h2 {
  margin-bottom: 0.35rem;
}

/* Steht direkt ein Textfeld unter der Frage, braucht es etwas mehr Luft */
.card h2 + textarea {
  margin-top: 0.45rem;
}

.hinweis {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* --------------------------- Auswahl der Inhalte ------------------------- */

.auswahl {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.option {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 54px;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.option:hover {
  border-color: var(--accent);
}

.option input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--accent);
}

.option__text {
  flex: 1;
}

.option:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.option:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ----------------------------- Eingabefelder ----------------------------- */

.field {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
}

.field:last-child {
  margin-bottom: 0;
}

.field label,
.field__label {
  font-size: 0.9rem;
  font-weight: 600;
}

.optional {
  font-weight: 400;
  color: var(--muted);
}

.field input,
.field textarea,
input[type="password"],
textarea {
  width: 100%;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

textarea {
  resize: vertical;
  min-height: 130px;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(63, 122, 79, 0.22);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.datenschutz {
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
  text-align: center;
}

/* Spamschutz-Feld: für Menschen unsichtbar */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ------------------------------ Danke-Seite ------------------------------ */

.danke {
  padding: clamp(3rem, 9vw, 5rem) 0;
  text-align: center;
}

.danke__zeichen {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  margin-bottom: 1.25rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 2.1rem;
  line-height: 1;
}

.danke h1 {
  max-width: 20ch;
  margin-inline: auto;
  font-size: clamp(1.7rem, 5.5vw, 2.4rem);
}

.danke .lead {
  margin-inline: auto;
}

.danke-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: 2rem;
}

.danke-actions .btn {
  width: min(100%, 24rem);
}

.danke .card {
  max-width: 26rem;
  margin-inline: auto;
  text-align: left;
}

/* ------------------------------ Auswertung ------------------------------- */

.auswertung {
  padding: clamp(2rem, 5vw, 3rem) 0 clamp(3rem, 7vw, 4.5rem);
}

/* Rückmeldung nach dem Löschen */
.meldung {
  margin: 1.25rem 0 0;
  padding: 0.75rem 1.1rem;
  border-radius: 12px;
  font-size: 0.95rem;
}

.meldung--ok {
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.meldung--fehler {
  border: 1px solid #e3b6ab;
  background: #f7e8e5;
  color: #93372a;
}

/* Kennzahlen im Kopfbereich */
.kennzahlen {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.kennzahl {
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.kennzahl__wert {
  display: block;
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--accent-deep);
}

.kennzahl__text {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.86rem;
}

/* Sprungmarken zu den Abschnitten */
.sprungnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.sprungnav a {
  padding: 0.45rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.88rem;
  text-decoration: none;
  transition: border-color 160ms var(--ease), color 160ms var(--ease);
}

.sprungnav a:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
}

/* Zwischenüberschrift zwischen den Kartenblöcken */
.abschnitt {
  margin: 2.25rem 0 0.9rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  scroll-margin-top: 1rem;
}

.card h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
}

/* Eine einzelne Einsendung */
.eintrag__kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.eintrag__nummer {
  margin-right: 0.5rem;
  font-weight: 700;
  color: var(--accent-deep);
}

.eintrag__datum {
  color: var(--muted);
  font-size: 0.88rem;
}

.eintrag__loeschen {
  flex: none;
}

.btn-loeschen {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 160ms var(--ease), color 160ms var(--ease), background-color 160ms var(--ease);
}

.btn-loeschen:hover {
  border-color: #c0492f;
  background: #f7e8e5;
  color: #93372a;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.chip {
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 0.84rem;
}

.eintrag__feld {
  margin-bottom: 0.9rem;
}

.eintrag__frage {
  margin: 0 0 0.3rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.eintrag__kontakt {
  margin: 1rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

/* Knöpfe am Ende der Auswertung */
.aktionen {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 2rem;
}

.btn-gefahr {
  color: #93372a;
}

.btn-gefahr:hover {
  border-color: #c0492f;
  background: #f7e8e5;
  color: #93372a;
}

.balken__zeile {
  margin-bottom: 0.9rem;
}

.balken__zeile:last-child {
  margin-bottom: 0;
}

.balken__kopf {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.3rem;
  font-size: 0.95rem;
}

.balken__zahl {
  flex: none;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 400;
  white-space: nowrap;
}

.balken__spur {
  height: 10px;
  border-radius: 999px;
  background: var(--bg-alt);
  overflow: hidden;
}

.balken__wert {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}

.antwort {
  padding: 0.85rem 1rem;
  margin-bottom: 0.6rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  background: var(--surface-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.antwort:last-child {
  margin-bottom: 0;
}

.leer {
  color: var(--muted);
  font-style: italic;
}

.fehler {
  margin: 0 0 1rem;
  color: #c0492f;
  font-size: 0.92rem;
}

/* ------------------------------- Fußzeile -------------------------------- */

.site-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--muted);
  font-size: 0.86rem;
  text-align: center;
}

/* --------------------------- Größere Bildschirme ------------------------- */

@media (min-width: 640px) {
  .auswahl {
    grid-template-columns: 1fr 1fr;
  }

  .field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.1rem;
  }

  .field-row .field {
    margin-bottom: 0;
  }
}

/* ------------------------------ Smartphone ------------------------------- */

@media (max-width: 639px) {
  /*
   * Am Handy steht jeder Knopf über die volle Breite und damit dort, wo der
   * Daumen ohnehin liegt. Nebeneinander stehende Knöpfe würden auf schmalen
   * Displays entweder zu klein oder ungleich breit.
   */
  .btn {
    display: flex;
    width: 100%;
    min-height: 56px;
    padding: 1rem 1.25rem;
    font-size: 1.05rem;
  }

  /* Der Absendeknopf ist der wichtigste Punkt der Seite – etwas mehr Gewicht */
  .formular > .btn-primary {
    margin-top: 0.5rem;
    box-shadow: 0 8px 20px rgba(63, 122, 79, 0.32);
  }

  .aktionen,
  .danke-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .aktionen form,
  .danke-actions .btn {
    width: 100%;
  }

  /* Löschen: eigene Zeile statt gequetscht neben dem Datum */
  .eintrag__kopf {
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  .eintrag__loeschen {
    width: 100%;
  }

  .btn-loeschen {
    width: 100%;
    min-height: 46px;
  }

  /* Sprungmarken als vollwertige Tippziele */
  .sprungnav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-inline: 1.1rem;
  }

  /* Etwas mehr Luft, damit der Daumen nicht den falschen Punkt trifft */
  .auswahl {
    gap: 0.75rem;
  }

  .option {
    min-height: 58px;
  }
}

/* Platz für die Gestenleiste am unteren Rand neuerer iPhones */
.site-footer {
  padding-bottom: max(2rem, env(safe-area-inset-bottom));
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }

  .btn:hover {
    transform: none;
  }
}
