/* Public contest form: same open layout and controls as the contact form. */
.bfm-kg {
    --kg-ink: var(--mb-schwarz, #24231f);
    --kg-cream: var(--mb-creme, #fff8e9);
    --kg-border: #d0cec5;
    --kg-teal: #68bfc6;
    --kg-gold: #d6b45f;
    width: min(820px, 100%) !important;
    max-width: 820px !important;
    margin: 0 auto !important;
    color: var(--kg-ink);
    font-family: "Dosis", sans-serif;
    font-size: clamp(18px, 1.4vw, 21px);
    line-height: 1.5;
    box-sizing: border-box;
}
.bfm-kg *, .bfm-kg *::before, .bfm-kg *::after { box-sizing: border-box; }
.bfm-kg > .mistelbuch-seitentitel.bfm-kg-title {
    width: fit-content !important; max-width: 100% !important;
    margin: 0 auto 28px 0 !important; padding: 0 0 9px !important;
    font-size: clamp(26px, 2.7vw, 42px) !important; line-height: 1.1 !important;
    text-align: left !important; overflow-wrap: anywhere;
}
.bfm-kg > .bfm-kg-title::after { background: var(--mb-tuerkis, #00c4cc) !important; }
.bfm-kg .bfm-kg-intro { max-width: 100%; margin: 0 0 18px; text-align: left; }
.bfm-kg .bfm-kg-deadline { margin: 0 0 34px; padding: 0; color: #666256; font-size: .9em; }
.bfm-kg .bfm-kg-form { display: grid; gap: 36px; }
.bfm-kg .bfm-kg-form > p { margin: 0; color: #79766c; font-size: .85em; }
.bfm-kg fieldset { min-width: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
.bfm-kg legend { width: 100%; padding: 0; margin: 0 0 20px; font-size: clamp(22px, 1.8vw, 27px); font-weight: 600; }
.bfm-kg .bfm-kg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.bfm-kg label { display: block; margin: 0 0 20px; font: inherit; font-weight: 400; }
/* Real labels remain available to assistive technology; placeholders match contact fields. */
.bfm-kg .bfm-kg-field-label { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; border: 0 !important; overflow: hidden !important; clip-path: inset(50%) !important; white-space: nowrap !important; }
.bfm-kg input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]), .bfm-kg textarea, .bfm-kg select {
    display: block; width: 100%; min-width: 0; min-height: 48px; margin: 0; padding: 11px 14px;
    border: 1px solid var(--kg-border); border-radius: 3px;
    background: #fefdf8; color: var(--kg-ink); font: inherit; font-weight: 400; line-height: 1.3;
}
.bfm-kg input::placeholder { color: #96958c; opacity: 1; }
.bfm-kg .bfm-kg-check { display: flex; align-items: flex-start; gap: 11px; margin: 18px 0; font-weight: 400; }
.bfm-kg .bfm-kg-check input { flex: 0 0 auto; width: 19px; height: 19px; margin: .23em 0 0; accent-color: #167a80; }
.bfm-kg .bfm-kg-check:has(input:disabled) { color: #79766c; }
.bfm-kg .bfm-kg-check input:disabled { opacity: .5; }
.bfm-kg small { display: block; margin: -8px 0 24px; color: #79766c; font-size: .85em; line-height: 1.45; }
.bfm-kg small:last-child { margin-bottom: 0; }
.bfm-kg .bfm-kg-age { margin-top: 10px; }
.bfm-kg .bfm-kg-age > p { margin: 0 0 12px; font-weight: 600; }
.bfm-kg .bfm-kg-age-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.bfm-kg .bfm-kg-age-option { position: relative; margin: 0; }
.bfm-kg .bfm-kg-age-option input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.bfm-kg .bfm-kg-age-option span { display: flex; align-items: center; justify-content: center; min-height: 56px; padding: 12px; border: 2px solid var(--kg-border); background: transparent; text-align: center; line-height: 1.3; }
.bfm-kg .bfm-kg-age-option input:checked + span { border-color: var(--kg-teal); background: rgb(104 191 198 / 22%); }
.bfm-kg .bfm-kg-age-option input:focus-visible + span { outline: 2px solid #167a80; outline-offset: 4px; }
.bfm-kg .bfm-kg-minor-consent { margin: 24px 0 0; padding: 0; }
.bfm-kg .bfm-kg-minor-consent[hidden] { display: none !important; }
.bfm-kg .bfm-kg-permission-hint, .bfm-kg .bfm-kg-note { margin: 18px 0 24px; padding: 0; color: #79766c; font-size: .86em; line-height: 1.5; }
.bfm-kg a { color: var(--mb-dunkeltuerkis, #167a80); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.bfm-kg .bfm-kg-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 0 0 24px; }
.bfm-kg .bfm-kg-upload-control { position: relative; display: inline-flex; flex: 0 0 auto; max-width: 100%; margin: 0; }
.bfm-kg .bfm-kg-upload-control input[type="file"] { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.bfm-kg .bfm-kg-upload-button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 9px 21px; border: 2px solid var(--kg-ink); border-radius: 4px; background: transparent; color: var(--kg-ink); font: inherit; font-weight: 600; }
.bfm-kg .bfm-kg-upload-control:focus-within .bfm-kg-upload-button { outline: 2px solid #167a80; outline-offset: 4px; }
.bfm-kg .bfm-kg-upload-info { flex: 1 1 180px; min-width: 0; display: grid; gap: 2px; color: #79766c; font-size: .85em; overflow-wrap: anywhere; }
.bfm-kg .bfm-kg-file-name { color: #666256; }
.bfm-kg button[type="submit"] { display: flex; align-items: center; justify-content: center; width: fit-content; min-height: 48px; margin: 28px 6px 6px auto; padding: 11px 24px; border: 2px solid var(--kg-ink); border-radius: 4px; background: var(--kg-gold); box-shadow: 5px 5px 0 var(--kg-teal); color: var(--kg-ink); font: inherit; font-weight: 600; cursor: pointer; transition: transform 180ms ease, box-shadow 180ms ease; }
.bfm-kg button[type="submit"]:hover { transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--kg-teal); }
.bfm-kg :is(input, button, a, select, textarea):focus-visible { outline: 2px solid #167a80 !important; outline-offset: 3px; }
.bfm-kg .bfm-public-form-trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.bfm-kg .bfm-external-alert { margin: 20px 0; font-family: inherit; }
@media (max-width: 600px) { .bfm-kg .bfm-kg-grid { grid-template-columns: minmax(0, 1fr); gap: 0; } .bfm-kg .bfm-kg-form { gap: 30px; } .bfm-kg .bfm-kg-age-options { gap: 10px; } .bfm-kg .bfm-kg-age-option span { min-height: 64px; padding: 10px 7px; font-size: .92em; } .bfm-kg button[type="submit"] { width: calc(100% - 6px); margin-left: 0; } }
@media (prefers-reduced-motion: reduce) { .bfm-kg button[type="submit"] { transition: none; } }

.bfm-kg .bfm-kg-required-note { margin: 24px 0 0; color: #79766c; font-size: .85em; }

/* Same circular information symbol and cream dialog as the Mitwirken page. */
.bfm-kg .bfm-kg-info-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: center; gap: 16px; margin: 0 0 20px; }
.bfm-kg .bfm-kg-info-row > label, .bfm-kg .bfm-kg-info-row > .bfm-kg-upload { margin-bottom: 0; }
.bfm-kg .bfm-kg-info { display: flex; align-items: center; justify-content: center; }
.bfm-kg .bfm-kg-info-toggle { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; min-width: 40px; margin: 0; padding: 0; border: 2px solid var(--kg-teal); border-radius: 50%; background: transparent; box-shadow: none; color: var(--kg-ink); cursor: pointer; }
.bfm-kg .bfm-kg-info-toggle span { font-family: Georgia, "Times New Roman", serif; font-size: 29px; font-style: italic; font-weight: 700; line-height: 1; transform: translateY(-1px); }
.bfm-kg .bfm-kg-info-toggle:hover { background: rgb(104 191 198 / 12%); }
.bfm-kg .bfm-kg-info-dialog { width: min(720px, calc(100vw - 36px)); max-width: calc(100vw - 36px); max-height: calc(100dvh - 48px); margin: auto; padding: 0; border: 0; border-top: 7px solid var(--kg-teal); border-radius: 5px; background: var(--kg-cream); color: var(--kg-ink); box-shadow: 0 20px 65px rgb(0 0 0 / 28%); overflow-y: auto; font: inherit; text-align: left; }
.bfm-kg .bfm-kg-info-dialog::backdrop { background: rgb(36 35 31 / 60%); backdrop-filter: blur(2px); }
.bfm-kg .bfm-kg-info-content { padding: clamp(26px, 5vw, 44px); }
.bfm-kg .bfm-kg-info-content h3 { margin: 0 0 28px; color: inherit; font: inherit; font-size: 1.15em; font-weight: 600; line-height: 1.35; }
.bfm-kg .bfm-kg-info-content h3::before, .bfm-kg .bfm-kg-info-content h3::after { content: none !important; }
.bfm-kg .bfm-kg-info-content p { margin: 0 0 22px; font-size: 1em; line-height: 1.55; }
.bfm-kg .bfm-kg-info-actions { display: flex; justify-content: flex-end; margin-top: 28px; }
.bfm-kg .bfm-kg-info-close { margin: 0; padding: 0 2px 6px; border: 0; border-bottom: 3px solid var(--kg-teal); border-radius: 0; background: transparent; box-shadow: none; color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.bfm-kg .bfm-kg-info-close:hover { color: #167a80; }
@media (max-width: 600px) { .bfm-kg .bfm-kg-info-row { grid-template-columns: minmax(0, 1fr) 40px; gap: 10px; } .bfm-kg .bfm-kg-info-dialog { max-height: calc(100dvh - 28px); } }

.bfm-kg .bfm-kg-ticket-parts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 0; max-width: 100%; }
.bfm-kg .bfm-kg-ticket-parts[hidden] { display: none; }
.bfm-kg .bfm-kg-ticket-prefix { font-weight: 600; letter-spacing: .05em; }
.bfm-kg .bfm-kg-ticket-piece { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; }
.bfm-kg .bfm-kg-ticket-piece input[data-bfm-ticket-part] { width: 3.8em; font-size: clamp(16px, 1.2vw, 19px); min-width: 0; padding: 10px 5px; text-align: center; font-family: "Dosis", sans-serif; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.bfm-kg .bfm-kg-ticket-piece:last-child input { width: 2.8em; }
.bfm-kg .bfm-kg-ticket-message { display: block; font-size: .85em; color: #8b372e; }
.bfm-kg .bfm-kg-platform-note { font-size: .85em; line-height: 1.45; color: #79766c; }
@media (max-width: 600px) { .bfm-kg .bfm-kg-ticket-piece { gap: 4px; margin-left: 4px; } .bfm-kg .bfm-kg-ticket-piece input[data-bfm-ticket-part] { width: 4em; } .bfm-kg .bfm-kg-ticket-piece:last-child input { width: 2.6em; } }

/* Explicit sizing overrides the more specific general input rule. */
.bfm-kg .bfm-kg-ticket-parts .bfm-kg-ticket-piece { flex: 0 0 auto !important; width: auto !important; }
.bfm-kg .bfm-kg-ticket-parts input[data-bfm-ticket-part]:not([type="hidden"]) {
    flex: 0 0 5.2ch !important; width: 5.2ch !important; min-width: 0 !important; max-width: 5.2ch !important;
    height: 36px !important; min-height: 36px !important; margin: 0 !important; padding: 5px 3px !important;
    font-family: ui-monospace, Consolas, monospace !important; font-size: 16px !important; line-height: 1.2 !important; letter-spacing: 0 !important;
}
.bfm-kg .bfm-kg-ticket-parts .bfm-kg-ticket-piece:last-child input[data-bfm-ticket-part]:not([type="hidden"]) {
    flex-basis: 3.2ch !important; width: 3.2ch !important; max-width: 3.2ch !important;
}
.bfm-kg .bfm-kg-ticket-parts { font-size: 16px; gap: 7px 0; }

/* Wide, dark opening banner matching the ticket shop; the form stays on cream. */
body:not(.editor-styles-wrapper):has(.bfm-kg-header) .mistelbuch-seiteninhalt { padding-top: 0 !important; padding-right: 0 !important; padding-left: 0 !important; }
body:not(.editor-styles-wrapper):has(.bfm-kg-header) .wp-block-post-content { width: 100% !important; max-width: none !important; margin-block-start: 0 !important; padding: 0 !important; }
body:not(.editor-styles-wrapper):has(.bfm-kg-header) .wp-block-post-content > *:has(.bfm-kg) { width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important; }
.bfm-kg:has(> .bfm-kg-header) { width: 100% !important; max-width: none !important; }
.bfm-kg .bfm-kg-header { width: 100%; margin: 0 0 clamp(38px, 5vw, 64px); padding: clamp(48px, 5vw, 68px) max(22px, calc((100vw - 1120px) / 2)) clamp(34px, 4vw, 48px) max(clamp(330px, 24vw, 430px), calc((100vw - 1120px) / 2)); background: #394347; color: #fffaf2; }
.bfm-kg .bfm-kg-header-content { max-width: 820px; }
.bfm-kg .bfm-kg-header .bfm-kg-title { position: static !important; width: auto !important; max-width: 100%; margin: 0 0 clamp(24px, 3vw, 34px) !important; padding: 0 !important; color: #fffaf2 !important; font-size: clamp(1.8rem, 4vw, 3rem) !important; line-height: 1.08 !important; letter-spacing: -.02em; text-align: left !important; overflow-wrap: anywhere; }
.bfm-kg .bfm-kg-header .bfm-kg-title::before, .bfm-kg .bfm-kg-header .bfm-kg-title::after { content: none !important; }
.bfm-kg .bfm-kg-header .bfm-kg-intro { margin: 0; color: rgb(255 250 242 / 90%); }
.bfm-kg .bfm-kg-header .bfm-kg-intro > :last-child { margin-bottom: 0; }
.bfm-kg .bfm-kg-header a { color: #fffaf2; }
.bfm-kg > .bfm-kg-form, .bfm-kg > .bfm-external-alert { width: min(820px, calc(100% - 40px)); max-width: 820px; margin-right: auto; margin-left: auto; }
.bfm-kg .bfm-kg-form > fieldset:nth-of-type(4n + 1) { --kg-section-accent: var(--mb-tuerkis, #00c4cc); }
.bfm-kg .bfm-kg-form > fieldset:nth-of-type(4n + 2) { --kg-section-accent: var(--mb-gold, #e5b64b); }
.bfm-kg .bfm-kg-form > fieldset:nth-of-type(4n + 3) { --kg-section-accent: var(--mb-beige, #a89772); }
.bfm-kg .bfm-kg-form > fieldset:nth-of-type(4n + 4) { --kg-section-accent: var(--mb-rosa, #e9a9a2); }
.bfm-kg .bfm-kg-form > fieldset > legend { margin-bottom: 28px; }
.bfm-kg .bfm-kg-form > fieldset > legend > span { position: relative; display: inline-block; max-width: 100%; padding: 0 0 9px; }
.bfm-kg .bfm-kg-form > fieldset > legend > span::after { content: ''; position: absolute; right: 0; bottom: 0; left: 0; height: 4px; border-radius: 999px; background: var(--kg-section-accent, #00c4cc); transform: rotate(-1.5deg); transform-origin: left center; }
.bfm-kg .bfm-kg-permissions-summary { margin: 0 0 12px; }
.bfm-kg .bfm-kg-permissions-reference { margin: 0 0 22px; font-size: .85em; color: #79766c; }
.bfm-kg .bfm-kg-permission-hint[hidden] { display: none !important; }
@media (max-width: 782px) { .bfm-kg .bfm-kg-header { padding: clamp(140px, 42vw, 175px) 18px 30px; } }
@media (max-width: 600px) { .bfm-kg > .bfm-kg-form, .bfm-kg > .bfm-external-alert { width: calc(100% - 36px); } }

/* Info circle inherits the same accent as its enclosing section heading. */
.bfm-kg .bfm-kg-info-toggle { border-color: var(--kg-section-accent, var(--kg-teal)); }
.bfm-kg .bfm-kg-privacy-note { margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--kg-border); color: #79766c; font-size: .85em; line-height: 1.5; }

/* Identical notice colours, border, radius and padding to the ticket purchase form. */
.bfm-kg .bfm-kg-form-errors { width: min(820px, calc(100% - 40px)); margin: 0 auto; }
.bfm-kg .bfm-kg-form-errors:empty { display: none; }
.bfm-kg .bfm-kg-notice { padding: 1rem; margin: 1rem 0; border: 2px solid #777; border-radius: 10px; background: #f7f7f7; color: var(--mb-schwarz, #24231f); }
.bfm-kg .bfm-kg-notice--error { border-color: #b42318; }
.bfm-kg .bfm-kg-form-errors ul { margin: 0; padding-left: 1.25rem; }
.bfm-kg .bfm-kg-field-invalid { outline: 3px solid #b42318 !important; outline-offset: 4px; }
.bfm-kg input[aria-invalid="true"] { border-color: #b42318 !important; box-shadow: 0 0 0 2px rgba(180,35,24,.16) !important; }
.bfm-kg .bfm-kg-check:has(input[aria-invalid="true"]) { outline: 3px solid #b42318 !important; outline-offset: 4px; }

.bfm-kg .bfm-kg-age:has(input[aria-invalid="true"]),
.bfm-kg .bfm-kg-ticket-control:has(input[aria-invalid="true"]) { outline: 3px solid #b42318 !important; outline-offset: 4px; }

.bfm-kg .bfm-kg-upload-control:has(input[aria-invalid="true"]) .bfm-kg-upload-button { border-color: #b42318; outline: 3px solid #b42318; outline-offset: 4px; }
@media (max-width: 600px) { .bfm-kg .bfm-kg-form-errors { width: calc(100% - 36px); } }

/* Content Notes use the same choice tiles and controls as the existing form. */
.bfm-kg .bfm-kg-content-notes { margin: 4px 0 26px; }
.bfm-kg .bfm-kg-content-notes > p { margin: 0 0 12px; font-weight: 600; }
.bfm-kg .bfm-kg-notes-options { max-width: 330px; }
.bfm-kg .bfm-kg-notes-text { margin-top: 18px; }
.bfm-kg .bfm-kg-notes-text[hidden] { display: none !important; }
.bfm-kg .bfm-kg-notes-text textarea { width: 100%; resize: vertical; font: inherit; min-height: 105px; }
.bfm-kg .bfm-kg-notes-text label { margin-bottom: 8px; }
.bfm-kg .bfm-kg-notes-hint { margin: 0; color: #79766c; font-size: .85em; line-height: 1.45; }
.bfm-kg .bfm-kg-permissions-intro { align-items: center; margin-bottom: 12px; }
.bfm-kg .bfm-kg-permissions-intro .bfm-kg-permissions-summary { margin: 0; }
.bfm-kg textarea[aria-invalid="true"] { border-color: #b42318 !important; box-shadow: 0 0 0 2px rgba(180,35,24,.16); }
.bfm-kg .bfm-kg-content-notes:has(input[aria-invalid="true"]) .bfm-kg-notes-options { outline: 3px solid #b42318; outline-offset: 4px; }

.bfm-kg .bfm-kg-success p { margin: 0 0 12px; overflow-wrap: anywhere; }
.bfm-kg .bfm-kg-success p:last-child { margin-bottom: 0; }
