/* ══════════════════════════════════════════════════════════════════════════
 * App typography (v15.222.0, 2026-11-13) — part 1: form fields.
 *
 * Every form field uses one font and one size. Vasu liked the input typography
 * on Wayfair's sign-in page; measured there 2026-11-13: Sofia Pro, 16px,
 * weight 400, line-height 24px, text #211e22, labels/placeholders #4d4a4f.
 * Sofia Pro is a licensed typeface, so Figtree (free, SIL Open Font License;
 * files in assets/vendor/fonts/figtree.css) is used instead — Vasu's pick as
 * the closest free match. DM Sans is the fallback.
 *
 * v15.224.0 (2026-11-15): the app font is now NUNITO (Google Fonts, SIL Open
 * Font License; assets/vendor/fonts/nunito.css, upright + italic). Vasu tried it
 * locally and asked for it on prod. Figtree stays loaded as the fallback, and
 * wherever this file says "Figtree" below, read "the app font".
 *
 * Loaded LAST in includes/header.php and includes/header-auth.php so it wins
 * over per-page styles. To change the field font or size, edit only the
 * variables below.
 * ══════════════════════════════════════════════════════════════════════════ */
:root {
    --ev-field-font: 'Nunito', 'Figtree', 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    --ev-field-size: 1rem;      /* 16px */
    --ev-field-weight: 400;
    --ev-field-line: 1.5;       /* 24px */
    --ev-field-color: #211e22;
    --ev-field-hint: #4d4a4f;
}

/* Text-entry controls: native inputs, selects, textareas, Bootstrap classes
 * (including the -sm / -lg variants), Tom Select, and editable regions. */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="hidden"]),
select,
textarea,
.form-control,
.form-control-sm,
.form-control-lg,
.form-select,
.form-select-sm,
.form-select-lg,
.ts-control,
.ts-control > input,
.ts-control > .item,
.ts-dropdown,
.ts-dropdown .option,
[contenteditable="true"]:not(.tox-edit-area__iframe) {
    font-family: var(--ev-field-font) !important;
    font-size: var(--ev-field-size) !important;
    font-weight: var(--ev-field-weight) !important;
    line-height: var(--ev-field-line) !important;
    letter-spacing: 0 !important;
}

/* Typed text colour (not placeholders, not disabled fields). */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not(:disabled),
select:not(:disabled),
textarea:not(:disabled),
.ts-control > .item {
    color: var(--ev-field-color);
}

/* Placeholders follow the same font and size, lighter. */
input::placeholder,
textarea::placeholder,
.ts-control > input::placeholder {
    font-family: var(--ev-field-font) !important;
    font-size: var(--ev-field-size) !important;
    font-weight: 400 !important;
    color: var(--ev-field-hint);
    opacity: 1;
}

/* 16px text needs a little more room than the compact "-sm" controls give it. */
.form-control-sm,
.form-select-sm {
    min-height: 38px;
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
}

/* ══════════════════════════════════════════════════════════════════════════
 * Part 2 — Figtree for the WHOLE app, not only fields.
 *
 * One override for every text element. (A first attempt re-declared "Nunito",
 * "Lato" etc. as @font-face aliases of the Figtree files; browsers kept the
 * original files for any family that already had real faces, so that was
 * dropped.) The app's own rules name ~250 font-family values across CSS, pages
 * and inline styles; !important here beats all of the stylesheet ones.
 *
 * Left alone on purpose:
 *   - icon fonts (<i>, .bx…) and the TinyMCE toolbar (.tox)
 *   - code / monospace
 *   - anything with an INLINE font-family and everything inside it — that is how
 *     typed e-signatures pick their handwriting font
 *   - generated PDFs and emails (they never load this file)
 * Cleaner long-term: replace the family names in the stylesheets and drop this
 * override. Not covered: the support-agent portal (its own header) and the
 * standalone /testuserlogin page.
 * ══════════════════════════════════════════════════════════════════════════ */
:root {
    --ev-app-font: 'Nunito', 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    --bs-font-sans-serif: var(--ev-app-font);
    --bs-body-font-family: var(--ev-app-font);
}

/* The two :not(#…) parts match everything; they are there only to raise this
 * rule's weight above the handful of app rules written as "#id … !important"
 * (sidebar user name, the session-timeout banner). */
/* Keep this selector on ONE line: a line break between two :not() parts is a
 * descendant combinator in CSS and silently changes what it matches. */
body,
body *:not(#ev-trial-a):not(#ev-trial-b):not(i):not(.bx):not(.bxs):not(.bxl):not([class^="bx-"]):not([class*=" bx-"]):not(code):not(pre):not(samp):not(.font-monospace):not([class*="mono"]):not(.tox):not(.tox *):not([style*="font-family"]):not([style*="font-family"] *):not([class*="signature"]):not([class*="signature"] *) {
    font-family: var(--ev-app-font) !important;
}
