/*
 * What both layouts share: buttons, notices, tabs and a few utilities, in the settings
 * cards' blue. They replace jQuery UI's widgets and theme.
 */

/*
 * Buttons:
 *   mrd-button               the main action: Send, Sign in, Change Password
 *   mrd-button is-secondary  a lesser one: Show older activity
 *   mrd-button is-danger     a destructive one: Trash
 *   is-small                 inside a dense row, such as a record's comment box
 * A Font Awesome <i> before the label gets its own spacing.
 */
.mrd-button {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    display: inline-block;
    margin: 0;
    padding: 7px 14px;
    font-family: inherit;
    font-size: 12px;
    font-weight: bold;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
    color: #fff;
    background: #4161a8;
    border: 1px solid #4161a8;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.12s, border-color 0.12s, box-shadow 0.12s;
}

.mrd-button:hover {
    background: #34508c;
    border-color: #34508c;
}

.mrd-button:focus {
    outline: none;
}

.mrd-button:focus-visible {
    box-shadow: 0 0 0 3px rgba(65, 97, 168, 0.3);
}

.mrd-button i {
    margin-right: 6px;
}

.mrd-button.is-secondary {
    color: #4161a8;
    background: #fff;
    border-color: #C8CDD6;
}

.mrd-button.is-secondary:hover {
    background: #F3F6FC;
    border-color: #A9B8D6;
}

.mrd-button.is-danger {
    color: #A32727;
    background: #fff;
    border-color: #E3B9B9;
}

.mrd-button.is-danger:hover {
    background: #FDECEC;
    border-color: #D99595;
}

.mrd-button.is-danger:focus-visible {
    box-shadow: 0 0 0 3px rgba(163, 39, 39, 0.2);
}

.mrd-button.is-small {
    padding: 4px 10px;
    font-size: 11px;
}

.mrd-button:disabled,
.mrd-button:disabled:hover {
    cursor: default;
    opacity: 0.5;
}

.mrd-button:disabled:not(.is-secondary):not(.is-danger) {
    background: #4161a8;
    border-color: #4161a8;
}

.mrd-button.is-secondary:disabled,
.mrd-button.is-danger:disabled {
    background: #fff;
}

/*
 * Notices: a flash, the global message, the download page's "new records" note.
 *   notice is-info | is-error | is-warning, with a Font Awesome <i> before a <p>
 */
.notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 12px;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.4;
}

.notice > i {
    flex: none;
    margin-top: 2px;
}

.notice p {
    margin: 0;
    padding: 0;
}

.notice a {
    color: inherit;
    font-weight: 600;
}

.notice.is-info {
    background: #EEF3FC;
    border-color: #C5D0E6;
    color: #2B3A5C;
}

.notice.is-info > i {
    color: #4161a8;
}

.notice.is-error {
    background: #FDECEC;
    border-color: #F2C4C4;
    color: #A32727;
}

.notice.is-warning {
    background: #FFF6E5;
    border-color: #F3CF8A;
    color: #6B4A00;
}

.notice.is-warning > i {
    color: #C77C00;
}

/* in the main layout a flash sits between the header and the page, inside the grid's gutter */
.container_12 > .notice {
    margin: 0 10px 10px;
}

/*
 * Tabs (tabs.js): a box whose first list names its panels. The chosen tab is underlined in
 * the site's blue.
 */
.mrd-tabs {
    background: #fff;
    border: 1px solid #DDE2EA;
    border-radius: 6px;
}

ul.mrd-tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0 4px;
    margin: 0;
    padding: 0 12px;
    list-style: none;
    border-bottom: 1px solid #DDE2EA;
}

ul.mrd-tabs-nav li {
    margin: 0;
    padding: 0;
    min-width: 0;
}

ul.mrd-tabs-nav a {
    display: block;
    margin-bottom: -1px;
    padding: 12px 10px 10px;
    border-bottom: 2px solid transparent;
    color: #5B6B8C;
    font-weight: 600;
    text-decoration: none;
}

ul.mrd-tabs-nav a:hover {
    color: #2B3A5C;
    border-bottom-color: #C5D0E6;
}

ul.mrd-tabs-nav a:focus {
    outline: none;
}

ul.mrd-tabs-nav a:focus-visible {
    border-radius: 4px 4px 0 0;
    box-shadow: inset 0 0 0 2px rgba(65, 97, 168, 0.35);
}

ul.mrd-tabs-nav li.is-selected a {
    color: #4161a8;
    border-bottom-color: #4161a8;
    cursor: default;
}

.mrd-tabs-panel {
    padding: 14px 18px 18px;
    color: #444;
}

/* what jQuery UI's theme gave a panel's content, at no specificity so a page's own rules win:
   links in the text colour, and form controls in the page's font rather than the browser's */
:where(.mrd-tabs-panel) a {
    color: #444;
}

:where(.mrd-tabs) :where(input, select, textarea, button) {
    font-family: inherit;
    font-size: 1em;
}

/* a page's own display rule for a panel mustn't show it while another tab is chosen */
.mrd-tabs-panel[hidden] {
    display: none !important;
}

.mrd-tabs-loading {
    color: #5B6B8C;
}

/* utilities */
.is-hidden {
    display: none;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* a row or note that just changed, in place of jQuery UI's highlight effect */
@keyframes mrd-flash {
    from {
        background-color: #FDF5BD;
    }
}

.is-flashing {
    animation: mrd-flash 1s ease-out;
}

.is-flashing.is-slow {
    animation-duration: 3s;
}

/* the page while a change it can't take back is under way, such as trashing messages */
body.is-busy {
    cursor: progress;
}

body.is-busy .container_12 {
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 0.15s;
}
