/* Public form theme. Loaded only by _Layout (never the staff portal) after site.css, so the
   framed form matches the Simplicity CMS page around it (simplicity.tol.ca): Open Sans body
   text at 18px/28px in #1B1C1F, Montserrat 600 headings and #0E61A7 links and buttons.

   The fonts are self-hosted (SIL OFL 1.1, licences in wwwroot/fonts) rather than loaded from
   Google Fonts, so the form makes no third-party requests and needs no CSP font/style
   sources. They are variable fonts: one file covers every weight. */

@font-face {
    font-family: 'Open Sans';
    font-style: normal;
    font-weight: 300 800;
    font-stretch: 100%;
    font-display: swap;
    src: url('../fonts/open-sans-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Open Sans';
    font-style: normal;
    font-weight: 300 800;
    font-stretch: 100%;
    font-display: swap;
    src: url('../fonts/open-sans-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/montserrat-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/montserrat-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --cms-text: #1b1c1f;
    --cms-muted: #4a4d55;
    --cms-blue: #0e61a7;
    --cms-blue-dark: #0a4a80;
    --cms-border: #767676;
    --cms-error: #b02a37;
    --bs-body-color: var(--cms-text);
    --bs-link-color: var(--cms-blue);
    --bs-link-color-rgb: 14, 97, 167;
    --bs-link-hover-color: var(--cms-blue-dark);
    --bs-link-hover-color-rgb: 10, 74, 128;
}

/* site.css drops the root size to 14px on phones; the CMS keeps 16px inputs and 18px text at
   every width, and 16px inputs also stop iOS zooming the frame on focus. */
html {
    font-size: 16px;
}

html, body {
    font-family: 'Open Sans', Arial, sans-serif;
}

body {
    font-size: 1.125rem;
    line-height: 1.5556; /* 28px at 18px */
    color: var(--cms-text);
    background: #fff;
}

h1, h2, h3, h4, legend.form-section-title, .error-summary-title {
    font-family: Montserrat, 'Open Sans', Arial, sans-serif;
    font-weight: 600;
    color: var(--cms-text);
}

a, .btn-link {
    color: var(--cms-blue);
}

a:hover, .btn-link:hover {
    color: var(--cms-blue-dark);
}

/* Section headings match the CMS h3 (24px/30px). */
.form-section-title {
    font-size: 1.5rem;
    line-height: 1.25;
    border-bottom-color: #d4d6db;
}

.form-label,
fieldset.form-field > legend {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: .375rem;
}

.field-flag,
.quick-picks-label,
.collection-notice {
    color: var(--cms-muted);
}

.form-text {
    color: var(--cms-muted);
    font-size: .9375rem;
}

/* Field borders need 3:1 contrast against white (WCAG 1.4.11); Bootstrap's default grey is
   too faint. */
.form-control,
.form-select {
    font-size: 1rem;
    line-height: 1.5;
    color: var(--cms-text);
    border-color: var(--cms-border);
    border-radius: 4px;
    padding: .5rem .75rem;
}

.form-select {
    padding-right: 2.25rem;
}

/* Date and time sit side by side when both fit ("No specific time" in full) and stack in the
   narrow frames the CMS gives the form on phones (about 270px wide). */
.deadline-fields > .col-6 {
    flex: 1 0 10.25rem;
    width: auto;
    max-width: 100%;
}

#DeadlineTime {
    padding-left: .625rem;
    padding-right: 2rem;
    background-position: right .5rem center;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus,
.btn:focus,
.btn:active:focus {
    border-color: var(--cms-blue);
    box-shadow: 0 0 0 .1rem #fff, 0 0 0 .25rem var(--cms-blue);
}

.btn {
    font-weight: 700;
    border-radius: 4px;
}

.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--cms-blue);
    --bs-btn-border-color: var(--cms-blue);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--cms-blue-dark);
    --bs-btn-hover-border-color: var(--cms-blue-dark);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--cms-blue-dark);
    --bs-btn-active-border-color: var(--cms-blue-dark);
    --bs-btn-disabled-bg: var(--cms-blue);
    --bs-btn-disabled-border-color: var(--cms-blue);
    color: #fff;
    background-color: var(--cms-blue);
    border-color: var(--cms-blue);
}

.btn-lg {
    font-size: 1.125rem;
    padding: .625rem 1.75rem;
}

/* Secondary buttons (deadline quick picks) use the CMS outline button: blue text, 2px border. */
.btn-outline-secondary {
    --bs-btn-color: var(--cms-blue);
    --bs-btn-border-color: var(--cms-blue);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--cms-blue);
    --bs-btn-hover-border-color: var(--cms-blue);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--cms-blue-dark);
    --bs-btn-active-border-color: var(--cms-blue-dark);
    border-width: 2px;
    background: #fff;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus-visible {
    background: var(--cms-blue);
}

.text-danger,
.field-validation-error {
    color: var(--cms-error) !important;
    font-size: .9375rem;
}

.alert-success {
    font-size: 1.125rem;
}
