/* CASCADOS Anfragen: nur das, was das Theme (style.css, Klassen demo-form__*) nicht schon hat.
   Gleiche Werte wie .demo-form__field input: Rahmen 1px #ddd, Radius 8px, Schrift 15px, Fokus Orange mit 3px Schatten.
   Das Popup (Fassung 2) ist ein natives <dialog> im Stil von .demo-form: Hintergrund var(--bg-light), Radius 16px, Innenabstand 40px. */

/* Popup: auf dem Handy (unter 600 px) über den ganzen Bildschirm, sonst höchstens 520 px breit. Gescrollt wird im Fenster. */
.anfrage-fenster {
  width: min(520px, calc(100% - 32px));
  max-width: 520px;
  margin: auto;   /* das Theme setzt margin: 0 für alles: ohne diese Zeile klebt das Fenster links oben */
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: var(--bg-light, #f5f5f5);
  color: var(--charcoal, #222);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}
.anfrage-fenster[open] { display: flex; flex-direction: column; }
.anfrage-fenster::backdrop { background: rgba(0, 0, 0, 0.45); }
.anfrage-fenster__kopf { position: relative; flex: none; padding: 40px 40px 0; }
.anfrage-fenster__inhalt { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 40px 40px; }
.anfrage-fenster__kopf .demo-form__title { padding-right: 36px; }
.anfrage-fenster__x {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--charcoal, #222);
  cursor: pointer;
}
.anfrage-fenster__x:hover { background: rgba(0, 0, 0, 0.06); }
.anfrage-fenster__x:focus-visible { outline: 2px solid var(--orange, #f18711); outline-offset: 2px; }
.anfrage-fenster__x svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
html.anfrage-offen { overflow: hidden; }
.anfrage-noscript { margin: 16px; }

/* Auswahlliste und Textfeld wie das Eingabefeld des Themes */
.demo-form__field select,
.demo-form__field textarea {
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.15s;
  background: var(--white, #fff);
  width: 100%;
  box-sizing: border-box;
}
.demo-form__field textarea { resize: vertical; min-height: 110px; }
/* Eingabefelder füllen ihre Spalte, auch in schmalen Fenstern (sonst sprengt die Zeile mit Vor- und Nachname die Breite) */
.demo-form__row > .demo-form__field { min-width: 0; }
.demo-form__field input { width: 100%; min-width: 0; box-sizing: border-box; }
.demo-form__field select:focus,
.demo-form__field textarea:focus {
  outline: none;
  border-color: var(--orange, #f18711);
  box-shadow: 0 0 0 3px rgba(241, 135, 17, 0.1);
}

/* Gruppen je Anliegen: ohne JavaScript alle sichtbar mit Überschrift, mit JavaScript nur die passende ohne Überschrift */
.anfrage-gruppe { display: flex; flex-direction: column; gap: 16px; }
.anfrage-gruppe[hidden] { display: none; }
.anfrage-gruppe__titel {
  font-size: 13px;
  font-weight: 700;
  color: var(--charcoal2, #555);
  margin: 8px 0 0;
  padding-top: 12px;
  border-top: 1px solid #ddd;
}
.anfragen-js .anfrage-gruppe__titel { display: none; }

/* Erweiterungen: Kästchen in einem aufklappbaren Bereich */
.anfrage-erweiterungen { border: 1px solid #ddd; border-radius: 8px; padding: 10px 14px; background: var(--white, #fff); }
.anfrage-erweiterungen summary { font-size: 14px; font-weight: 600; color: var(--charcoal, #222); cursor: pointer; }
.anfrage-erweiterungen summary:focus-visible { outline: 2px solid var(--orange, #f18711); outline-offset: 2px; }
.anfrage-erweiterungen[open] summary { margin-bottom: 12px; }
.anfrage-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.anfrage-checks label { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; cursor: pointer; }
.anfrage-checks input[type="checkbox"],
.anfrage-kaestchen input[type="checkbox"] { margin-top: 2px; accent-color: var(--orange, #f18711); }
.demo-form__field label span[aria-hidden="true"] { color: var(--orange, #f18711); }

/* Hinweise und Pflichthinweis */
.anfrage-pflicht { font-size: 13px; color: var(--charcoal2, #555); margin: 0; }
.anfrage-hinweis { font-size: 14px; color: var(--charcoal2, #555); margin: 0; }
.anfrage-hinweis a, .anfrage-datenschutz a { color: var(--orange, #f18711); text-decoration: none; }
.anfrage-hinweis a:hover, .anfrage-datenschutz a:hover { text-decoration: underline; }
.anfrage-datenschutz { margin: 0; }
.demo-form__consent.anfrage-newsletter { font-size: 12px; }
.anfrage-form .btn-primary { width: 100%; justify-content: center; border: 0; box-shadow: none; -webkit-appearance: none; appearance: none; font-family: inherit; line-height: 1.2; cursor: pointer; }   /* .btn-primary des Themes ist für Links gebaut, ein button behielt sonst Rahmen und Schrift des Browsers */
.anfrage-form .btn-primary:hover, .anfrage-form .btn-primary:focus { background: var(--orange-d, #d9780a); color: var(--white, #fff); }
.anfrage-form .btn-primary:focus-visible { outline: 2px solid var(--orange, #f18711); outline-offset: 2px; }
.anfrage-form .btn-primary[disabled] { opacity: 0.6; cursor: wait; }

/* Fehlermeldungen: Zusammenfassung oben, Meldung am Feld, Rahmen am Feld */
.anfrage-fehler {
  border: 1px solid #b42318;
  border-left-width: 4px;
  border-radius: 8px;
  background: #fff;
  padding: 12px 16px;
  font-size: 14px;
  color: #b42318;
}
.anfrage-fehler p { margin: 0 0 6px; }
.anfrage-fehler ul { margin: 0; padding-left: 18px; }
.anfrage-fehler a { color: #b42318; }
.anfrage-fehler:focus { outline: 2px solid #b42318; outline-offset: 2px; }
.anfrage-feldfehler { font-size: 13px; color: #b42318; margin: 2px 0 0; }
.demo-form__field input[aria-invalid="true"],
.demo-form__field select[aria-invalid="true"],
.demo-form__field textarea[aria-invalid="true"] { border-color: #b42318; }

/* Dank nach dem Absenden */
.anfrage-dank {
  border: 1px solid #ddd;
  border-left: 4px solid var(--orange, #f18711);
  border-radius: 8px;
  background: var(--white, #fff);
  padding: 16px 20px;
  font-size: 15px;
  color: var(--charcoal, #222);
}
.anfrage-dank p { margin: 0; }
.anfrage-dank:focus { outline: none; }

/* Honeypot: für Menschen unsichtbar, außerhalb des Bildes statt display:none (Bots ignorieren versteckte Felder öfter) */
.anfragen-hp {
  position: absolute !important;
  left: -9999px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}
.anfragen-turnstile { margin: 4px 0; }

@media (max-width: 599.98px) {
  .anfrage-fenster { width: 100%; max-width: none; height: 100%; height: 100dvh; max-height: none; margin: 0; border-radius: 0; }
  .anfrage-fenster__kopf { padding: 28px 20px 0; }
  .anfrage-fenster__inhalt { padding: 0 20px 28px; }
  .anfrage-checks { grid-template-columns: 1fr; }
}
