/* SmartPay Branding Refresh */

::selection { background: Highlight; color: HighlightText; }
::-moz-selection { background: Highlight; color: HighlightText; }

body {
    font-family: helvetica, sans-serif;
    color: #323e48;
    background-color: #f4f4f4;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
body a { color: #323e48; }
body a:hover, body a:focus { color: #323e48; }
/* Links inside text blocks must be distinguishable without colour alone */
td a:not([class]), p a, .news a { text-decoration: underline; }

input[type=text], input[type=tel], input[type=password], input[type=number], select, textarea, div.richify, div.readonly_box {
    background-color: #f4f4f4;
    border: 1px solid #767676; /* WCAG 1.4.11: field boundary needs 3:1 against the page */
    color: #323e48;
    font-family: inherit;
    font-size: 16px; /* ADPROD-8038: same size as the current SmartPay 6 fields (css.min.css uses 16px) */
}
/* ADPROD-8041: dark grey highlighted option with white text in every browser (Chrome otherwise uses the system blue).
   #666 on white is 5.7:1. List boxes (multiple / size>1) are styled directly; drop-down lists use the
   customisable select (appearance: base-select, Chrome/Edge 135+) and fall back to the browser default elsewhere. */
select { accent-color: #666666; }
select[multiple] option:checked, select[size] option:checked {
    background-color: #666666;
    background-image: linear-gradient(#666666, #666666);
    color: #ffffff;
}
@supports (appearance: base-select) {
    select:not([multiple]):not([size]), select:not([multiple]):not([size])::picker(select) {
        appearance: base-select;
    }
    /* keep the text on the left and a small chevron on the right, on one line (base-select otherwise wraps the arrow) */
    select:not([multiple]):not([size]) {
        display: inline-flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
        gap: 6px;
        white-space: nowrap;
        overflow: hidden;
        box-sizing: border-box;
        min-width: 200px; /* fixed minimum */
    }
    
    select:not([multiple]):not([size]) selectedcontent {
        display: block;
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
    select:not([multiple]):not([size])::picker-icon {
        content: "";
        flex: 0 0 auto;
        width: 7px;
        height: 7px;
        margin: -4px 4px 0 auto;
        border-right: 2px solid #323e48;
        border-bottom: 2px solid #323e48;
        transform: rotate(45deg);
        transition: transform 150ms ease;
    }
    select:not([multiple]):not([size]):open::picker-icon { transform: rotate(-135deg); margin-top: 4px; }
    select:not([multiple]):not([size])::picker(select) {
        background-color: #f4f4f4;
        border: 1px solid #767676;
        padding: 0;
    }
    select:not([multiple]):not([size]) option {
        padding: 4px 8px;
        background-color: #f4f4f4;
        color: #323e48;
    }
    select:not([multiple]):not([size]) option:hover,
    select:not([multiple]):not([size]) option:focus,
    select:not([multiple]):not([size]) option:checked {
        background-color: #666666;
        color: #ffffff;
    }
    select:not([multiple]):not([size]) option::checkmark { display: none; }
}
/* ADPROD-8043: radio buttons follow the green theme instead of the system blue */
input[type=radio], input[type=range], progress { accent-color: #5a8a20; }

/* Text for screen readers only (e.g. labels for icon-only table header cells and checkboxes) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* WCAG 2.4.7 / 2.4.11: clearly visible keyboard focus (dark on light, >3:1) */
a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, [tabindex]:focus-visible {
    outline: 3px solid #323e48;
    outline-offset: 2px;
}
/* Form fields: no gap, just a darker 2px border (dark #323e48 is ~9.9:1 on the page) */
input:focus-visible, select:focus-visible, textarea:focus-visible {
    border-color: #323e48;
    outline: 1px solid #323e48;
    outline-offset: 0;
}

/* WCAG 2.5.8 (target size, AA): 24x24px minimum, as Recurring Payments already does */
input[type=radio] { width: 24px; height: 24px; margin: 2px; vertical-align: middle; cursor: pointer; }
input[type=checkbox] {
    height: 24px;
    width: 24px;
    appearance: none;
    -webkit-appearance: none;
    background-color: #ffffff;
    border: 1px solid #888888;
    cursor: pointer;
    vertical-align: middle;
    padding: 0;
    margin: 2px;
}
input[type=checkbox]:checked {
    background-color: #5a8a20;
    border-color: #5a8a20;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpolyline points='2,7 6,11 12,4' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: 100% 100%;
}
input[type=text]:disabled, input[type=password]:disabled, select:disabled, textarea:disabled {
    background-color: #dddddd;
    color: #323e48;
}

input[type=submit], input[type=button] {
    padding: 5px 15px;
    background-color: #ffffff;
    color: #323e48;
    border: 2px solid #5a8a20;
    -webkit-border-radius: 50px;
    border-radius: 50px;
    width: 130px;
    -webkit-appearance: none;
    font-family: inherit;
}
td.grid_button { width: 130px; }
input[type=submit]:hover, input[type=button]:hover,
input[type=submit]:active, input[type=button]:active,
input[type=submit]:focus, input[type=button]:focus {
    cursor: pointer;
    background-color: #323e48;
    color: #f4f4f4; /* green #77b32a on #323e48 is only 4.3:1 (needs 4.5:1) */
    border-color: #323e48;
}
input[type=submit][disabled=disabled] {
    color: #ffffff;
    background: #ccc;
    border-color: #ccc;
    cursor: default;
}

.menu {
    font-size: large;
    font-family: helvetica, sans-serif;
    color: #323e48;
    background-color: #f4f4f4;
    border-bottom: 2px solid #77b32a;
    border-top: 2px solid #77b32a;
    padding: 5px;
    margin: 5px;
    overflow: visible;
}
.menu::after {
    content: "";
    display: table;
    clear: both;
}
.menu_link {
    padding: 4px 6px;
    display: inline-block;
    line-height: 16px;
    min-height: 24px;
}
.menu > a { color: #323e48; }
.menu > span { color: #323e48; }
.menu > div > div:first-of-type { color: #323e48; }
.menu > a:hover, .menu > a:focus { background-color: #ddd; color: #323e48; }
/* ADPROD-8044: Log Out gets the same padding (and so the same hover area) as the other top-level menu items */
#divUserFunctions > a.menu_link { padding: 16px; }
#divUserFunctions > a.menu_link:hover, #divUserFunctions > a.menu_link:focus { background-color: #ddd; color: #323e48; }
.menu > div:hover > div:first-of-type,
.menu > div:focus-within > div:first-of-type { background-color: #ddd; color: #323e48; }
#divUserFunctions:hover > div,
#divUserFunctions:focus-within > div { background-color: transparent; cursor: default; }

/* Dropdown panel — always rendered, shown/hidden via opacity+visibility so CSS transitions work */
.menu > div > div:nth-of-type(1n+2) {
    display: block;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 150ms ease, transform 150ms ease, visibility 0ms linear 150ms;
    background-color: #f4f4f4;
    border: none;
    border-top: 3px solid #77b32a;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    z-index: 1000;
}
.menu > div:hover > div:nth-of-type(1n+2),
.menu > div:focus-within > div:nth-of-type(1n+2) {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    transition: opacity 150ms ease, transform 150ms ease, visibility 0ms linear 0ms;
}

/* Dropdown items — dark blue fill + white text on hover, like Go2Pay */
.menu > div > div:nth-of-type(1n+2) a {
    color: #323e48;
    border-left: 3px solid transparent;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.menu > div > div:nth-of-type(1n+2) a:hover,
.menu > div > div:nth-of-type(1n+2) a:focus {
    background-color: #323e48;
    border-left-color: #77b32a;
    color: #f4f4f4;
}

/* Council/org name in header centre */
.app_council_name {
    margin: 0; /* now an <h1> (axe: page needs a level-one heading) - keep the old look */
    font-weight: normal;
    font-family: helvetica, sans-serif;
    font-size: 1.85em;
    color: #323e48;
    text-align: center;
    line-height: 1.2;
}

/* Links in text blocks — no underline by default, green on hover */
td a:not([class]), p a, .news a { text-decoration: none; }
td a:not([class]):hover, td a:not([class]):focus,
p a:hover, p a:focus,
.news a:hover, .news a:focus { color: #3f6b12; text-decoration: underline; }
/* Home page news is HTML from the Settings table; its links come through white on the light page (unreadable).
   Force a readable, underlined link (#3f6b12 is ~5.7:1 on #f4f4f4) - !important because the news HTML can carry inline colours. */
.news a, .news a:visited, div.richify a, div.richify a:visited { color: #3f6b12 !important; text-decoration: underline !important; }
/* The "YOUR SAY" / "NOW AVAILABLE" pills are inline-styled white on #77b32a (~2.5:1). Darken the fill so the white text is ~6.3:1.
   div.richify is the News editor on Settings Edit, which shows the same markup (axe: 4 contrast failures there). */
.news span[style*="border-radius: 20px"], div.richify span[style*="border-radius: 20px"] { background: #3f6b12 !important; color: #ffffff !important; }

.form_td_label { color: #323e48; }

.grid_table, .form_table, .mini_form, .midi_form {
    border: 3px solid #77b32a;
    -webkit-border-radius: 15px;
    -moz-border-radius: 15px;
    border-radius: 15px;
    border-spacing: 5px;
    box-shadow: -1px 1px #FFFFFF;
    color: #323e48;
    background-color: #f4f4f4;
}
/* ADPROD-8039: data grids get a thin border so they don't stand out; forms keep the brand border */
.grid_table { border-width: 1px; border-color: #5a8a20; }
/* ADPROD-8039: breakdown grids with no title (Title="NULL", e.g. payment lines) lose the green box altogether */
.grid_table.untitled_table { border: none; border-radius: 0; box-shadow: none; }
/* ADPROD-8039: the selected payment line is flagged in code with an inline yellow (#fff2ac, shared C# across customers);
   restyle it as a soft green tint that sits with the brand colours - dark text on it is ~10:1 and the green hover text on it ~4.7:1 */
.grid_data_tr[style*="fff2ac"] { background-color: #eef5e3 !important; }
/* Remove white background on table headers */
th { background-color: #f4f4f4 !important; }

/* Filter/action dropdowns — brand background only */
select.action, select[id$="Filter"] {
    background-color: #f4f4f4;
}

.grid_data_tr td, .grid_data_tr td a { color: #323e48; }
/* ADPROD-8040: row text (and links) turn green on hover / keyboard focus on every grid, no background change.
   #3a7a10 is ~4.8:1 on the #f4f4f4 page (the brightest green that still passes WCAG 1.4.3; Recurring's #77b32a is only ~2.3:1).
   No underline here: hover colour is not required information, so 1.4.1 doesn't ask for one on grid rows. */
.grid_data_tr:hover td, .grid_data_tr:hover td a,
.grid_data_tr:focus-within td, .grid_data_tr:focus-within td a { color: #3a7a10; text-decoration: none !important; }
.grid_th { color: #323e48; font-weight: bold; }
/* WCAG 2.5.8: links in grid rows, headers and the pager must be at least 24px high/wide (axe found 302 of 12px-high date links etc.) */
.grid_data_tr td a, .grid_th a, .grid_prev_next a, .grid_prev_next_disabled a {
    display: inline-block;
    box-sizing: border-box;
    min-height: 24px;
    min-width: 24px;
    line-height: 24px;
}
/* WCAG 2.5.8 (found by axe on the test site): small links and icons that sit outside the standard grid classes */
table.imports a,
td.buttons a { display: inline-block; box-sizing: border-box; min-width: 24px; min-height: 24px; line-height: 24px; text-align: center; }
/* Confirmed by axe element locations: Report Edit row buttons (#body_rptFields_btnUp_0 etc.) and the News editor toolbar (button[title], built by jquery.richify.js) */
a[id*="_btnDelete"], a[id*="_btnAdd"], a[id*="_btnUp"], a[id*="_btnDown"] { display: inline-block; box-sizing: border-box; min-width: 24px; min-height: 24px; line-height: 24px; text-align: center; }
button[title][style*="monospace"] { min-width: 24px; min-height: 24px; margin: 1px; }
img[alt="Help"] { padding: 4px; box-sizing: content-box; }
.ui-datepicker td a, .ui-datepicker td span { box-sizing: border-box; min-width: 24px; min-height: 24px; line-height: 20px; }
/* WCAG 1.4.3: the notification banner colours are set inline by WfPage and miss 4.5:1 (alert 2.5:1, success 3.6:1, info 3.3:1).
   Darker text on the same background; the warning banner (#b00000, 5.7:1) already passes. */
div[role="alert"][style*="c77405"] { color: #6b3f00 !important; }
div[role="alert"][style*="468847"] { color: #2d5a2e !important; }
div[role="alert"][style*="3a87ad"] { color: #1f5b78 !important; }
.grid_title, .form_title, .form_group_title {
    font-family: helvetica, sans-serif;
    border-radius: 5px;
    padding-top: 5px;
    padding-bottom: 5px;
}
.grid_title, .form_title { background: #323e48; color: #f4f4f4; }
.form_group_title { background: #323e48; color: #f4f4f4; }
.form_group_collapse { color: #f4f4f4; }
.grid_rowcount, .grid_prev_next { color: #323e48; font-style: italic; }
.grid_prev_next_disabled { color: #636363; }
.grid_date_filter { font-size: small; width: initial; margin-left: 2px; }
.app_title { color: #323e48; font-size: x-large; }
.app_welcome { font-family: helvetica, sans-serif; color: #323e48; font-size: x-large; }
/* WCAG 1.4.1: invalid fields are flagged by more than colour - a dark red 2px border (#c00000 is ~5.5:1) as well as the tint */
.invalid { background-color: #ff8888; border: 2px solid #c00000 !important; }
.error_title { color: #323e48; }
.required { color: #c00000; }

div.select_list > div > div { background-color: #f4f4f4; }

/* jQuery UI dialog overrides */
.ui-widget-header {
    border: 1px solid #323e48;
    background: #323e48;
    color: #f4f4f4;
}
.ui-widget-header a { color: #f4f4f4; }
.ui-dialog .ui-dialog-titlebar-close,
.ui-dialog .ui-dialog-buttonpane button {
    background: #ffffff;
    border: 1px solid #cccccc;
    color: #323e48;
}
.ui-dialog .ui-dialog-titlebar-close:hover,
.ui-dialog .ui-dialog-buttonpane button:hover {
    background: #f4f4f4;
    border: 1px solid #5a8a20;
    color: #323e48;
}
.ui-dialog .ui-dialog-titlebar-close .ui-icon,
.ui-dialog .ui-dialog-titlebar-close:hover .ui-icon {
    background-image: url("images/ui-icons_222222_256x240.png");
}

@media (pointer:coarse) {
    #imgAppLogo, #divUserFunctions { display: none; }
    input[type=submit], input[type=button] {
        height: 44px;
        width: auto;
        margin: 1px;
        min-width: 66px;
    }
    .grid_table, .form_table, .mini_form, .midi_form {
        border: 1px solid #77b32a;
        background-color: #f4f4f4;
        width: 100%;
    }
    .menu { font-size: medium; }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0
}

