input[type='submit'],
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Buttons and anchors resolve different baselines, so inline siblings such as
       Save (<button>) and Cancel (<a>) drift vertically. Align by box middle instead. */
    vertical-align: middle;
    text-align: center;
    gap: 0.25rem;
    cursor: pointer;
    padding: 1rem 1.5rem;
    color: var(--color-1-reverse);
    background: var(--color-1);
    border-radius: var(--button-radius);
    border: none;
    text-decoration: none;
    font: 500 .9rem/.9rem var(--font-sans-serif);
    box-shadow: none !important;
}

    input[type='submit']:hover,
    .button:hover {
        opacity: .8 !important;
    }

    .button.reverse {
        color: var(--color-1);
        background: var(--color-1-reverse);
    }

    .button.button-alt {
        background: var(--color-2);
        color: var(--color-2-reverse);
        border: none;
        font-weight: 500;
    }

        .button.button-alt.reverse {
            background: var(--color-2-reverse);
            color: var(--color-2);
        }

    .button.button-cta {
        background: var(--color-success);
        color: var(--color-success-reverse);
        border: none;
        font-weight: 500;
    }

        .button.button-cta.reverse {
            background: var(--color-success-reverse);
            color: var(--color-success);
        }

            .button.button-cta.reverse.outline {
                background: var(--color-success-reverse);
                color: var(--color-success);
                border: 2px solid var(--color-success);
            }

    .button.button-red {
        background: var(--color-error);
        color: var(--color-error-reverse);
        border: none;
        font-weight: 500;
    }

        .button.button-red.reverse {
            background: var(--color-error-reverse);
            color: var(--color-error);
        }

    /* Matches button-alt/cta/red: no border, so soft buttons stay the same
       height as their siblings regardless of whether they render as
       <button> or <a>. */
    .button.button-soft {
        background: rgba(0,0,0,.08);
        color: var(--color-dark);
        border: none;
        font-weight: 500;
    }

    .button.button-big {
        font-size: 1.2rem !important;
        line-height: 1.2rem !important;
        padding: 1rem 2rem !important;
    }

    .button.button-small {
        height: 25px;
        padding: 0 10px;
        font-size: .75rem;
        line-height: 1;
    }

    input[type='submit'].loading,
    .button.loading {
        cursor: wait;
        opacity: .6;
    }

    /* Buttons rendered as <button> and disabled during a run must not keep the
       interactive hover lift, which is !important and would otherwise win. */
    button.button:disabled,
    input[type='submit']:disabled {
        cursor: not-allowed;
        opacity: .6 !important;
    }

        button.button.loading:disabled {
            cursor: wait;
        }

        input[type='submit'].loading::before,
        .button.loading::before {
            display: inline-block;
            font-family: var(--font-icon);
            font-weight: 500;
            content: "\f3f4";
            margin-right: 5px;
            animation: spin 1s infinite linear;
        }

        input[type='submit'].loading i,
        .button.loading i {
            display: none;
        }

    .button.button-more::after {
        font-family: var(--font-icon);
        font-size: .8rem;
        line-height: .8rem;
        content: "\f178";
        opacity: 1;
        margin: 2px -5px 0 5px;
    }

.tabs {
    display: flex;
    align-items: center;
}

.tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.25rem;
    cursor: pointer;
    padding: 10px 15px;
    background-color: var(--background-color);
    border: 1px solid var(--border-color) !important;
    color: var(--sub-text-color);
    border-top-right-radius: 10px;
    border-top-left-radius: 10px;
    font: var(--button-font-weight) .9rem/.9rem var(--font-sans-serif);
}

    .tab:hover {
        color: var(--text-color);
    }

    .tab.active {
        background-color: var(--color-lightest);
        color: var(--text-color);
        font-weight: 800;
        border-bottom: none !important;
    }

/* View-page tab panels. All panels stay mounted and are toggled with display so
   that long-lived JS widgets (the TinyMCE content editor, drag-sort media lists)
   are never torn out of the DOM when switching tabs. */
.view-tab-panel {
    display: none;
}

    .view-tab-panel.active {
        display: block;
    }

.rpa-tabs {
    display: flex;
    flex-direction: column;
}

.rpa-tabs-nav {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
}

/* Same tab styling as .rpa-tabs-nav, but without the divider rule: view pages
   sit directly above a card, which already provides its own top edge. */
.view-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}

.rpa-tab,
.view-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--sub-text-color);
    cursor: pointer;
}

    .rpa-tab:hover,
    .view-tab:hover {
        color: var(--color-1);
    }

    .rpa-tab.active,
    .view-tab.active {
        color: var(--color-1);
        border-bottom-color: var(--color-1);
    }

    .rpa-tab:disabled,
    .view-tab:disabled {
        color: var(--color-gray);
        cursor: not-allowed;
    }

/* Subtle, quick fade/slide applied to tab panel content when switching tabs.
   The consuming markup keys the .rpa-tab-content wrapper on the active tab so
   Blazor re-creates it, re-triggering this animation. */
.rpa-tab-content {
    animation: rpa-tab-fade 180ms ease-out;
}

@keyframes rpa-tab-fade {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .rpa-tab-content {
        animation: none;
    }
}
