.page-body:has(form[data-formstepped]) {
    position: relative;
    background: #ffffff;
    overflow: hidden;

    &::before {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        width: 50%;
        height: 100%;
        background: url('/fileadmin/_processed_/5/6/csm_jean-philippe-delberghe-75xPHEQBmvA-unsplash-_1__caac1e7dea.jpg') center center / cover no-repeat;
        z-index: 0;
    }
}


@media (max-width: 1199px) {
    .page-body:has(form[data-formstepped]) {
         &::before {
            display: none;
         }
    }
 }


form[data-formstepped] {

    position: relative;
    z-index: 1;
    /* ================= Basics ================= */

    .invalid-feedback {
        display: none !important;
    }

    /* Hintergrundbild für rechte Hälfte des gesamten page-body */


    /* Formular-Wrapper */

    .form-content {
        display: flex;
        flex-wrap: nowrap;
        border: 0;
        position: relative;
        z-index: 2;
    }

    .form-left {
        flex: 2;
        padding: 2em 4em 10em 0;
        background: #ffffff;
        position: relative;
        z-index: 2;
    }

    .form-right {
        position: relative;
        z-index: 2;
        flex: 1;
        background: none;
        border: 0;

        /* Layout-Variablen */

        --inset: 4em;
        --rail: 1.6rem;
        --gap: .5rem;
        --check-col: 1.25rem;
        --edge: calc(var(--check-col) + var(--gap));
        --meta-size: .8em;
        --line-height: 1.5rem;

        /* Grid im rechten Bereich */

        display: grid;
        grid-template-columns: var(--rail) 1fr;
        column-gap: var(--gap);
        padding: 10em var(--inset) 10em var(--inset);

        /* NEU: verhindert, dass Zeilen/Gaps mitwachsen */

        align-content: start;
        align-items: start;
        grid-auto-rows: min-content;
        padding-top: 2em;
    }

    .form-right>* {
        grid-column: 2;
    }

    /* Button-Container – einheitlicher Abstand */

    .form-right .form-navigation {
        margin-top: var(--line-height);
        margin-bottom: var(--line-height);
    }

    .form-navigation button {
        width: 100%;
    }

    /* ================= Stepper ================= */

    .stepper-mui {
        width: 100%;
        user-select: none;
    }

    .stepper-row {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 0;
        position: relative;
        padding-inline: calc((100% - 4 * 54px) / 8);
    }

    .stepper-dot {
        width: 54px;
        height: 54px;
        border-radius: 50%;
        background: #F3F3F5;
        color: #6F6F6F;
        border: 1px solid transparent;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5em;
        box-sizing: border-box;
        position: relative;
        z-index: 2;
        transition: .2s;
        overflow: hidden;
    }

    .stepper-dot.completed {
        background: #EFF3E7;
        border-color: #446600;
        color: #446600;
    }

    .stepper-dot.completed i {
        color: #446600;
    }

    .stepper-dot.active {
        background: #F3F3F5;
        border-color: #446600;
        color: #0F1A3D;
    }

    .stepper-dot.active i {
        color: #0F1A3D;
    }

    .stepper-line {
        height: 1px;
        flex: 1 1 auto;
        background: #F3F3F5;
        margin: 0 -27px;
        border-radius: 3px;
        z-index: 1;
        transition: background .2s;
    }

    .stepper-line.completed {
        background: #446600 !important;
    }

    .stepper-line.active {
        background: linear-gradient(to right, #446600 0%, #F3F3F5 50%, #F3F3F5 100%);
    }

    .stepper-label-row {
        display: flex;
        width: 100%;
        margin-top: 10px;
    }

    .step-label {
        flex: 1 1 0;
        text-align: center;
        font-size: 1em;
        color: #6F6F6F;
        font-weight: 500;
        white-space: nowrap;
    }

    /* ================= Responsive ================= */

    @media (max-width: 900px) {

        .form-content {
            flex-direction: column;
        }

        .form-left {
            padding: 20px;
        }

        .form-right {
            --inset: 20px;
            padding: 20px;
            grid-template-columns: var(--rail) 1fr;
            align-content: start;
            align-items: start;
            grid-auto-rows: min-content;
        }

        .stepper-row {
            flex-direction: column;
            gap: 0;
        }

        .stepper-dot,
        .stepper-label-row .step-label {
            margin-bottom: 20px;
        }

        .stepper-line {
            width: 6px;
            height: 40px;
            margin: 0 auto;
        }
    }

    /* ================= Form Controls ================= */

    .form-group {
        margin-top: .5em;
    }

    fieldset {
        display: none;
        border: 0;
        padding: 0;
        margin: 0;
    }

    fieldset.active {
        display: block;
    }

    .form-control {
        border-radius: 8px;
        font-size: 1rem;
    }

    .powermail_field {
        position: relative;
    }

    .is-invalid {
        border: 2px solid #e74c3c !important;
        background: #fff7f7;
    }

    .invalid-feedback {
        color: #b30000;
        margin-top: 2px;
        font-size: .95em;
    }

    /* ================= Check & Radio mit Effekten ================= */

    .checkbox,
    .radio {
        border: 1pt solid rgba(15, 26, 61, .2);
        border-radius: 5px;
        padding: 5px;
        margin: 0 0 7px 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        box-sizing: border-box;
        position: relative;
        overflow: hidden;
        transition: background-color .3s ease, box-shadow .3s ease;
    }

    .checkbox::before,
    .radio::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        background-color: rgba(87, 129, 14, 0.1);
        transition: width 0.5s ease, height 0.5s ease;
        transform: translate(-50%, -50%);
        z-index: 0;
        border-radius: 50%;
    }

    .checkbox:hover,
    .radio:hover {
        box-shadow: 0 4px 8px rgba(15, 26, 61, .2);
    }

    .checkbox input[type="checkbox"],
    .radio input[type="radio"] {
        height: 1.5rem;
        width: 1.5rem;
        cursor: pointer;
        margin: 0;
        padding: 0;
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1;
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        background-color: white;
        border: 1pt solid #446600;
        transition: background 0.3s ease, border 0.3s ease;
    }

    .checkbox input[type="checkbox"] {
        border-radius: 3px;
    }

    .radio input[type="radio"] {
        border-radius: 50%;
    }

    .checkbox input[type="checkbox"]:checked,
    .radio input[type="radio"]:checked {
        background-color: #446600;
        border-color: #446600;
    }

    .checkbox input[type="checkbox"]:checked::after {
        content: '\2714';
        color: white;
        font-size: 1rem;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
    }

    .radio input[type="radio"]:checked::after {
        content: '';
        background-color: white;
        width: 0.5rem;
        height: 0.5rem;
        border-radius: 50%;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
    }

    .checkbox input[type="checkbox"]:checked+label,
    .radio input[type="radio"]:checked+label {
        color: #446600;
    }

    .checkbox label,
    .radio label {
        margin: 0;
        text-align: left;
        width: calc(100% - 36px);
        border-radius: inherit;
        padding: inherit;
        transition: color 0.3s;
    }

    .checkbox input[type="checkbox"]::before,
    .radio input[type="radio"]::before {
        content: '';
        position: absolute;
        left: 50%;
        top: 50%;
        width: 0;
        height: 0;
        background-color: rgba(87, 129, 14, 0.3);
        border-radius: 50%;
        transform: translate(-50%, -50%);
        transition: width 0.5s ease, height 0.5s ease;
        z-index: -1;
    }

    .checkbox input[type="checkbox"]:hover::before,
    .radio input[type="radio"]:hover::before {
        width: 2.5rem;
        height: 2.5rem;
    }

    .checkbox input[type="checkbox"]:checked::before,
    .radio input[type="radio"]:checked::before {
        width: 10000%;
        height: 10000%;
        background-color: rgba(87, 129, 14, 0.05);
        border-radius: 0;
        transition: width 2s ease, height 2s ease;
    }

    /* ================= Icon Swap ================= */

    .icon-swap {
        display: inline-block;
        transition: transform .3s cubic-bezier(.4, 2, .6, 1), opacity .2s;
    }

    .icon-swap-leave {
        opacity: 0;
        transform: scale(.4) rotate(-10deg);
        pointer-events: none;
    }

    .icon-swap-enter {
        opacity: 0;
        transform: scale(1.3) rotate(10deg);
        pointer-events: none;
        animation: icon-pop-in .3s cubic-bezier(.4, 2, .6, 1) forwards;
    }

    @keyframes icon-pop-in {
        0% {
            opacity: 0;
            transform: scale(1.3) rotate(10deg);
        }

        90% {
            opacity: 1;
            transform: scale(1.1);
        }

        100% {
            opacity: 1;
            transform: scale(1) rotate(0);
        }
    }

    /* ================= Pricing ================= */

    .r-pricing {
        font-size: 3.2rem;
        font-weight: 500;
        line-height: .75;
        color: #0F1A3D;
        font-variant-numeric: tabular-nums;
        letter-spacing: -.01em;
    }

    .r-pricing_upper {
        position: relative;
        font-size: 1rem;
        font-weight: 400;
        line-height: 1;
        color: #0F1A3D;
        left: -.5rem;
        opacity: .85;
    }

    .r-pricing_lower {
        font-size: .9rem;
        font-weight: 300;
        line-height: 1.2;
        color: #0F1A3D;
        opacity: .7;
    }

    .d-flex {
        display: flex;
    }

    .align-items-start {
        align-items: flex-start;
    }

    .ps-1 {
        padding-left: .15rem;
    }

    .zahlweise-label {
        font-size: var(--meta-size);
        margin-bottom: 1em;
        opacity: .9;
    }

    /* HR sichtbar und mit einheitlichem Abstand */

    .form-right hr {
        grid-column: 2;
        border: 0;
        border-top: 2px solid rgba(15, 26, 61, .22) !important;
        margin-top: var(--line-height);
        margin-bottom: var(--line-height);
    }

    /* ================= Bullet-Liste ================= */

    .form-right ul.hook {
        list-style: none;
        margin: 0;
        padding: 0 !important;
    }

    .form-right .hook li {
        position: relative;
        margin: 0;
        padding-left: var(--edge);
        font-size: var(--meta-size);
        line-height: var(--line-height);
        display: grid;
        grid-template-columns: 1fr 1.5rem;
        align-items: center;
        column-gap: .5rem;
    }

    .form-right .hook li::before {
        content: "✓";
        position: absolute;
        left: 0;
        top: .15em;
        width: var(--check-col);
        text-align: left;
        color: #0F1A3D;
        line-height: 1;
        margin-left: 0 !important;
    }

    .form-right .hook .hook-text {
        grid-column: 1;
    }

    /* Info-Icon nur sichtbar beim Hover */

    .form-right .hook .info-btn {
        grid-column: 2;
        justify-self: end;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        height: var(--line-height);
        cursor: pointer;
        opacity: 0;
        transition: opacity .18s ease-out, transform .18s ease-out;
        color: #0F1A3D;
        font-size: 1rem;
        position: relative;
    }

    .form-right:hover .hook .info-btn {
        opacity: 1;
    }

    .form-right .hook .info-btn:focus-visible {
        outline: 2px solid #0F1A3D;
        outline-offset: 2px;
        border-radius: 4px;
    }

    /* Tooltip */

    .form-right .hook .info-btn::after {
        content: attr(data-tip);
        position: absolute;
        right: calc(100% + .5rem);
        top: 50%;
        transform: translateY(-50%) translateX(4px);
        min-width: 16rem;
        max-width: 24rem;
        background: rgba(15, 26, 61, .95);
        color: #fff;
        font-size: var(--meta-size);
        line-height: 1.35;
        padding: .5rem .6rem;
        border-radius: 5px;
        box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
        opacity: 0;
        pointer-events: none;
        transition: opacity .15s ease-out, transform .15s ease-out;
        white-space: normal;
        overflow-wrap: break-word;
        z-index: 5;
    }

    .form-right .hook .info-btn:hover::after,
    .form-right .hook .info-btn:focus::after {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }

    /* Pfeil für Tooltip */

    .form-right .hook .info-btn::before {
        content: "";
        position: absolute;
        right: calc(100% + .2rem);
        top: 50%;
        transform: translateY(-50%);
        width: 0;
        height: 0;
        border: 6px solid transparent;
        border-left-color: rgba(15, 26, 61, .95);
        opacity: 0;
        transition: opacity .15s ease-out;
    }

    .form-right .hook .info-btn:hover::before,
    .form-right .hook .info-btn:focus::before {
        opacity: 1;
    }

    /* Mobile: Tooltips ausblenden */

    @media (hover: none) {
        .form-right .hook .info-btn {
            display: none !important;
        }
    }

    /* ============== Totals Block ============== */

    .form-right .ks-totals {
        grid-column: 2;
        display: grid;
        grid-template-columns: 1fr auto;
        column-gap: .5rem;
        row-gap: 0;
        margin: 0;
        padding: 0;
        font-size: var(--meta-size);
        font-variant-numeric: tabular-nums;
        line-height: var(--line-height);
    }

    .form-right .ks-totals,
    .form-right .ks-totals dt,
    .form-right .ks-totals dd,
    .form-right .ks-next {
        margin: 0 !important;
        padding: 0 !important;
        line-height: var(--line-height);
    }

    .form-right .ks-totals dt {
        font-weight: 400;
        text-align: left;
    }

    .form-right .ks-totals dd {
        text-align: right;
    }

    .form-right .ks-totals dt.total,
    .form-right .ks-totals dd.total {
        font-weight: 700;
    }

    .form-right .ks-totals .muted {
        opacity: .7;
    }

    /* Nächste Abrechnung */

    .form-right .ks-next {
        grid-column: 2;
        font-size: var(--meta-size);
        text-align: left;
        line-height: var(--line-height);
    }

    /* ================= Zahlweise Toggle neben Label ================= */

    .zahlweise-wrap {
        display: inline-flex;
        align-items: center;
        gap: .5rem;
        margin-bottom: 1em;
    }

    .zahlweise-toggle {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 1.6rem;
        height: 1.6rem;
        border: 0;
        padding: 0;
        background: transparent;
        color: #446600;
        cursor: pointer;
        border-radius: 50%;
        outline: none;
        margin-bottom: 9px;
    }

    .zahlweise-toggle i {
        font-size: 1rem;
        line-height: 1;
    }

    .zahlweise-toggle::before {
        content: "";
        position: absolute;
        width: 0;
        height: 0;
        background: rgba(68, 102, 0, .12);
        border-radius: 999px;
        z-index: -1;
        transition: width .22s ease, height .22s ease;
    }

    .zahlweise-toggle:hover::before,
    .zahlweise-toggle:focus-visible::before {
        width: 2.2rem;
        height: 2.2rem;
    }

    .zahlweise-toggle::after {
        content: attr(data-tip);
        position: absolute;
        left: 50%;
        top: calc(100% + .4rem);
        transform: translateX(-50%) translateY(6px);
        white-space: nowrap;
        background: rgba(15, 26, 61, .95);
        color: #fff;
        font-size: var(--meta-size);
        line-height: 1.35;
        padding: .35rem .5rem;
        border-radius: 5px;
        box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
        opacity: 0;
        pointer-events: none;
        transition: opacity .15s ease-out, transform .15s ease-out;
    }

    .zahlweise-toggle:hover::after,
    .zahlweise-toggle:focus-visible::after {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    @media (hover:none) {
        .zahlweise-toggle::after {
            display: none;
        }
    }

    /* ================= MOBILE LAYOUT bis 767px ================= */

    @media (max-width: 767px) {

        fieldset[data-step="1"] .row {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
        }

        .col-5:has(#field_password) {
            flex: 1 1 auto;
            max-width: none;
            min-width: 0;
            margin-bottom: 12px;
        }

        .col-5:has(#field_password) .powermail_field,
        #field_password {
            width: 100%;
            min-width: 0;
            /* WICHTIG */
        }

        .col-2:has(.position_pw_circle) {
            flex: 0 0 84px;
            max-width: 84px;
            min-width: 84px;
            display: flex;
            justify-content: flex-end;
            margin-bottom: 16px;
            margin-left: 20px;
        }

        fieldset[data-step="1"] .position_pw_circle {
            display: flex;
            justify-content: flex-end;
            gap: 6px;
        }

        .col-5:has(#field_password_rep) {
            flex: 0 0 100%;
            max-width: 100%;
        }

        #field_password_rep {
            width: 100%;
        }
    }

    .ks-totals-mobile {
        display: none;
    }

    .ks-mobile-head,
    .form-navigation--mobile,
    .ks-totals-mobile {
        display: none !important;
    }


    @media (max-width: 1199px) {

        .ks-mobile-head,
        .form-navigation--mobile,
        .ks-totals-mobile {
            display: block !important;
        }

        .ks-totals-mobile {
            display: block;
        }


        .form-content {
            display: flex;
            flex-direction: column;
        }

        .form-left,
        .form-right {
            width: 100%;
            padding: 24px 16px;
        }

        .ks-mobile-head {
            display: grid !important;
            grid-template-columns: 1fr auto;
            gap: 0px;
            align-items: start;
            margin: -10px 0 16px -16px;
        }

        .ks-mobile-title {
            font-size: 1.5em;
            line-height: 1.2;
            margin: 0.15rem 0 0.25rem 0;
        }

        .form-navigation--mobile {
            display: block !important;
            width: 100%;
            padding: 0 16px;
            margin: 0 0 16px 0;
        }

        .form-navigation--mobile button {
            width: 100%;
        }

        .form-right .form-navigation {
            display: none !important;
        }

        .form-right>.meta-label,
        .form-right>div[style*="font-size:1.5em"],
        .form-right .zahlweise-wrap,
        .form-right .d-flex.align-items-start.mb-3 {
            display: none !important;
        }

        .stepper-row {
            flex-direction: row !important;
            justify-content: space-between;
            padding-inline: 0 !important;
        }

        .stepper-dot {
            width: 40px;
            height: 40px;
            font-size: 1.1em;
            margin-bottom: 0 !important;
        }

        .stepper-line {
            height: 1px !important;
            width: auto !important;
            margin: 0 -20px !important;
        }

        .stepper-label-row {
            display: none !important;
        }

        .form-right {
            border-radius: 16px;
            overflow: hidden;
            position: relative;
            background: none;
        }

        .form-right::before {
            content: "";
            position: absolute;
            inset: 0;
            background: url('/fileadmin/_processed_/5/6/csm_jean-philippe-delberghe-75xPHEQBmvA-unsplash-_1__caac1e7dea.jpg') center/cover no-repeat;
            opacity: .18;
            z-index: 0;
        }

        .form-right>* {
            position: relative;
            z-index: 1;
        }

        .form-right .ks-totals,
        .form-right .ks-next {
            display: none !important;
        }

        .ks-totals-mobile {
            display: block;
            margin: 12px 16px 0 16px;
            padding: 14px 16px;
            border-radius: 10px;

            background: linear-gradient(135deg, rgba(15, 26, 61, .04), rgba(15, 26, 61, .02));
            border: 1px solid rgba(15, 26, 61, .08);
        }

        .ks-totals-mobile .ks-next {
            margin-top: 6px !important;
        }

        .ks-totals-mobile .ks-totals {
            display: grid;
            grid-template-columns: 1fr auto;
            column-gap: .5rem;
            margin: 0;
            padding: 0;
            font-size: .8em;
            line-height: 1.5rem;
            font-variant-numeric: tabular-nums;
        }

        .ks-totals-mobile .ks-totals dt,
        .ks-totals-mobile .ks-totals dd {
            margin: 0;
            padding: 0;
        }

        .ks-totals-mobile .ks-totals dd {
            text-align: right;
        }

        .ks-totals-mobile .ks-totals .muted {
            opacity: .7;
        }

        .ks-totals-mobile .ks-totals .total {
            font-weight: 700;
        }

        .ks-totals-mobile .ks-next {
            margin-top: 6px;
            font-size: .8em;
        }

        hr {
            margin-left: -30px;
        }

        .form-right .d-flex.align-items-start.mb-3 {
            margin-bottom: 4px !important;
        }

        .form-right .zahlweise-wrap {
            display: flex !important;
            align-items: center;
            gap: 8px;

            margin: 0 0 16px 0;
            font-size: .9em;
            opacity: .85;
        }

        .form-right .zahlweise-toggle {
            width: 1.4rem;
            height: 1.4rem;
        }

        .form-right .zahlweise-wrap {
            justify-content: flex-end;
            width: 100%;
        }

        .form-right .zahlweise-wrap {
            display: none !important;
        }

        .ks-mobile-head__left,
        .ks-mobile-head__right {
            display: contents;
        }

        .ks-mobile-head .ks-price {
            grid-column: 2;
            grid-row: 1;
            justify-self: end;
        }

        .ks-mobile-head .zahlweise-wrap {
            grid-column: 2;
            grid-row: 2;
            justify-self: end;
            margin: 4px 0 0 0 !important;
            font-size: .9em;
            opacity: .85;
        }

        .ks-mobile-head .meta-label,
        .ks-mobile-head .ks-mobile-title {
            grid-column: 1;
            justify-self: start;
        }

        .form-right .hook .info-btn {
            display: flex !important;
            opacity: 1 !important;
        }

        .form-right:hover .hook .info-btn {
            opacity: 1 !important;
        }

        .ks-mobile-head .ks-mobile-title {
            margin-top: -38px;
        }
    }
}