/* Temporary compatibility styles while Powermail and TYPO3 Form run in parallel. */
.hkc-field-standort-button { position: absolute; z-index: 2; }
.address-form .hkc-field-adresseingabe { margin-right: 0; }
.address-form [data-hkc-field="adresseingabe"] { border-radius: 0; height: 44px; }
.address-form .form-navigation { text-align: right; }
.address-form .form-navigation .btn { min-width: 100%; }

.house-type .form-navigation { text-align: right; }

.pw-fragebogen-3 .hkc-question-intro,
.pw-fragebogen-3 .hkc-question-radio {
    margin: 0.25rem 0.75rem 0.25rem 0;
    vertical-align: top;
}

.pw-fragebogen-3 .hkc-question-radio input[type="radio"] {
    margin: 0 0.25rem 0 0;
}
@media (min-width: 768px) {
    .pw-fragebogen-3 .hkc-question-intro,
    .pw-fragebogen-3 .hkc-question-radio { display: inline-block; }
    .pw-fragebogen-3 .hkc-question-intro { padding-right: 15px; }
}

/* TYPO3 Form replacement for the former Powermail address form. */
[class*="form-identifier-hkc-risk-address-"] form {
    --hkc-risk-field-height: 44px;

    align-items: start;
    column-gap: 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    margin: 0 auto;
    max-width: 900px;
}

[class*="form-identifier-hkc-risk-address-"] form > h2,
[class*="form-identifier-hkc-risk-address-"] form > div:first-child {
    display: none;
}

[class*="form-identifier-hkc-risk-address-"] .hkc-field-adresseingabe {
    margin: 0;
    min-width: 0;
    position: relative;
}

[class*="form-identifier-hkc-risk-address-"] .hkc-field-adresseingabe > label {
    display: none;
}

[class*="form-identifier-hkc-risk-address-"] [data-hkc-field="adresseingabe"] {
    border-radius: 0;
    box-sizing: border-box;
    height: var(--hkc-risk-field-height);
    margin: 0;
    min-width: 0;
    padding-right: 48px;
    width: 100%;
}

[class*="form-identifier-hkc-risk-address-"] .location-finder-icon {
    cursor: pointer;
    margin: 0;
    position: absolute;
    right: 10px;
    top: 5px;
    z-index: 3;
}

[class*="form-identifier-hkc-risk-address-"] .form-actions,
[class*="form-identifier-hkc-risk-address-"] .form-navigation {
    margin: 0;
    padding: 0;
}

[class*="form-identifier-hkc-risk-address-"] .form-navigation .btn {
    align-items: center;
    display: inline-flex;
    height: var(--hkc-risk-field-height);
    justify-content: center;
    margin: 0;
    min-width: 120px;
    white-space: nowrap;
}

[class*="form-identifier-hkc-risk-address-"] .hkc-address-error {
    clear: both;
    margin-bottom: 0;
    margin-top: 8px;
}

/* Risk check page: the label is intentionally hidden. */
body#p81 [class*="form-identifier-hkc-risk-address-"] .hkc-field-adresseingabe > label {
    display: none;
}

/* Landing page: keep the former Powermail layout with the label left of the input. */
.address-form-landingpage [class*="form-identifier-hkc-risk-address-"] form,
body#p133 [class*="form-identifier-hkc-risk-address-"] form {
    background: #fff;
    margin-left: 0;
    margin-right: 0;
    max-width: none;
    padding: 10px;
    width: 100%;
}

@media (min-width: 992px) {
    .address-form-landingpage [class*="form-identifier-hkc-risk-address-"] .hkc-field-adresseingabe,
    body#p133 [class*="form-identifier-hkc-risk-address-"] .hkc-field-adresseingabe {
        align-items: center;
        display: grid;
        column-gap: 10px;
        grid-template-columns: max-content minmax(0, 1fr);
    }

    .address-form-landingpage [class*="form-identifier-hkc-risk-address-"] .hkc-field-adresseingabe > label,
    body#p133 [class*="form-identifier-hkc-risk-address-"] .hkc-field-adresseingabe > label {
        color: #2491ca;
        display: block;
        font-size: 14px;
        font-weight: 400;
        grid-column: 1;
        line-height: 1.2;
        margin: 0;
        text-transform: uppercase;
        white-space: nowrap;
    }

    .address-form-landingpage [class*="form-identifier-hkc-risk-address-"] [data-hkc-field="adresseingabe"],
    body#p133 [class*="form-identifier-hkc-risk-address-"] [data-hkc-field="adresseingabe"] {
        grid-column: 2;
    }

    .address-form-landingpage [class*="form-identifier-hkc-risk-address-"] .hkc-address-error,
    body#p133 [class*="form-identifier-hkc-risk-address-"] .hkc-address-error {
        grid-column: 2;
    }
}

@media (max-width: 991px) {

    body#p1 label[for="hkc-risk-address-703-adresseingabe"] {
        display: none;
    }

    [class*="form-identifier-hkc-risk-address-"] form {
        grid-template-columns: 1fr;
        row-gap: 10px;
    }

    [class*="form-identifier-hkc-risk-address-"] .form-actions {
        grid-column: 1;
    }

    [class*="form-identifier-hkc-risk-address-"] .form-navigation .btn {
        width: 100%;
    }

    .address-form-landingpage [class*="form-identifier-hkc-risk-address-"] .hkc-field-adresseingabe > label,
    body#p133 [class*="form-identifier-hkc-risk-address-"] .hkc-field-adresseingabe > label {
        color: #2491ca;
        display: block;
        font-size: 14px;
        font-weight: 400;
        margin: 0 0 6px;
        text-transform: uppercase;
    }
}

/* Schadenspotential: emulate the former Powermail multistep UI without submitting between steps. */
/* Keep only the first outer TYPO3 Form fieldset visible before JS initializes.
   Nested RadioButton fieldsets are not affected by the direct-child selector. */
.house-type [class*="form-identifier-hkc-house-type-"] form > fieldset {
    display: none;
}
.house-type [class*="form-identifier-hkc-house-type-"] form > fieldset:first-of-type {
    display: block;
}

.house-type [class*="form-identifier-hkc-house-type-"] form > h2 {
    display: none;
}
.house-type [class*="form-identifier-hkc-house-type-"] .hkc-house-step {
    border: 0;
    margin: 0;
    padding: 0;
}
.house-type [class*="form-identifier-hkc-house-type-"] .hkc-house-step > legend,
.house-type [class*="form-identifier-hkc-house-type-"] .form-element-radio > legend,
.house-type [class*="form-identifier-hkc-house-type-"] .form-label,
.house-type [class*="form-identifier-hkc-house-type-"] .form-check-label {
    text-transform: none;
}
.house-type [class*="form-identifier-hkc-house-type-"] .hkc-house-step > legend:empty {
    display: none;
}
.house-type [class*="form-identifier-hkc-house-type-"] .hkc-house-step-nav,
.house-type [class*="form-identifier-hkc-house-type-"] .form-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}
.house-type [class*="form-identifier-hkc-house-type-"] .hkc-house-step-nav .btn + .btn,
.house-type [class*="form-identifier-hkc-house-type-"] .form-navigation .btn + .btn {
    margin-left: 4px;
}
.house-type [class*="form-identifier-hkc-house-type-"] .hkc-house-step-nav .btn,
.house-type [class*="form-identifier-hkc-house-type-"] .form-navigation .btn {
    min-width: 59px;
}
.house-type [class*="form-identifier-hkc-house-type-"] .form-actions {
    display: none;
    margin: 0;
}
.house-type [class*="form-identifier-hkc-house-type-"] form[data-hkc-house-step="3"] .form-actions {
    display: block;
}

/* Schadenspotential: radio groups */
.house-type [class*="form-identifier-hkc-house-type-"] fieldset.form-element-radio {
    border: 0;
    margin: 0 0 18px;
    padding: 0;
}

/* TYPO3 Bootstrap Package versteckt die Frage standardmäßig */
.house-type [class*="form-identifier-hkc-house-type-"] fieldset.form-element-radio > legend {
    clip: auto !important;
    clip-path: none !important;
    color: #666;
    font-size: 16px;
    font-weight: 500;
    height: auto !important;
    line-height: 1.4;
    margin: 0 0 8px !important;
    overflow: visible !important;
    padding: 0 !important;
    position: static !important;
    text-transform: none;
    white-space: normal !important;
    width: auto !important;
}

/* Ja / Nein wieder kompakt wie im alten Formular */
.house-type [class*="form-identifier-hkc-house-type-"] fieldset.form-element-radio > div[role="radiogroup"] {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
}

.house-type [class*="form-identifier-hkc-house-type-"] fieldset.form-element-radio > div[role="radiogroup"] > .form-group {
    margin: 0 !important;
}

.house-type [class*="form-identifier-hkc-house-type-"] .form-check-wrapping-label {
    align-items: center;
    display: inline-flex;
    font-weight: 400;
    gap: 6px;
    margin: 0;
}

.house-type [class*="form-identifier-hkc-house-type-"] .form-check-input {
    flex: 0 0 auto;
    margin: 0;
    position: static;
}

/* Zweite Kellerfensterfrage zunächst komplett ausblenden */
.house-type [class*="form-identifier-hkc-house-type-"] .hkc-house-field-lagederkellerfenster {
    display: none;
}

.house-type.has-basement-window [class*="form-identifier-hkc-house-type-"] .hkc-house-field-lagederkellerfenster {
    display: block;
}

/* Questionnaire: Powermail-style single-document multistep UI. */
.pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"]::before {
    color: #2491ca;
    content: "Gegen Hochwasser- und Überflutungsschaden bestmöglich vorsorgen";
    display: block;
    font-size: 32px;
    font-weight: 400;
    line-height: 1.15;
    margin: 0 auto 18px;
    text-align: center;
}

.pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] form {
    border-top: 1px solid rgba(0, 0, 0, 0.125);
    padding: 24px 0;
}

.pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] form > h2,
.pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] form > div:first-child {
    display: none;
}

/* The 17 direct fieldsets are the visual steps. Nested radio fieldsets stay visible. */
.pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] form > fieldset {
    border: 0;
    margin: 0;
    padding: 0;
}

.pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] form > fieldset > legend {
    color: #666;
    border: 0;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
    margin: 0 0 14px;
    padding: 0;
    text-transform: uppercase;
}

.pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] .hkc-question-intro {
    margin-bottom: 18px;
}

.pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] .hkc-question-intro .form-paragraph {
    margin-top: 0;
}

.pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] fieldset.form-element-radio {
    border: 0;
    margin: 0 0 18px;
    padding: 0;
}

/* Bootstrap Package hides Form radio legends. Powermail displayed the question normally. */
.pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] fieldset.form-element-radio > legend {
    clip: auto !important;
    clip-path: none !important;
    color: #666;
    font-size: 16px;
    font-weight: 400;
    height: auto !important;
    margin: 0 0 8px !important;
    overflow: visible !important;
    padding: 0 !important;
    position: static !important;
    text-transform: none;
    white-space: normal !important;
    width: auto !important;
}

.pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] .form-check {
    margin-bottom: 4px !important;
}

.pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] .form-check-label {
    text-transform: none;
}

.pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] .hkc-questionnaire-step-nav,
.pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] .form-actions,
.pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] .form-navigation {
    margin: 0;
}

.pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] .hkc-questionnaire-step-nav,
.pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] .form-navigation {
    display: flex;
    gap: 4px;
    justify-content: flex-start;
}

.pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] .hkc-questionnaire-step-nav .btn,
.pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] .form-navigation .btn {
    min-width: 49px;
}

@media (min-width: 768px) {
    .pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] form > fieldset {
        column-gap: 30px;
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] form > fieldset > legend {
        grid-column: 1;
        grid-row: 1;
    }

    .pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] form > fieldset > .hkc-question-intro {
        grid-column: 1;
        grid-row: 2;
        margin-bottom: 18px;
    }

    .pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] form > fieldset > fieldset.form-element-radio,
    .pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] form > fieldset > .form-element-email {
        grid-column: 2;
        grid-row: 2;
        margin-top: 0;
    }

    .pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] form > fieldset > .hkc-questionnaire-step-nav {
        grid-column: 1;
        grid-row: 3;
    }

    .pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] form > fieldset > .form-actions {
        grid-column: 2;
        grid-row: 3;
    }
}

/* Questionnaire progress navigation. */
.pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] .hkc-questionnaire-progress {
    margin: 0 0 22px;
}

.pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] .hkc-questionnaire-progress-meta {
    align-items: baseline;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 9px;
}

.pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] .hkc-questionnaire-progress-count {
    color: #2491ca;
    font-weight: 600;
    white-space: nowrap;
}

.pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] .hkc-questionnaire-progress-title {
    color: #666;
    font-size: 14px;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] .hkc-questionnaire-progress-pages {
    display: flex;
    gap: 4px;
    width: 100%;
}

.pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] .hkc-questionnaire-progress-page {
    background: #e5e5e5;
    border: 0;
    color: #666;
    flex: 1 1 0;
    font-size: 11px;
    line-height: 1;
    min-width: 0;
    padding: 7px 2px;
    transition: background-color 150ms ease, color 150ms ease;
}

.pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] .hkc-questionnaire-progress-page.is-complete {
    background: #d7edf7;
    color: #247fae;
    cursor: pointer;
}

.pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] .hkc-questionnaire-progress-page.is-current {
    background: #2491ca;
    color: #fff;
    font-weight: 700;
}

.pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] .hkc-questionnaire-progress-page:disabled {
    cursor: default;
    opacity: 1;
}

@media (max-width: 767px) {
    .pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] .hkc-questionnaire-progress-title {
        display: none;
    }

    .pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] .hkc-questionnaire-progress-pages {
        gap: 2px;
    }

    .pw-fragebogen-3 [class*="form-identifier-hkc-questionnaire-"] .hkc-questionnaire-progress-page {
        font-size: 0;
        height: 7px;
        padding: 0;
    }
}
