﻿/* =========================================
   AlphaWells — Theme v2 Buttons 
   ========================================= */

:root {
    /* uses existing Theme v2 tokens */
    --aw-btn-height: 38px;
    --aw-btn-radius: 6px;
    --aw-btn-gap: 10px;
    --aw-btn-pad-x: 16px;
    --aw-btn-border: 1px solid transparent;
    --aw-btn-text: #FFFFFF;
}

/* Base */
.btn-aw {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--aw-btn-gap);
    min-height: var(--aw-btn-height);
    padding: 0 var(--aw-btn-pad-x);
    border-radius: var(--aw-btn-radius);
    border: var(--aw-btn-border);
    font-family: var(--aw-font-sans);
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1;
    color: var(--aw-btn-text);
    box-shadow: 0 1px 2px rgba(0,0,0,.05);
    transition: transform .05s ease, box-shadow .2s ease, opacity .2s ease;
    text-transform: none; /* defeat old uppercase */
    text-decoration: none !important;
}

    /* Override Bootstrap link states to maintain button text color */
    .btn-aw:link,
    .btn-aw:visited,
    .btn-aw:hover,
    .btn-aw:active,
    .btn-aw:focus {
        color: var(--aw-btn-text) !important;
    }

    /* Icon sizing (Font Awesome) */
    .btn-aw i,
    .btn-aw .fa,
    .btn-aw .fas,
    .btn-aw .far {
        font-size: 1.05rem;
        line-height: 1;
    }

/* Variants from Theme v2 tokens */
.btn-aw--primary { /* Actions Dashboard, primary actions */
    background: #0d6efd; /* Bootstrap primary blue */
}

    .btn-aw--primary:hover {
        background: #0b5ed7;
        color: #fff !important;
    }

.btn-aw--secondary {
    background: #6c757d; /* Bootstrap secondary gray */
}

    .btn-aw--secondary:hover {
        background: #5c636a;
        color: #fff !important;
    }

.btn-aw--warning {
    background: #ffc107; /* Bootstrap warning yellow */
    color: #212529;
}

    .btn-aw--warning:hover {
        background: #e0a800;
        color: #212529 !important;
    }

.btn-aw--success { /* "Create New" */
    background: var(--aw-green-500); /* #6EB17E */
}

    .btn-aw--success:hover {
        background: var(--aw-green-600, #5D9F70);
        color: #fff !important; /* Override Bootstrap link hover color */
    }

.btn-aw--apply {
    background: #E9A93D; /* warm amber */
    border: 1px solid transparent;
    color: #fff;
}

    .btn-aw--apply:hover {
        background: #D99934; /* a shade darker on hover */
        color: #fff !important; /* Override Bootstrap link hover color */
    }

.btn-aw--slate { /* neutral navigation / "back" and row-level actions (1099, Retention) */
    background: #4A5D6E; /* slate: sits between secondary gray and brand teal */
}

    .btn-aw--slate:hover {
        background: #3C4D5C;
        color: #fff !important; /* Override Bootstrap link hover color */
    }

.btn-aw--teal { /* “Deleted Items” */
    background: var(--aw-teal-700); /* #1A4E63 */
}

    .btn-aw--teal:hover {
        background: var(--aw-teal-800, #153F50);
        color: #fff !important; /* Override Bootstrap link hover color */
    }

.btn-aw--accent { /* amber confirm/approve actions on trust review screens */
    background: #E9A93D;
}

    .btn-aw--accent:hover {
        background: #D99934;
        color: #fff !important;
    }

.btn-aw--danger,
.btn-aw--red { /* destructive / release actions */
    background: #dc3545;
}

    .btn-aw--danger:hover,
    .btn-aw--red:hover {
        background: #bb2d3b;
        color: #fff !important;
    }

/* Outline: white face, brand-teal border and text (secondary actions on trust
   screens such as Open / Pivot / back links). Text color must beat the base
   white-text !important rule, so it is !important too. */
.btn-aw--outline {
    background: #fff;
    border: 1px solid var(--aw-teal-700, #1A4E63);
    color: var(--aw-teal-700, #1A4E63) !important;
}

    .btn-aw--outline:hover {
        background: var(--aw-teal-700, #1A4E63);
        color: #fff !important;
    }

    /* Anchors rendered as outline buttons: the base `.btn-aw:link` / `:visited` / `:focus`
       rules above carry a pseudo-class, so they out-rank `.btn-aw--outline` and paint the
       text white on the white face (an empty-looking box, e.g. the trust books "All accounts"
       link). Restate the outline colors at the same specificity, after them, so they win. */
    .btn-aw--outline:link,
    .btn-aw--outline:visited,
    .btn-aw--outline:focus {
        color: var(--aw-teal-700, #1A4E63) !important;
    }

    .btn-aw--outline:hover,
    .btn-aw--outline:active {
        background: var(--aw-teal-700, #1A4E63);
        color: #fff !important;
    }

/* Inert look for a button rendered without a usable target (no map location, etc.). */
.btn-aw--disabled {
    background: #adb5bd;
    cursor: not-allowed;
    pointer-events: none;
}

/* Legacy spelling used by the delivery, workbench and K-1 screens
   (btn btn-aw-primary / btn btn-aw-secondary): map onto the standard silhouette
   so every screen shares one button style. */
.btn.btn-aw-primary,
.btn.btn-aw-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--aw-btn-gap);
    min-height: var(--aw-btn-height);
    padding: 0 var(--aw-btn-pad-x);
    border-radius: var(--aw-btn-radius);
    border: 1px solid transparent;
    font-family: var(--aw-font-sans);
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1;
    color: #fff !important;
    box-shadow: 0 1px 2px rgba(0,0,0,.05);
    text-decoration: none !important;
}

.btn.btn-aw-primary {
    background: var(--aw-teal-700, #1A4E63);
}

    .btn.btn-aw-primary:hover {
        background: var(--aw-teal-800, #153F50);
    }

.btn.btn-aw-secondary {
    background: #4A5D6E;
}

    .btn.btn-aw-secondary:hover {
        background: #3C4D5C;
    }

/* States */
.btn-aw:hover {
    opacity: .95;
}

.btn-aw:active {
    transform: translateY(1px);
}

.btn-aw:disabled,
.btn-aw[disabled] {
    opacity: .6;
    cursor: not-allowed;
}

/* Focus ring: visible on both light/dark */
.btn-aw:focus-visible {
    outline: 2px solid rgba(255,255,255,.75);
    outline-offset: 2px;
}

/* Size helpers (optional) */
.btn-aw--sm {
    min-height: 38px;
    padding: 0 16px;
    border-radius: 6px;
}

.btn-aw--lg {
    min-height: 52px;
    padding: 0 26px;
    border-radius: 8px;
}

/* Icon-only square variant: pair with a size helper, put the label in title= */
.btn-aw--icon {
    min-width: 38px;
    padding: 0 11px;
}

/* Pressed/active state for icon-only toggle actions (e.g. the "Set Deposit
   Dates" selection-mode toggle on Revenue Statements). Toggled via JS with
   aria-pressed + this class together. */
.btn-aw--icon.is-active {
    background: var(--aw-teal-800, #153F50);
    box-shadow: inset 0 0 0 2px rgba(255,255,255,.35);
}

/* Bootstrap size variants */
/* --- Bootstrap mapping (optional, makes old markup look new) --- */ 
.btn.btn-success,
.btn.btn-secondary {
    /* adopt the new silhouette */
    height: var(--aw-btn-height);
    padding: 0 var(--aw-btn-pad-x);
    border-radius: var(--aw-btn-radius);
    border: var(--aw-btn-border);
    font-weight: 600;
    text-transform: none;
    color: var(--aw-btn-text);
}

    /* Override Bootstrap link hover states for mapped buttons */
    .btn.btn-success:hover,
    .btn.btn-success:focus,
    .btn.btn-secondary:hover,
    .btn.btn-secondary:focus {
        color: var(--aw-btn-text) !important;
    }

/* Map colors to tokens */
.btn.btn-success {
    background: var(--aw-green-500) !important;
    border-color: #fff !important;
}

.btn.btn-secondary {
    background: var(--aw-teal-700) !important;
    border-color: #fff !important;
}

/* Neutralize older layers that forced different looks inside .main-content */
.main-content .btn {
    text-transform: none;
}

/* ── View Switcher (v1/v2/v3 toggle on Tracts Details) ── */
.aw-view-switcher .btn {
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 4px 12px;
}
.aw-view-switcher .btn.active {
    background-color: var(--aw-heading, #06798C);
    border-color: var(--aw-heading, #06798C);
    color: #fff;
    pointer-events: none;
}
.aw-view-switcher .btn:not(.active):hover {
    background-color: #f0f4f5;
}


/* Ghost - quiet inline action on LIGHT surfaces (e.g. the fetch list's "scout"
   button). The .btn-aw base assumes a FILLED variant: it forces white text on
   every link state, so an undefined ghost variant rendered white-on-white.
   Doubled class (.btn-aw.btn-aw-ghost) out-ranks the base's state overrides
   regardless of stylesheet load order. */
.btn-aw.btn-aw-ghost,
.btn-aw.btn-aw--ghost {
    background: transparent;
    border-color: var(--gray3, #CBD5E1);
    color: var(--gray6, #334155) !important;
    box-shadow: none;
}

    .btn-aw.btn-aw-ghost:link,
    .btn-aw.btn-aw-ghost:visited,
    .btn-aw.btn-aw-ghost:focus,
    .btn-aw.btn-aw--ghost:link,
    .btn-aw.btn-aw--ghost:visited,
    .btn-aw.btn-aw--ghost:focus {
        color: var(--gray6, #334155) !important;
    }

    .btn-aw.btn-aw-ghost:hover,
    .btn-aw.btn-aw-ghost:active,
    .btn-aw.btn-aw--ghost:hover,
    .btn-aw.btn-aw--ghost:active {
        background: var(--gray1, #F1F5F9);
        border-color: var(--gray4, #94A3B8);
        color: var(--gray7, #1E293B) !important;
    }

    .btn-aw.btn-aw-ghost:disabled,
    .btn-aw.btn-aw--ghost:disabled {
        opacity: .55;
    }
