/* Shared button colors. Load after framework bundles and before page styles.
   Keep geometry in ium.css; this contract also covers layouts without it. */
/* Primary actions own their foreground and fill together. Module themes may
   set both --ium-button-* tokens; late compatibility styles must not recolor
   labels independently of a module's custom background. */
.btn.btn-primary {
    color: var(--ium-button-ink, #07303e);
    border-color: var(--ium-button-fill, #28b1cd);
    background-color: var(--ium-button-fill, #28b1cd);
    --bs-btn-disabled-color: var(--ium-button-ink, #07303e);
    --bs-btn-disabled-bg: var(--ium-button-fill, #28b1cd);
    --bs-btn-disabled-border-color: var(--ium-button-fill, #28b1cd);
}

.btn-check:checked+.btn.btn-primary,
.btn-check:active+.btn.btn-primary,
.btn.btn-primary:focus:not(.btn-active),
.btn.btn-primary:hover:not(.btn-active),
.btn.btn-primary:active:not(.btn-active),
.btn.btn-primary.active,
.btn.btn-primary.show,
.show>.btn.btn-primary {

    color: var(--ium-button-hover-ink, #fff);
    border-color: var(--ium-button-hover-fill, #0d6377) !important;
    background-color: var(--ium-button-hover-fill, #0d6377) !important;
}

/* Bootstrap gives button icons and dropdown arrows their own state colors.
   Inherit the final label color so a scoped theme stays a coherent pair. */
.btn.btn-primary :is(i, .svg-icon),
.btn.btn-primary.dropdown-toggle::after,
.btn-check:checked + .btn.btn-primary :is(i, .svg-icon),
.btn-check:active + .btn.btn-primary :is(i, .svg-icon),
.btn.btn-primary:is(:focus, :hover, :active):not(.btn-active) :is(i, .svg-icon),
.btn.btn-primary:is(.active, .show) :is(i, .svg-icon),
.show > .btn.btn-primary :is(i, .svg-icon),
.btn-check:checked + .btn.btn-primary.dropdown-toggle::after,
.btn-check:active + .btn.btn-primary.dropdown-toggle::after,
.btn.btn-primary:is(:focus, :hover, :active):not(.btn-active).dropdown-toggle::after,
.btn.btn-primary:is(.active, .show).dropdown-toggle::after,
.show > .btn.btn-primary.dropdown-toggle::after {
    color: inherit !important;
}

/* Disabled controls keep the same pair even inside a disabled fieldset or when
   a component expresses its state through a class or aria-disabled. */
.btn:is(.btn-primary, .actions)[aria-disabled="true"]:not(:disabled):not(.disabled) {
    opacity: var(--bs-btn-disabled-opacity, .65);
    cursor: not-allowed;
}

.btn.btn-primary:is(:disabled, .disabled, [aria-disabled="true"]),
fieldset:disabled .btn.btn-primary {
    --ium-button-hover-ink: var(--ium-button-ink, #07303e);
    --ium-button-hover-fill: var(--ium-button-fill, #28b1cd);
    color: var(--ium-button-ink, #07303e);
    border-color: var(--ium-button-fill, #28b1cd);
    background-color: var(--ium-button-fill, #28b1cd);
}

.btn.btn-primary:is(:disabled, .disabled, [aria-disabled="true"]) :is(i, .svg-icon),
.btn.btn-primary:is(:disabled, .disabled, [aria-disabled="true"]).dropdown-toggle::after,
fieldset:disabled .btn.btn-primary :is(i, .svg-icon),
fieldset:disabled .btn.btn-primary.dropdown-toggle::after {
    color: inherit !important;
}

.btn.actions {
    color: var(--ium-button-ink, #07303e);
    border-color: var(--ium-button-fill, #28b1cd);
    background-color: var(--ium-button-fill, #28b1cd);
}

.btn.actions i,
.btn.actions .svg-icon,
.btn.actions.dropdown-toggle::after {
    color: inherit !important;
}

.btn.actions:is(:hover, :focus, :active):not(.btn-active),
.btn.actions:is(.active, .show) {
    color: var(--ium-button-hover-ink, var(--ium-button-ink, #07303e));
    border-color: var(--ium-button-hover-fill, #25c4e5) !important;
    background-color: var(--ium-button-hover-fill, #25c4e5) !important;
}

.btn.actions:is(:hover, :focus, :active):not(.btn-active) :is(i, .svg-icon),
.btn.actions:is(.active, .show) :is(i, .svg-icon),
.btn.actions:is(:hover, :focus, :active):not(.btn-active).dropdown-toggle::after,
.btn.actions:is(.active, .show).dropdown-toggle::after {
    color: inherit !important;
}

.btn.actions:is(:disabled, .disabled, [aria-disabled="true"]),
fieldset:disabled .btn.actions {
    --ium-button-hover-ink: var(--ium-button-ink, #07303e);
    --ium-button-hover-fill: var(--ium-button-fill, #28b1cd);
    color: var(--ium-button-ink, #07303e);
    border-color: var(--ium-button-fill, #28b1cd);
    background-color: var(--ium-button-fill, #28b1cd);
}

.btn.actions:is(:disabled, .disabled, [aria-disabled="true"]) :is(i, .svg-icon),
.btn.actions:is(:disabled, .disabled, [aria-disabled="true"]).dropdown-toggle::after,
fieldset:disabled .btn.actions :is(i, .svg-icon),
fieldset:disabled .btn.actions.dropdown-toggle::after {
    color: inherit !important;
}
