/* Buttons: navy main ones, white grey ones, the ones in the dark heading, and choice buttons (toggle buttons). */

/* Buttons: pills; the main ones navy with a light-blue edge and the light sweeping over them on hover. */
.fi-panel-app .fi-btn {
    border-radius: 999px;
    font-weight: 600;
}

.fi-panel-app .fi-btn.fi-color-primary:not(.fi-outlined):not(.fi-link) {
    position: relative;
    overflow: hidden;
    background-color: var(--ambex-navy);
    color: #ffffff;
    box-shadow: 0 0 0 1px rgba(90, 165, 255, 0.65), 0 6px 16px -8px rgba(0, 0, 0, 0.55);
    transition: transform 0.25s ease, box-shadow 0.3s ease;
}

.fi-panel-app .fi-btn.fi-color-primary:not(.fi-outlined):not(.fi-link)::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -70%;
    width: 45%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: skewX(-20deg);
    transition: left 0.7s ease;
    pointer-events: none;
}

.fi-panel-app .fi-btn.fi-color-primary:not(.fi-outlined):not(.fi-link):hover {
    background-color: var(--ambex-navy);
    transform: translateY(-2px);
    box-shadow: 0 0 0 1px rgba(90, 165, 255, 0.8), 0 14px 28px -12px rgba(0, 0, 0, 0.7);
}

.fi-panel-app .fi-btn.fi-color-primary:not(.fi-outlined):not(.fi-link):hover::before {
    left: 130%;
}

.fi-panel-app .fi-btn.fi-color-primary:not(.fi-outlined):not(.fi-link) .fi-icon {
    color: #ffffff;
}

.dark .fi-panel-app .fi-btn.fi-color-primary:not(.fi-outlined):not(.fi-link),
.dark .fi-panel-app .fi-btn.fi-color-primary:not(.fi-outlined):not(.fi-link):hover {
    background-color: var(--ambex-blue);
}

/*
    Secondary (grey) buttons: white with a light blue edge (a navy one looked dirty), navy text and navy
    icons; the edge turns the brand's blue under the pointer. The edge is an outline
    drawn inside (not a 1px shadow): browsers put it on whole screen pixels, so it is equally thick all
    round also at 125% or 150% screen scaling, where a shadow came out thicker on one side.
*/
.fi-panel-app .fi-btn.fi-color-gray:not(.fi-outlined):not(.fi-link) {
    background-color: #ffffff;
    color: var(--ambex-navy);
    box-shadow: none;
    outline: 1px solid var(--ambex-rule-strong);
    outline-offset: -1px;
}

.fi-panel-app .fi-btn.fi-color-gray:not(.fi-outlined):not(.fi-link):hover {
    background-color: var(--ambex-tint);
    outline-color: var(--ambex-blue);
}

.fi-panel-app .fi-btn.fi-color-gray:not(.fi-outlined):not(.fi-link) .fi-icon {
    color: var(--ambex-navy);
}

.dark .fi-panel-app .fi-btn.fi-color-gray:not(.fi-outlined):not(.fi-link) {
    background-color: rgba(255, 255, 255, 0.04);
    color: #ffffff;
    box-shadow: 0 0 0 1px rgba(90, 165, 255, 0.35);
}

.dark .fi-panel-app .fi-btn.fi-color-gray:not(.fi-outlined):not(.fi-link) .fi-icon {
    color: var(--ambex-sky);
}

/*
    Filament's default grey buttons (color "gray" gives them no colour class): the same navy edge (an
    outline inside, as above; Filament's ring is made see-through, so a focus ring still shows) and
    navy icons. Not those in the dark page heading, which keep their own look.
*/
.fi-body.fi-panel-app .fi-btn:where(:not(.fi-color, .fi-outlined, .fi-link, .fi-header .fi-btn)) {
    --tw-ring-color: transparent;
    outline: 1px solid var(--ambex-navy);
    outline-offset: -1px;
}

.fi-body.fi-panel-app .fi-btn:where(:not(.fi-color, .fi-outlined, .fi-link, .fi-header .fi-btn)):focus-visible {
    --tw-ring-color: var(--ambex-blue);
}

.fi-body.fi-panel-app .fi-btn:where(:not(.fi-color, .fi-outlined, .fi-link, .fi-header .fi-btn)) .fi-icon {
    color: var(--ambex-navy);
}

/* The main button in the dark heading: white with navy text, so it stands out from the dark hero (navy on navy disappears). */
.fi-panel-app .fi-header .fi-btn.fi-color-primary:not(.fi-outlined):not(.fi-link),
.dark .fi-panel-app .fi-header .fi-btn.fi-color-primary:not(.fi-outlined):not(.fi-link) {
    background-color: #ffffff;
    color: var(--ambex-navy);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9), 0 8px 22px -8px rgba(90, 165, 255, 0.55);
}

.fi-panel-app .fi-header .fi-btn.fi-color-primary:not(.fi-outlined):not(.fi-link):hover,
.dark .fi-panel-app .fi-header .fi-btn.fi-color-primary:not(.fi-outlined):not(.fi-link):hover {
    background-color: #eaf3fd;
    box-shadow: 0 0 0 1px #ffffff, 0 14px 28px -10px rgba(90, 165, 255, 0.7);
}

.fi-panel-app .fi-header .fi-btn.fi-color-primary:not(.fi-outlined):not(.fi-link)::before {
    background: linear-gradient(100deg, transparent, rgba(90, 165, 255, 0.35), transparent);
}

.fi-panel-app .fi-header .fi-btn.fi-color-primary:not(.fi-outlined):not(.fi-link) .fi-icon {
    color: var(--ambex-blue);
}

/* Grey buttons in the dark heading: the site's outlined "ghost" button. */
.fi-panel-app .fi-header .fi-btn.fi-color-gray {
    background: rgba(255, 255, 255, 0.04);
    color: #ffffff;
    box-shadow: 0 0 0 1px rgba(90, 165, 255, 0.5);
}

.fi-panel-app .fi-header .fi-btn.fi-color-gray:hover {
    background: rgba(90, 165, 255, 0.12);
}

.fi-panel-app .fi-header .fi-btn.fi-color-gray .fi-icon {
    color: #ffffff;
}

@media (prefers-reduced-motion: reduce) {
    .fi-panel-app .fi-btn.fi-color-primary,
    .fi-panel-app .fi-btn.fi-color-primary::before {
        transition: none;
    }

    .fi-panel-app .fi-btn.fi-color-primary:hover {
        transform: none;
    }
}

/*
    Choice buttons (Filament toggle buttons, e.g. "Publish now" / "Schedule"): every option has the
    primary colour and only aria-pressed tells the chosen one, so the navy style above would paint
    both alike. The options not chosen look like the white grey buttons; the chosen one is light blue
    with a blue ring, so the window's own navy button (Confirm) stays the only main action.
*/
.fi-panel-app .fi-fo-toggle-buttons .fi-btn.fi-color-primary:not(.fi-outlined):not(.fi-link)[aria-pressed="true"] {
    background-color: var(--ambex-tint);
    color: var(--ambex-navy);
    box-shadow: inset 0 0 0 2px var(--ambex-blue);
    transform: none;
}

.fi-panel-app .fi-fo-toggle-buttons .fi-btn.fi-color-primary:not(.fi-outlined):not(.fi-link)[aria-pressed="true"]::before {
    display: none;
}

.fi-panel-app .fi-fo-toggle-buttons .fi-btn.fi-color-primary:not(.fi-outlined):not(.fi-link)[aria-pressed="true"] .fi-icon {
    color: var(--ambex-blue);
}

.dark .fi-panel-app .fi-fo-toggle-buttons .fi-btn.fi-color-primary:not(.fi-outlined):not(.fi-link)[aria-pressed="true"] {
    background-color: rgba(90, 165, 255, 0.16);
    color: #ffffff;
    box-shadow: inset 0 0 0 2px var(--ambex-sky);
}

.dark .fi-panel-app .fi-fo-toggle-buttons .fi-btn.fi-color-primary:not(.fi-outlined):not(.fi-link)[aria-pressed="true"] .fi-icon {
    color: var(--ambex-sky);
}
.fi-panel-app .fi-fo-toggle-buttons .fi-btn.fi-color-primary:not(.fi-outlined):not(.fi-link)[aria-pressed="false"] {
    background-color: #ffffff;
    color: var(--ambex-navy);
    box-shadow: 0 0 0 1px var(--ambex-rule-strong);
    transform: none;
}

.fi-panel-app .fi-fo-toggle-buttons .fi-btn.fi-color-primary:not(.fi-outlined):not(.fi-link)[aria-pressed="false"]:hover {
    background-color: var(--ambex-tint);
    box-shadow: 0 0 0 1px var(--ambex-blue);
}

.fi-panel-app .fi-fo-toggle-buttons .fi-btn.fi-color-primary:not(.fi-outlined):not(.fi-link)[aria-pressed="false"]::before {
    display: none;
}

.fi-panel-app .fi-fo-toggle-buttons .fi-btn.fi-color-primary:not(.fi-outlined):not(.fi-link)[aria-pressed="false"] .fi-icon {
    color: var(--ambex-blue);
}

.dark .fi-panel-app .fi-fo-toggle-buttons .fi-btn.fi-color-primary:not(.fi-outlined):not(.fi-link)[aria-pressed="false"] {
    background-color: rgba(255, 255, 255, 0.04);
    color: #ffffff;
    box-shadow: 0 0 0 1px rgba(90, 165, 255, 0.35);
}

.dark .fi-panel-app .fi-fo-toggle-buttons .fi-btn.fi-color-primary:not(.fi-outlined):not(.fi-link)[aria-pressed="false"] .fi-icon {
    color: var(--ambex-sky);
}

/* A form's Save button that stays at the bottom of a phone's screen while the long form scrolls (Settings). */
@media (max-width: 767px) {
    .fi-panel-app .ambex-save-bar {
        position: sticky;
        bottom: 0;
        z-index: 10;
        margin-inline: -1rem;
        padding: 0.625rem 1rem calc(0.625rem + env(safe-area-inset-bottom));
        background: var(--ambex-bg);
        box-shadow: 0 -1px 0 var(--ambex-rule);
    }

    .dark .fi-panel-app .ambex-save-bar {
        background: #0b1626;
    }
}

/* Buttons are as wide as their text: centred dialogs (confirmations, cancelling a plan) would otherwise stack them
   in a column over the dialog's width. In a row, the main one last (Cancel, then Confirm), as in the other dialogs. */
.fi-panel-app .fi-modal .fi-modal-footer.fi-align-center .fi-modal-footer-actions {
    display: flex;
    flex-direction: row-reverse;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}
