/* ---------- functional ---------- */

/* Hidden by rules */
.cmp-adaptiveform-buttonchoice[data-cmp-visible="false"] {
    display: none !important;
}

.cmp-adaptiveform-multistepwizard:has(> .cmp-adaptiveform-multistepwizard__widget > .cmp-adaptiveform-multistepwizard__steps > .cmp-adaptiveform-multistepwizard__step--active .cmp-adaptiveform-buttonchoice[data-cmp-hide-wizard-next="true"]:not([data-cmp-visible="false"], [data-cmp-enabled="false"], [data-cmp-readonly="true"]))
    > .cmp-adaptiveform-multistepwizard__widget > .cmp-adaptiveform-multistepwizard__nav > .cmp-adaptiveform-multistepwizard__button--next {
    display: none !important;
}

/* ---------- layout defaults ---------- */
:where(.cmp-adaptiveform-buttonchoice) {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    text-align: center;
}

:where(.cmp-adaptiveform-buttonchoice__label-container) {
    display: flex;
    justify-content: center;
    gap: 8px;
}

:where(.cmp-adaptiveform-buttonchoice__label) {
    display: block;
    margin: 0 0 24px;
    font-size: 1.75rem;
    line-height: 1.25;
    text-wrap: balance;
}

/* vertical (default): stacked full-width buttons */
:where(.cmp-adaptiveform-buttonchoice__widget) {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 380px;
    margin: 0;
    padding: 0;
}

/* horizontal: buttons side by side, wrapping on small screens */
:where(.cmp-adaptiveform-buttonchoice__widget.HORIZONTAL, .cmp-adaptiveform-buttonchoice__widget.horizontal) {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 760px;
}

:where(.cmp-adaptiveform-buttonchoice__widget.HORIZONTAL, .cmp-adaptiveform-buttonchoice__widget.horizontal) > :where(.cmp-adaptiveform-buttonchoice__option) {
    flex: 1 1 160px;
}

:where(.cmp-adaptiveform-buttonchoice__option) {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 58px;
    margin: 0;
    padding: 12px 20px;
    font: inherit;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

:where(.cmp-adaptiveform-buttonchoice) {
    --fd-buttonchoice-bg: #1c4511;
    --fd-buttonchoice-color: #b6fb6f;
    --fd-buttonchoice-border: #b6fb6f;
    --fd-buttonchoice-hover-bg: #b6fb6f;
    --fd-buttonchoice-hover-color: #1c4511;
    --fd-buttonchoice-hover-border: #1c4511;
    --fd-buttonchoice-selected-bg: var(--fd-buttonchoice-hover-bg);
    --fd-buttonchoice-selected-color: var(--fd-buttonchoice-hover-color);
    --fd-buttonchoice-selected-border: var(--fd-buttonchoice-hover-border);
    --fd-buttonchoice-focus: #1c4511;
    --fd-buttonchoice-radius: 10px;
}

.cmp-adaptiveform-buttonchoice .cmp-adaptiveform-buttonchoice__option {
    -webkit-appearance: none;
    appearance: none;
    background-color: var(--fd-buttonchoice-bg);
    background-image: none;
    color: var(--fd-buttonchoice-color);
    border: 1px solid var(--fd-buttonchoice-border);
    border-radius: var(--fd-buttonchoice-radius);
    box-shadow: none;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

/* hover only on devices with a real pointer, so it does not "stick" on touch screens after a tap;
   the selected option keeps its own colours */
@media (hover: hover) {
    .cmp-adaptiveform-buttonchoice .cmp-adaptiveform-buttonchoice__option:hover:not(:disabled, [aria-pressed="true"]) {
        background-color: var(--fd-buttonchoice-hover-bg);
        color: var(--fd-buttonchoice-hover-color);
        border-color: var(--fd-buttonchoice-hover-border);
    }
}

.cmp-adaptiveform-buttonchoice .cmp-adaptiveform-buttonchoice__option:active:not(:disabled) {
    background-color: var(--fd-buttonchoice-hover-bg);
    color: var(--fd-buttonchoice-hover-color);
    border-color: var(--fd-buttonchoice-hover-border);
    transform: scale(0.99);
}

/* selected option (also shown when the user comes back to the step) */
.cmp-adaptiveform-buttonchoice .cmp-adaptiveform-buttonchoice__option[aria-pressed="true"] {
    background-color: var(--fd-buttonchoice-selected-bg);
    color: var(--fd-buttonchoice-selected-color);
    border-color: var(--fd-buttonchoice-selected-border);
}

.cmp-adaptiveform-buttonchoice .cmp-adaptiveform-buttonchoice__option:focus {
    outline: none;
}

.cmp-adaptiveform-buttonchoice .cmp-adaptiveform-buttonchoice__option:focus-visible {
    outline: 3px solid var(--fd-buttonchoice-focus);
    outline-offset: 3px;
}

.cmp-adaptiveform-buttonchoice .cmp-adaptiveform-buttonchoice__option:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

:where(.cmp-adaptiveform-buttonchoice__errormessage) {
    display: none;
    margin-top: 12px;
}

:where(.cmp-adaptiveform-buttonchoice[data-cmp-valid="false"] > .cmp-adaptiveform-buttonchoice__errormessage) {
    display: block;
}

@media (prefers-reduced-motion: reduce) {
    .cmp-adaptiveform-buttonchoice__option {
        transition: none;
    }
}

