/* Shared CTA family. Colors are immediate feedback; no spatial hover/press. */
.btn,
.m5-btn-primary {
    font-family: var(--font-control, 'Poppins', sans-serif);
    font-weight: 700;
    font-size: var(--text-control-prominent, 1.125rem);
    line-height: 1.5;
    padding: 1rem 2rem;
    border-radius: 999px;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    box-sizing: border-box;
    inline-size: max-content;
    max-inline-size: 100%;
    min-block-size: var(--control-min-size, 2.75rem);
    min-inline-size: var(--control-min-size, 2.75rem);
    white-space: normal;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: color var(--motion-duration-state, 160ms) ease,
                background-color var(--motion-duration-state, 160ms) ease,
                border-color var(--motion-duration-state, 160ms) ease;
}

button.btn,
button.m5-btn-primary { appearance: none; }

.btn.btn--primary,
.m5-btn-primary {
    border: 0;
    background: #FFD500;
    color: #243C4B;
}
.btn.btn--primary:visited,
.m5-btn-primary:visited { color: #243C4B; }

.btn.btn--ghost {
    color: #fff;
    border: 1px solid #fff;
    background: transparent;
}
.btn.btn--ghost:visited { color: #fff; }
.btn.btn--ghost.ci-darkblue {
    color: #243C4B;
    border: 2px solid #243C4B;
}
.btn.btn--ghost.ci-darkblue:visited { color: #243C4B; }

.btn.btn--secondary.ci-plan-blue {
    background: var(--plan-blau, #0072CE);
    border: 1px solid var(--plan-blau, #0072CE);
    color: #fff;
}
.btn.btn--secondary.ci-plan-blue:visited { color: #fff; }
.btn ion-icon { flex-shrink: 0; font-size: 1.25em; color: currentColor; }

@media (hover: hover) and (pointer: fine) {
    .btn.btn--primary:hover:where(:not(:disabled, .disabled, [aria-disabled="true"])),
    .m5-btn-primary:hover:where(:not(:disabled, .disabled, [aria-disabled="true"])) {
        background: #F2CA00;
        color: #243C4B;
    }
    .btn.btn--ghost:hover:where(:not(:disabled, .disabled, [aria-disabled="true"])) {
        background: #fff;
        color: #243C4B;
    }
    .btn.btn--ghost.ci-darkblue:hover:where(:not(:disabled, .disabled, [aria-disabled="true"])) {
        background: #243C4B;
        color: #fff;
    }
    .btn.btn--secondary.ci-plan-blue:hover:where(:not(:disabled, .disabled, [aria-disabled="true"])) {
        background: #005BA8;
        border-color: #005BA8;
        color: #fff;
    }
}

.btn.btn--primary:active:where(:not(:disabled, .disabled, [aria-disabled="true"])),
.m5-btn-primary:active:where(:not(:disabled, .disabled, [aria-disabled="true"])) {
    background: #E6BF00;
    color: #243C4B;
}
.btn.btn--ghost:active:where(:not(:disabled, .disabled, [aria-disabled="true"])) {
    background: #D9D9D6;
    color: #243C4B;
    border-color: #D9D9D6;
}
.btn.btn--ghost.ci-darkblue:active:where(:not(:disabled, .disabled, [aria-disabled="true"])) {
    background: #0A141C;
    color: #fff;
    border-color: #0A141C;
}
.btn.btn--secondary.ci-plan-blue:active:where(:not(:disabled, .disabled, [aria-disabled="true"])) {
    background: #004B87;
    border-color: #004B87;
    color: #fff;
}

/* Additive contrast edge works on light, dark and image surfaces. */
.btn:focus-visible,
.m5-btn-primary:focus-visible {
    outline: var(--focus-width, 3px) solid #243C4B;
    outline-offset: var(--focus-offset, 3px);
    box-shadow: 0 0 0 3px #fff;
}
.btn.btn--ghost:not(.ci-darkblue):focus-visible {
    outline-color: #fff;
    box-shadow: 0 0 0 3px #243C4B;
}

/* Reflect existing unavailable states; activation belongs to the component. */
.btn:is(:disabled, .disabled, [aria-disabled="true"]),
.m5-btn-primary:is(:disabled, .disabled, [aria-disabled="true"]) {
    opacity: .55;
    cursor: not-allowed;
}

/* Keep non-spatial feedback under Reduce; no blanket transition reset. */
@media (prefers-reduced-motion: reduce) {
    .btn,
    .m5-btn-primary {
        transform: none;
        animation: none;
        transition-property: color, background-color, border-color;
    }
}
.reduced .btn,
.reduced .m5-btn-primary {
    transform: none;
    animation: none;
    transition-property: color, background-color, border-color;
}
@media (forced-colors: active) {
    .btn,
    .m5-btn-primary { border: 1px solid ButtonText; }
    .btn:focus-visible,
    .m5-btn-primary:focus-visible { outline-color: Highlight; }
}
