/* Kürsli · Buchungsformular der Startseite (public/booking-form.js).
 *
 * Das Formular ersetzt die React-Karte in #booking. Es sitzt im Baum von #root
 * und erbt darum die Regeln aus brand.css, die mit #root beginnen (Schriften
 * mit !important, Farbe ink-soft für jedes <p>, die Grösse jedes Knopfs).
 * Alle Regeln hier beginnen deshalb mit #kb-booking: eine Id plus
 * Element schlägt #root plus Element, wo nötig mit !important. Klassennamen
 * meiden die Teilstrings, auf die brand.css mit [class*=…] zielt
 * (border-, rounded-, shadow-, bg-primary, button-).
 *
 * Fällt die React-Seite ganz aus (#root bleibt leer), steht dasselbe Formular
 * im Hinweis #kb-fallback ausserhalb von #root; es sieht dort gleich aus,
 * weil es keine Regel aus brand.css braucht.
 */

#kb-booking {
  --kb-error: #a11d1d;
  --kb-error-bg: #fbeeec;
  --kb-field-line: #948b78;
  /* Kein Scroll-Anker im Formular: öffnete sich das KulturLegi-Feld, während
     die Zeile oben im Bild stand (Handy, Kopfzeile nicht klebend), wählte
     Chrome einen Anker weiter unten und schob die Seite um die Höhe des Feldes
     weiter; das Kästchen verschwand oben aus dem Bild (Prüfung Runde 2).
     Alles, was sich im Formular ändert, liegt bei der Stelle des Tipps oder
     darunter; einen Anker braucht es hier nicht. */
  overflow-anchor: none;
  box-sizing: border-box;
  margin: 0 auto;
  max-width: 56rem;
  padding: 32px;
  background: var(--paper, #fbf9f2);
  border: 1px solid var(--rule, #d9d3c3);
  box-shadow: 0 1px 0 var(--rule, #d9d3c3), 0 30px 80px -60px rgba(27, 26, 22, .28);
  color: var(--ink, #111813);
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 16px;
  line-height: 1.5;
  text-align: left;
  scroll-margin-top: 120px;
}
#kb-booking *, #kb-booking *::before, #kb-booking *::after { box-sizing: border-box; }
#kb-booking [hidden] { display: none !important; }

#kb-booking .kb-note {
  margin: 0 0 22px;
  font-family: "Source Serif 4", Georgia, serif !important;
  font-size: 15px;
  color: var(--ink-soft, #2c332d);
}

/* Zwei Spalten ab Tablet-Breite: links der Kurs, rechts Kind und Kontakt. */
#kb-booking .kb-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 30px; }
#kb-booking .kb-grid > * { min-width: 0; }
@media (min-width: 760px) {
  #kb-booking .kb-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; }
}

#kb-booking fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
#kb-booking fieldset + fieldset { margin-top: 28px; }
#kb-booking legend {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0 0 16px;
  font-family: "Fraunces", Georgia, serif !important;
  font-weight: 500;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -.01em;
  color: var(--ink, #111813);
}

#kb-booking .kb-field { margin: 0 0 18px; }
#kb-booking .kb-field:last-child { margin-bottom: 0; }
#kb-booking .kb-field > label {
  display: block;
  margin: 0 0 7px;
  font-family: var(--font-ui, 'Source Sans 3', system-ui, sans-serif) !important;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .02em !important;
  color: var(--ink-soft, #2c332d);
}
#kb-booking .kb-req { color: var(--kb-error); font-weight: 600; }

#kb-booking input[type="text"],
#kb-booking input[type="email"],
#kb-booking input[type="tel"],
#kb-booking select,
#kb-booking textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 11px 12px;
  font-family: var(--font-ui, 'Source Sans 3', system-ui, sans-serif) !important;
  font-weight: 400;
  font-size: 16px;               /* unter 16 px zoomt iOS beim Antippen */
  line-height: 1.4;
  letter-spacing: 0 !important;
  color: var(--ink, #111813);
  background-color: #fff;
  border: 1px solid var(--kb-field-line);
  border-radius: 0;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}
#kb-booking textarea { min-height: 112px; resize: vertical; }
#kb-booking select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%231a3a2e' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px 9px;
  text-overflow: ellipsis;
  cursor: pointer;
}
#kb-booking select option:disabled { color: #8a8273; }
#kb-booking input::placeholder, #kb-booking textarea::placeholder { color: #857d6c; opacity: 1; }
#kb-booking input:focus, #kb-booking select:focus, #kb-booking textarea:focus {
  outline: 2px solid var(--forest, #1a3a2e);
  outline-offset: 1px;
  border-color: var(--forest, #1a3a2e);
}
#kb-booking [aria-invalid="true"] {
  border-color: var(--kb-error) !important;
  box-shadow: inset 0 0 0 1px var(--kb-error);
}

#kb-booking .kb-hint {
  margin: 6px 0 0;
  font-family: "Source Serif 4", Georgia, serif !important;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-soft, #2c332d);
}
#kb-booking .kb-err {
  margin: 7px 0 0;
  font-family: "Source Serif 4", Georgia, serif !important;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--kb-error) !important;
}
#kb-booking .kb-err::before { content: "! "; content: "! " / ""; font-weight: 700; }

/* Ankreuzfelder: das echte Kästchen, gross, weiss solange leer. Die ganze
   Beschriftung schaltet es (label for), die Zeile ist mindestens 44 px hoch. */
#kb-booking .kb-check { display: flex; align-items: flex-start; gap: 12px; }
#kb-booking .kb-check input[type="checkbox"] {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  margin: 10px 0 0;
  accent-color: var(--forest, #1a3a2e);
  cursor: pointer;
}
#kb-booking .kb-check label {
  flex: 1 1 auto;
  min-width: 0;
  display: block;
  min-height: 44px;
  padding: 10px 0;
  font-family: "Source Serif 4", Georgia, serif !important;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0 !important;
  text-transform: none;
  color: var(--ink, #111813);
  cursor: pointer;
}
#kb-booking .kb-check.is-invalid label { color: var(--kb-error); }
#kb-booking .kb-check-body { flex: 1 1 auto; min-width: 0; }
#kb-booking .kb-check-body .kb-err { margin-top: 0; }

#kb-booking .kb-links { display: flex; flex-wrap: wrap; gap: 0 18px; margin: 0; }
#kb-booking .kb-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: "Source Serif 4", Georgia, serif !important;
  font-size: 15px;
  color: var(--forest, #1a3a2e) !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}
#kb-booking .kb-links a:hover { color: var(--forest-2, #2c5a45) !important; }
#kb-booking .kb-sr {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* KulturLegi */
#kb-booking .kb-kule { margin-top: 16px; }
#kb-booking .kb-kule-panel {
  margin: 4px 0 0 36px;
  padding: 0 0 0 14px;
  border-left: 3px solid var(--forest, #1a3a2e);
}
#kb-booking .kb-kule-panel .kb-hint { margin: 0 0 14px; }
@media (max-width: 520px) { #kb-booking .kb-kule-panel { margin-left: 0; } }

/* Preis-Übersicht */
#kb-booking .kb-price {
  margin-top: 22px;
  padding: 16px 18px;
  background: var(--bg, #f2efe4);
  border: 1px solid var(--rule, #d9d3c3);
}
#kb-booking .kb-price-title {
  margin: 0 0 10px;
  font-family: var(--font-ui, 'Source Sans 3', system-ui, sans-serif) !important; font-weight: 600;
  font-size: 12px;
  letter-spacing: .02em;
  color: var(--ink-soft, #2c332d);
}
#kb-booking .kb-price-row {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 6px 0;
  border-top: 1px solid var(--rule, #d9d3c3);
}
#kb-booking .kb-price-row:first-of-type { border-top: 0; }
#kb-booking .kb-price-k {
  flex: 0 0 auto;
  font-family: "Source Serif 4", Georgia, serif !important;
  font-size: 15px;
  color: var(--ink-soft, #2c332d);
}
#kb-booking .kb-price-v {
  flex: 1 1 0%;
  min-width: 0;
  text-align: right;
  font-family: "Source Serif 4", Georgia, serif !important;
  font-size: 15px;
  color: var(--ink, #111813);
  overflow-wrap: break-word;
}
#kb-booking .kb-price-total .kb-price-k,
#kb-booking .kb-price-total .kb-price-v {
  font-family: "Fraunces", Georgia, serif !important;
  font-size: 19px;
  font-weight: 600;
  color: var(--ink, #111813);
}
#kb-booking .kb-price-old { margin-right: 8px; text-decoration: line-through; font-weight: 400; color: var(--ink-soft, #2c332d); }
#kb-booking .kb-price-new { color: var(--forest, #1a3a2e); }
#kb-booking .kb-price-old, #kb-booking .kb-price-new { display: inline-block; white-space: nowrap; }
#kb-booking .kb-nowrap { white-space: nowrap; }
#kb-booking .kb-price-note {
  margin: 8px 0 0;
  font-family: "Source Serif 4", Georgia, serif !important;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-soft, #2c332d);
}

#kb-booking .kb-notes { margin-top: 28px; }
#kb-booking .kb-consents {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--rule, #d9d3c3);
}

#kb-booking .kb-actions { margin-top: 22px; }
#kb-booking button.kb-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  min-width: 240px;
  margin: 0;
  padding: 14px 30px;
  background: var(--forest, #1a3a2e) !important;
  color: var(--paper, #fbf9f2) !important;
  border: 1px solid var(--forest, #1a3a2e) !important;
  border-radius: 0 !important;
  font-family: var(--font-ui, 'Source Sans 3', system-ui, sans-serif) !important;
  font-size: .82rem !important;
  font-weight: 600;
  letter-spacing: .02em !important;
  cursor: pointer;
}
#kb-booking button.kb-submit:hover { background: var(--forest-2, #2c5a45) !important; border-color: var(--forest-2, #2c5a45) !important; }
#kb-booking button.kb-submit:focus-visible { outline: 3px solid var(--forest, #1a3a2e); outline-offset: 3px; }
#kb-booking button.kb-submit[aria-disabled="true"] { opacity: .72; cursor: progress; }
#kb-booking .kb-after {
  margin: 12px 0 0;
  font-family: "Source Serif 4", Georgia, serif !important;
  font-size: 14px;
  color: var(--ink-soft, #2c332d);
}
@media (max-width: 640px) {
  #kb-booking { padding: 22px 16px; }
  #kb-booking button.kb-submit { width: 100%; min-width: 0; }
}

/* Meldungen neben dem Knopf: bleiben stehen, bis neu gesendet wird. */
#kb-booking .kb-box {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid;
  border-left-width: 5px;
  font-family: "Source Serif 4", Georgia, serif !important;
  font-size: 16px;
  line-height: 1.5;
}
#kb-booking .kb-box.is-error { border-color: var(--kb-error); background: var(--kb-error-bg); color: #4a1010; }
#kb-booking .kb-box.is-ok { border-color: var(--forest, #1a3a2e); background: #edf2ec; color: var(--forest-dk, #0f2a20); }
#kb-booking .kb-box-title {
  display: block;
  margin: 0 0 4px;
  font-family: "Fraunces", Georgia, serif !important;
  font-size: 18px;
  font-weight: 600;
  color: inherit;
}
#kb-booking .kb-box p { margin: 0; color: inherit !important; font-family: "Source Serif 4", Georgia, serif !important; }
#kb-booking .kb-box p + p { margin-top: 6px; }
#kb-booking .kb-box a { color: inherit !important; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

#kb-booking .kb-retry {
  margin-left: 6px;
  padding: 6px 10px;
  min-height: 44px;
  background: transparent !important;
  color: var(--forest, #1a3a2e) !important;
  border: 1px solid var(--forest, #1a3a2e) !important;
  font-family: var(--font-ui, 'Source Sans 3', system-ui, sans-serif) !important;
  font-size: 11px !important;
  letter-spacing: .01em !important;
  cursor: pointer;
}

/* Die React-Karte versteckt index.html (body.kb-mounted), nicht diese Datei:
   fehlt das Stylesheet, bleibt so trotzdem nur ein Formular sichtbar. */

/* Hinweis, wenn die Startseite nicht starten konnte (index.html, Wächter vor
   dem Bundle). Ausserhalb von #root, darum ohne brand.css-Vorrang. */
#kb-fallback {
  max-width: 56rem;
  margin: 40px auto 56px;
  padding: 0 16px;
  font-family: "Source Serif 4", Georgia, serif;
  color: var(--ink, #111813);
}
#kb-fallback h2 {
  margin: 0 0 12px;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  line-height: 1.1;
}
#kb-fallback p { margin: 0 0 24px; font-size: 17px; line-height: 1.55; color: var(--ink-soft, #2c332d); }
#kb-fallback a { color: var(--forest, #1a3a2e); }

/* Handys: solange das Formular im Bild ist, klebt die Kopfzeile nicht. Sie ist
   auf dem Handy 160 bis 260 px hoch; im Querformat mit offener Tastatur blieb
   sonst kaum Platz für Feld, Beschriftung und Meldung (Prüfung 17.10.2026).
   Die Klasse kb-head-free setzt /booking-form.js über einen
   IntersectionObserver, sie wechselt also nur beim Scrollen. Die erste Fassung
   hing am Fokus eines Feldes: beim Antippen eines Kästchens verlor das Feld den
   Fokus zwischen mousedown und click, die Kopfzeile klebte wieder, lag über dem
   Kästchen und schluckte den Tipp (Prüfung Runde 2, N1). Sticky und static
   nehmen denselben Platz im Fluss ein: nichts springt. Nur bei
   Fingerbedienung; Tablets haben genug Platz. Ohne IntersectionObserver bleibt
   die klebende Zeile. */
@media (pointer: coarse) and (max-width: 600px), (pointer: coarse) and (max-height: 500px) {
  body.kb-head-free .site-head { position: static; }
}

/* Meldungen am React-Kontaktformular (Abschnitt Kontaktformular in
   /booking-form.js): eigene Elemente neben den Feldern, rot wie im
   Buchungsformular, und eine Zusammenfassung am Ende des Formulars. */
#root .kc-err {
  margin: 6px 0 0;
  font-family: "Source Serif 4", Georgia, serif !important;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: #a11d1d !important;
}
#root .kc-summary {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #a11d1d;
  border-left-width: 5px;
  background: #fbeeec;
  font-family: "Source Serif 4", Georgia, serif !important;
  font-size: 16px;
  line-height: 1.5;
  color: #4a1010 !important;
}
