/*
 * SIQAT colour theme, layered over stock Bootstrap 5.3 (loaded from the CDN in base.html).
 *
 * Ported from the original Bootstrap 4 build of this theme: every colour below - including the
 * hover/active/focus shades and alert tints - is that build's own compiled value, so pages keep
 * the same look. Bootstrap 5 reads most colours from CSS variables, but several components
 * (buttons, pagination, accordion, focus rings, ...) compile their own copies of the stock blue
 * into component-level variables, so those are re-pointed individually here rather than
 * following --bs-primary automatically.
 */

:root {
    --bs-blue: #0d3b66;
    --bs-red: #c44546;
    --bs-yellow: #f4d35e;
    --bs-green: #588157;
    --bs-cyan: #63b3d1;

    --bs-primary: #0d3b66;
    --bs-secondary: #faf0ca;
    --bs-success: #588157;
    --bs-info: #63b3d1;
    --bs-warning: #f4d35e;
    --bs-danger: #c44546;
    --bs-light: #f8f9fa;
    --bs-dark: #330f0a;

    --bs-primary-rgb: 13, 59, 102;
    --bs-secondary-rgb: 250, 240, 202;
    --bs-success-rgb: 88, 129, 87;
    --bs-info-rgb: 99, 179, 209;
    --bs-warning-rgb: 244, 211, 94;
    --bs-danger-rgb: 196, 69, 70;
    --bs-light-rgb: 248, 249, 250;
    --bs-dark-rgb: 51, 15, 10;

    /* Alert tints (and the matching *-text-emphasis / *-bg-subtle / *-border-subtle helpers). */
    --bs-primary-text-emphasis: #071f35;
    --bs-primary-bg-subtle: #cfd8e0;
    --bs-primary-border-subtle: #bbc8d4;
    --bs-secondary-text-emphasis: #827d69;
    --bs-secondary-bg-subtle: #fefcf4;
    --bs-secondary-border-subtle: #fefbf0;
    --bs-success-text-emphasis: #2e432d;
    --bs-success-bg-subtle: #dee6dd;
    --bs-success-border-subtle: #d0dcd0;
    --bs-info-text-emphasis: #335d6d;
    --bs-info-bg-subtle: #e0f0f6;
    --bs-info-border-subtle: #d3eaf2;
    --bs-warning-text-emphasis: #7f6e31;
    --bs-warning-bg-subtle: #fdf6df;
    --bs-warning-border-subtle: #fcf3d2;
    --bs-danger-text-emphasis: #662424;
    --bs-danger-bg-subtle: #f3dada;
    --bs-danger-border-subtle: #eecbcb;
    --bs-dark-text-emphasis: #1b0805;
    --bs-dark-bg-subtle: #d6cfce;
    --bs-dark-border-subtle: #c6bcba;

    --bs-link-color: #0d3b66;
    --bs-link-color-rgb: 13, 59, 102;
    --bs-link-hover-color: #041422;
    --bs-link-hover-color-rgb: 4, 20, 34;

    --bs-focus-ring-color: rgba(13, 59, 102, 0.25);
}

/* ---- Buttons ---------------------------------------------------------------------------- */

.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: #0d3b66;
    --bs-btn-border-color: #0d3b66;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #092744;
    --bs-btn-hover-border-color: #072139;
    --bs-btn-focus-shadow-rgb: 49, 88, 125;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #072139;
    --bs-btn-active-border-color: #061a2d;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #0d3b66;
    --bs-btn-disabled-border-color: #0d3b66;
}

.btn-secondary {
    --bs-btn-color: #212529;
    --bs-btn-bg: #faf0ca;
    --bs-btn-border-color: #faf0ca;
    --bs-btn-hover-color: #212529;
    --bs-btn-hover-bg: #f7e6a7;
    --bs-btn-hover-border-color: #f6e39b;
    --bs-btn-focus-shadow-rgb: 217, 210, 178;
    --bs-btn-active-color: #212529;
    --bs-btn-active-bg: #f6e39b;
    --bs-btn-active-border-color: #f5e090;
    --bs-btn-disabled-color: #212529;
    --bs-btn-disabled-bg: #faf0ca;
    --bs-btn-disabled-border-color: #faf0ca;
}

.btn-success {
    --bs-btn-color: #fff;
    --bs-btn-bg: #588157;
    --bs-btn-border-color: #588157;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #486a48;
    --bs-btn-hover-border-color: #436342;
    --bs-btn-focus-shadow-rgb: 113, 148, 112;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #436342;
    --bs-btn-active-border-color: #3e5b3d;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #588157;
    --bs-btn-disabled-border-color: #588157;
}

.btn-info {
    --bs-btn-color: #212529;
    --bs-btn-bg: #63b3d1;
    --bs-btn-border-color: #63b3d1;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #45a5c8;
    --bs-btn-hover-border-color: #3ca0c5;
    --bs-btn-focus-shadow-rgb: 89, 158, 184;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #3ca0c5;
    --bs-btn-active-border-color: #3898bd;
    --bs-btn-disabled-color: #212529;
    --bs-btn-disabled-bg: #63b3d1;
    --bs-btn-disabled-border-color: #63b3d1;
}

.btn-warning {
    --bs-btn-color: #212529;
    --bs-btn-bg: #f4d35e;
    --bs-btn-border-color: #f4d35e;
    --bs-btn-hover-color: #212529;
    --bs-btn-hover-bg: #f2c93a;
    --bs-btn-hover-border-color: #f1c62e;
    --bs-btn-focus-shadow-rgb: 212, 185, 86;
    --bs-btn-active-color: #212529;
    --bs-btn-active-bg: #f1c62e;
    --bs-btn-active-border-color: #f0c322;
    --bs-btn-disabled-color: #212529;
    --bs-btn-disabled-bg: #f4d35e;
    --bs-btn-disabled-border-color: #f4d35e;
}

.btn-danger {
    --bs-btn-color: #fff;
    --bs-btn-bg: #c44546;
    --bs-btn-border-color: #c44546;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #ac3738;
    --bs-btn-hover-border-color: #a23434;
    --bs-btn-focus-shadow-rgb: 205, 97, 98;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #a23434;
    --bs-btn-active-border-color: #993031;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #c44546;
    --bs-btn-disabled-border-color: #c44546;
}

.btn-dark {
    --bs-btn-color: #fff;
    --bs-btn-bg: #330f0a;
    --bs-btn-border-color: #330f0a;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #130604;
    --bs-btn-hover-border-color: #080202;
    --bs-btn-focus-shadow-rgb: 82, 51, 47;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #080202;
    --bs-btn-active-border-color: #000;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #330f0a;
    --bs-btn-disabled-border-color: #330f0a;
}

/* Outline buttons: the variant colour as text/border, filling with it on hover. Note
   btn-outline-secondary is pale cream on white - the theme's secondary was never meant for
   outline use. */
.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-success,
.btn-outline-info,
.btn-outline-warning,
.btn-outline-danger,
.btn-outline-dark {
    --bs-btn-color: var(--siqat-outline);
    --bs-btn-border-color: var(--siqat-outline);
    --bs-btn-hover-color: var(--siqat-outline-contrast);
    --bs-btn-hover-bg: var(--siqat-outline);
    --bs-btn-hover-border-color: var(--siqat-outline);
    --bs-btn-active-color: var(--siqat-outline-contrast);
    --bs-btn-active-bg: var(--siqat-outline);
    --bs-btn-active-border-color: var(--siqat-outline);
    --bs-btn-disabled-color: var(--siqat-outline);
    --bs-btn-disabled-border-color: var(--siqat-outline);
}

.btn-outline-primary   { --siqat-outline: #0d3b66; --siqat-outline-contrast: #fff;    --bs-btn-focus-shadow-rgb: 13, 59, 102; }
.btn-outline-secondary { --siqat-outline: #faf0ca; --siqat-outline-contrast: #212529; --bs-btn-focus-shadow-rgb: 250, 240, 202; }
.btn-outline-success   { --siqat-outline: #588157; --siqat-outline-contrast: #fff;    --bs-btn-focus-shadow-rgb: 88, 129, 87; }
.btn-outline-info      { --siqat-outline: #63b3d1; --siqat-outline-contrast: #212529; --bs-btn-focus-shadow-rgb: 99, 179, 209; }
.btn-outline-warning   { --siqat-outline: #f4d35e; --siqat-outline-contrast: #212529; --bs-btn-focus-shadow-rgb: 244, 211, 94; }
.btn-outline-danger    { --siqat-outline: #c44546; --siqat-outline-contrast: #fff;    --bs-btn-focus-shadow-rgb: 196, 69, 70; }
.btn-outline-dark      { --siqat-outline: #330f0a; --siqat-outline-contrast: #fff;    --bs-btn-focus-shadow-rgb: 51, 15, 10; }

/* Stock Bootstrap 5 puts white text on .text-bg-secondary - unreadable on the theme's cream. */
.text-bg-secondary {
    color: #212529 !important;
}

/* ---- Forms ------------------------------------------------------------------------------ */

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: #1b7cd7;
    box-shadow: 0 0 0 0.25rem rgba(13, 59, 102, 0.25);
}

.form-check-input:checked {
    background-color: #0d3b66;
    border-color: #0d3b66;
}

.form-check-input[type="checkbox"]:indeterminate {
    background-color: #0d3b66;
    border-color: #0d3b66;
}

.form-switch .form-check-input:focus {
    --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%231b7cd7'/%3e%3c/svg%3e");
}

/* ---- Components ------------------------------------------------------------------------- */

.progress,
.progress-stacked {
    --bs-progress-bar-bg: #0d3b66;
}

.nav-pills {
    --bs-nav-pills-link-active-bg: #0d3b66;
}

.list-group {
    --bs-list-group-active-bg: #0d3b66;
    --bs-list-group-active-border-color: #0d3b66;
}

.dropdown-menu {
    --bs-dropdown-link-active-bg: #0d3b66;
}

.pagination {
    --bs-pagination-color: #0d3b66;
    --bs-pagination-hover-color: #041422;
    --bs-pagination-focus-color: #041422;
    --bs-pagination-focus-box-shadow: 0 0 0 0.25rem rgba(13, 59, 102, 0.25);
    --bs-pagination-active-bg: #0d3b66;
    --bs-pagination-active-border-color: #0d3b66;
}

.accordion {
    --bs-accordion-active-color: #071f35;
    --bs-accordion-active-bg: #cfd8e0;
    --bs-accordion-btn-focus-border-color: #1b7cd7;
    --bs-accordion-btn-focus-box-shadow: 0 0 0 0.25rem rgba(13, 59, 102, 0.25);
    --bs-accordion-btn-active-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23071f35'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}
