/**
 * ============================================================================
 * HYBRID PORTAL - SHARED BUTTON THEME                     (2026-11-27)
 * ============================================================================
 * The button palette exists ONCE, here. This file is loaded by:
 *   - Views/Shared/_Layout.cshtml, BEFORE fleet-custom.css - every Portal page;
 *   - the standalone sign-in pages Views/Auth/Login, ForgotPassword and
 *     ResetPassword (Layout = null). They must not load fleet-custom.css (it
 *     would restyle their whole page), so what both need lives here:
 *       1. the button tokens (:root) - the Primary palette and the COMMON hover;
 *       2. the SweetAlert2 Primary confirmation class .fleet-swal-primary;
 *       3. the sign-in pages' Primary action .btn-login (colours and states
 *          only - each page keeps its own size, radius, font and hover lift).
 * Every other button rule (.btn-primary, outline / soft / Export hover ...)
 * lives in fleet-custom.css and reads these tokens.
 *
 * WHITE-LABEL: a customer host with configured colours overrides the Primary
 * tokens in _Layout's <style id="wl-theme"> (html:root beats :root). The
 * sign-in pages never had customer colours (the same on every host); the
 * customer login templates (Views/WhiteLabel/LoginTemplates/*) have their own
 * stylesheets and do NOT load this file.
 *
 * Standard: Read_Me/UI_Concepts/Primary_Button_Standard.md (working agreement #45).
 * ============================================================================
 */

:root {
    /* =========================================
       COMMON HOVER (owner decision 2026-11-26, extended 2026-11-27)
       =========================================
       The one hover of every applicable action button: solid Primary, outlined /
       white-background, soft and Export actions (Primary_Button_Standard.md §2).
       Background #E2C9FF, label AND icons #8237C0. Contrast #8237C0 on #E2C9FF
       4.31 : 1 - owner-approved, above 3 : 1, below the 4.5 : 1 WCAG AA guideline
       for normal-size text. */
    --theme-btn-hover-bg: #E2C9FF;
    --theme-btn-hover-color: #8237C0;

    /* =========================================
       PRIMARY BUTTON (owner decision 2026-11-26)
       =========================================
       The default Hybrid Portal Primary-button palette. Button-ONLY tokens: .btn-primary,
       .fleet-btn-primary, the SweetAlert Primary confirmation (.fleet-swal-primary) and the
       sign-in pages' .btn-login read them and nothing else does, so a future Primary-button
       colour change is made HERE, never on a page. --theme-primary stays the brand colour of
       everything else (text, badges, table headers, links, toggles, selected states).
       White-label customer hosts override these tokens with their own brand colours
       (_Layout.cshtml, <style id="wl-theme">), exactly as they override --theme-primary.
       Contrast: #FFFFFF on #7C2DBD 7.08 : 1; #FFFFFF on the focus / pressed shade
       #482D94 10.10 : 1; the hover is the common hover above. */
    --theme-btn-primary-bg: #7C2DBD;
    --theme-btn-primary-color: #FFFFFF;
    --theme-btn-primary-hover-bg: var(--theme-btn-hover-bg);
    --theme-btn-primary-hover-color: var(--theme-btn-hover-color);
    --theme-btn-primary-pressed-bg: var(--theme-primary-dark);   /* #482D94 - focus and pressed keep the darker shade they had before */
    --theme-btn-primary-pressed-color: #FFFFFF;
}

/* SweetAlert2 Primary confirmation (2026-11-26). A confirm button that is the dialog's
   normal Primary action is opened with  customClass: { confirmButton: 'fleet-swal-primary' }
   - never confirmButtonColor with a purple literal - and takes the same tokens. Destructive
   and success confirmations keep their own confirmButtonColor (red / green): never give
   them this class. SweetAlert focuses the confirm button when the dialog opens, so focus
   changes no colour here; the focus ring is the one the purple confirm had
   (.swal2-default-outline). Hover and pressed replace SweetAlert's darkening overlay.
   Specificity (0,2,0) beats SweetAlert's own (0,1,2) whichever stylesheet loads last. */
.swal2-confirm.fleet-swal-primary {
    color: var(--theme-btn-primary-color);
    background-color: var(--theme-btn-primary-bg);
}

.swal2-confirm.fleet-swal-primary:focus-visible {
    box-shadow: 0 0 0 3px rgba(100, 150, 200, .5);
}

@media (hover: hover) {
    .swal2-confirm.fleet-swal-primary:not([disabled]):hover {
        color: var(--theme-btn-primary-hover-color);
        background-color: var(--theme-btn-primary-hover-bg);
        background-image: none;
    }
}

.swal2-confirm.fleet-swal-primary:not([disabled]):active {
    color: var(--theme-btn-primary-pressed-color);
    background-color: var(--theme-btn-primary-pressed-bg);
    background-image: none;
}

/* Sign-in pages - the Primary action .btn-login (Sign in, Send reset link, Reset password,
   Request a new link). Same state model as .btn-primary (fleet-custom.css):
     normal     #7C2DBD, white label
     focus      the darker shade (#482D94), white - a focused button (keyboard, or the
                Sign in button a saved credential focuses on load) never shows the hover
     hover      #E2C9FF, #8237C0 label - pointer devices only; the page's own lift and
                shadow stay as they were
     pressed    the darker shade again (equal specificity, after hover)
     disabled   the normal colours dimmed (.65), no hover - as Bootstrap does for .btn
   No !important: the pages declare no colour of their own for .btn-login any more. */
.btn-login {
    color: var(--theme-btn-primary-color);
    background-color: var(--theme-btn-primary-bg);
}

.btn-login:focus,
.btn-login:focus-visible {
    color: var(--theme-btn-primary-pressed-color);
    background-color: var(--theme-btn-primary-pressed-bg);
}

@media (hover: hover) {
    .btn-login:not(:disabled):hover {
        color: var(--theme-btn-primary-hover-color);
        background-color: var(--theme-btn-primary-hover-bg);
    }
}

.btn-login:not(:disabled):active {
    color: var(--theme-btn-primary-pressed-color);
    background-color: var(--theme-btn-primary-pressed-bg);
}

.btn-login:disabled {
    color: var(--theme-btn-primary-color);
    background-color: var(--theme-btn-primary-bg);
    opacity: .65;
    pointer-events: none;
}
