/* St. John MBC Funds Requisitions
   Brand tokens are taken from https://www.stjohnokc.org/ (docs/frontend.md, Layout and branding). */

@font-face { font-family: "Oswald"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/oswald-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Oswald"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/oswald-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/poppins-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/poppins-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/poppins-latin-600-normal.woff2") format("woff2"); }

:root {
    --brand-navy: #06123A;
    --brand-blue: #0B2473;
    --brand-cream: #F7F2EC;
    --brand-orange: #E6512D;        /* decorative / large text only */
    --brand-orange-dark: #C94001;   /* accessible accent with white text */
    --brand-mist: #DFE6E9;
    --brand-peach: #FFBFA1;

    --text: #1B1E2B;
    --text-muted: #4A5065;
    --surface: #FFFFFF;
    --border: #D5D9E0;

    --font-heading: "Oswald", Arial, Helvetica, sans-serif;
    --font-body: "Poppins", Arial, Helvetica, sans-serif;

    --radius: 10px;
    --gutter: 16px;
    --max-width: 1100px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--brand-cream);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.55;
}

h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--brand-blue);
    line-height: 1.2;
    margin: 0 0 .5em;
}
h1 { font-size: 2rem; text-transform: uppercase; letter-spacing: .02em; }
h2 { font-size: 1.4rem; }

a { color: var(--brand-blue); }
a:hover { color: var(--brand-navy); }

:focus-visible {
    outline: 3px solid var(--brand-blue);
    outline-offset: 2px;
}

code { font-size: .9em; }

.skip-link {
    position: absolute;
    left: var(--gutter);
    top: -3rem;
    padding: .5rem 1rem;
    background: var(--surface);
    color: var(--brand-navy);
    border-radius: var(--radius);
    z-index: 10;
}
.skip-link:focus { top: .5rem; }

/* Header: navy bar with the off-white crest, as on the church website. */
.site-header {
    background: var(--brand-navy);
    color: var(--brand-cream);
    border-bottom: 1px solid rgba(223, 230, 233, .25);
}
.site-header__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: .75rem var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: var(--brand-cream);
    text-decoration: none;
}
.brand:hover { color: #FFFFFF; }
.brand__logo { display: block; width: 56px; height: 56px; }
.brand__text { display: flex; flex-direction: column; }
.brand__short {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1.75rem;
    line-height: 1;
    letter-spacing: .02em;
}
.brand__name {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--brand-mist);
    margin-top: .3rem;
}
.site-main {
    flex: 1;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem var(--gutter);
}

.site-footer {
    background: var(--brand-navy);
    color: var(--brand-mist);
    text-align: center;
    padding: 1.25rem var(--gutter);
    font-size: .875rem;
}
.site-footer p { margin: .15rem 0; }
.site-footer strong { color: var(--brand-cream); font-weight: 600; }

/* Building blocks */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.card--narrow { max-width: 640px; margin: 0 auto; }

.eyebrow {
    margin: 0 0 .25rem;
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--brand-orange-dark);
}

.muted { color: var(--text-muted); }
.small { font-size: .85rem; }

.button {
    display: inline-block;
    padding: .65rem 1.25rem;
    /* Same width as .button--secondary's border, so filled and outlined buttons are the same height side by side. */
    border: 2px solid transparent;
    border-radius: 999px;
    background: var(--brand-blue);
    color: #FFFFFF;
    font: 500 1rem var(--font-body);
    text-decoration: none;
    cursor: pointer;
}
.button:hover { background: var(--brand-navy); color: #FFFFFF; }

/* "Not fully approved by Sunday" notice from the paper form. */
.banner {
    margin: 1rem 0 0;
    padding: .75rem 1rem;
    border-left: 4px solid var(--brand-orange-dark);
    background: var(--brand-cream);
    font-weight: 500;
}

/* Signed-in user area in the header, and the main navigation bar. */
.site-header__user {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .25rem 1rem;
    font-size: .9rem;
    color: var(--brand-mist);
}
.site-header__user .user-name { color: var(--brand-cream); font-weight: 600; }
.site-header__user .inline-form { margin: 0; }
.site-header__user a,
.link-button {
    color: var(--brand-cream);
    text-decoration: underline;
}
.link-button {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    cursor: pointer;
}
.site-nav { background: var(--brand-blue); }
.site-nav__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--gutter);
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
}
.site-nav a {
    display: inline-block;
    padding: .6rem 0;
    color: #FFFFFF;
    text-decoration: none;
    font-weight: 500;
}
.site-nav a:hover { text-decoration: underline; }
.site-nav :focus-visible,
.site-header :focus-visible { outline-color: var(--brand-cream); }

/* Forms */
.field { margin: 0 0 1rem; }
.field label {
    display: block;
    margin-bottom: .3rem;
    font-weight: 600;
}
/* Text-like inputs only: checkboxes and radios keep their natural size (see below). */
.field input:not([type="checkbox"]):not([type="radio"]) {
    display: block;
    width: 100%;
    max-width: 28rem;
    padding: .6rem .75rem;
    border: 1px solid #8A90A2;
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
}
.field input:not([type="checkbox"]):not([type="radio"]):focus-visible { border-color: var(--brand-blue); }
.field input[type="checkbox"], .field input[type="radio"] { flex: none; margin: 0; }
.field .input-validation-error { border-color: var(--brand-orange-dark); border-width: 2px; }
.hint { display: block; margin-top: .25rem; font-size: .85rem; color: var(--text-muted); }
.field-error { display: block; margin-top: .25rem; font-size: .9rem; color: var(--brand-orange-dark); font-weight: 500; }
.field-error:empty, .field-validation-valid { display: none; }

.actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.25rem;
}
.inline-form { display: inline-block; margin: 0 .5rem .5rem 0; }
/* In an action row the flex gap does the spacing, so a button wrapped in a form lines up with the links beside it. */
.actions .inline-form { margin: 0; }

.button--secondary {
    background: var(--surface);
    color: var(--brand-blue);
    border: 2px solid var(--brand-blue);
}
.button--secondary:hover { background: var(--brand-cream); color: var(--brand-navy); }

/* Alerts: an icon-free left bar plus text, so meaning never depends on color alone. */
.alert {
    margin: 0 0 1rem;
    padding: .75rem 1rem;
    border-left: 4px solid var(--brand-blue);
    background: var(--brand-cream);
}
.alert ul { margin: 0; padding-left: 1.2rem; }
.alert--error { border-left-color: var(--brand-orange-dark); background: #FFF1EB; }
.alert--warning { border-left-color: var(--brand-orange-dark); }
.alert--success { border-left-color: #1D6B3A; background: #EEF7F1; }
.validation-summary-valid { display: none; }

.badge {
    display: inline-block;
    padding: .15rem .6rem;
    border-radius: 999px;
    background: var(--brand-mist);
    color: var(--text);
    font-size: .85rem;
    font-weight: 600;
    white-space: nowrap;
}
.badge--ok { background: #1D6B3A; color: #FFFFFF; }

/* Account pages */
.subnav {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.25rem;
    margin: 0 0 1.25rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border);
}
.subnav a[aria-current="page"] { font-weight: 600; color: var(--brand-navy); text-decoration: none; }
.details { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin: 0 0 1rem; }
.details dt { font-weight: 600; }
.details dd { margin: 0; overflow-wrap: anywhere; }
.steps { padding-left: 1.2rem; }
.steps li { margin-bottom: .75rem; }
.qr { display: block; margin: .75rem 0; border: 1px solid var(--border); background: #FFFFFF; }
.key { font-size: 1rem; letter-spacing: .05em; }
.codes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    gap: .5rem;
    padding: 0;
    list-style: none;
}
.codes code { font-size: 1rem; }

/* Admin lists and forms */
.card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1rem;
}
.card__header h1 { margin: 0; }
.filters {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: .75rem 1rem;
    margin: 0 0 1rem;
}
.field--inline { margin: 0; }
.field--inline input, .field select {
    padding: .5rem .6rem;
    border: 1px solid #8A90A2;
    border-radius: 6px;
    background: var(--surface);
    font: inherit;
}
.field--check { display: flex; align-items: flex-start; gap: .5rem; }
.field--check input[type="checkbox"] { margin-top: .35rem; }
.field--check label { margin: 0; }
fieldset.field { border: 0; padding: 0; }
fieldset.field legend { font-weight: 600; margin-bottom: .3rem; }
.checklist {
    list-style: none;
    padding: 0;
    margin: .5rem 0 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: .4rem 1rem;
}
.checklist li { display: flex; align-items: flex-start; gap: .5rem; }
.checklist input[type="checkbox"] { margin-top: .3rem; }
.checklist label { font-weight: 400; margin: 0; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-weight: 600; color: var(--brand-navy); background: var(--brand-cream); }
.block { display: block; }
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
.badge--warning { background: #FFF1EB; color: #8A2C00; border: 1px solid var(--brand-orange-dark); }
.link-button--dark { color: var(--brand-blue); }
.actions--wrap { margin: 1rem 0 1.5rem; }
.history { padding-left: 1.2rem; }
.history li { margin-bottom: .3rem; }

/* Requisitions: status badges carry an icon and text as well as color. */
.status {
    display: inline-block;
    padding: .2rem .65rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: .85rem;
    font-weight: 600;
    white-space: nowrap;
}
.status--draft { background: var(--brand-mist); color: var(--text); }
.status--pending { background: #E8ECF7; color: var(--brand-blue); border-color: var(--brand-blue); }
.status--returned { background: #FFF1EB; color: #8A2C00; border-color: var(--brand-orange-dark); }
.status--ok { background: #1D6B3A; color: #FFFFFF; }
.status--closed { background: #FFFFFF; color: var(--text); border-color: #8A90A2; }

.button--danger { background: #8A2C00; }
.button--danger:hover { background: #5E1E00; }
.nav-count {
    display: inline-block;
    min-width: 1.4rem;
    margin-left: .35rem;
    padding: 0 .4rem;
    border-radius: 999px;
    background: var(--brand-cream);
    color: var(--brand-navy);
    font-size: .8rem;
    font-weight: 700;
    text-align: center;
}
.count { color: var(--text-muted); font-size: 1rem; }
.dashboard { display: grid; gap: 1rem; margin-top: 1rem; }
.details--summary { margin-bottom: 1.25rem; }
.pager { display: flex; gap: 1rem; align-items: center; margin-top: 1rem; }
.filters--wrap .field--inline input { max-width: 12rem; }
blockquote { margin: .5rem 0; padding: .25rem .75rem; border-left: 3px solid var(--border); }

/* The request form */
.form-section {
    margin: 0 0 1.5rem;
    padding: 1rem 1rem .25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}
.form-section > legend {
    padding: 0 .35rem;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--brand-blue);
    text-transform: uppercase;
}
.field textarea, .field select {
    display: block;
    width: 100%;
    max-width: 40rem;
    padding: .6rem .75rem;
    border: 1px solid #8A90A2;
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
}
.field select { max-width: 28rem; }
.field-row { display: flex; flex-wrap: wrap; gap: 0 1rem; }
.field-row .field { flex: 1 1 12rem; }
.field-row .field--short { flex: 0 1 8rem; }
.choices { list-style: none; padding: 0; margin: .25rem 0 0; display: grid; gap: .35rem; }
.choices--inline { display: flex; flex-wrap: wrap; gap: .35rem 1.5rem; }
.choices li { display: flex; align-items: center; gap: .5rem; }
.choices label { font-weight: 400; margin: 0; }
.line-items input { width: 100%; min-width: 5rem; padding: .45rem .5rem; border: 1px solid #8A90A2; border-radius: 6px; font: inherit; }
.line-items tfoot th, .line-items tfoot td { font-weight: 700; }
.files { padding-left: 1.2rem; }
.files li { margin-bottom: .35rem; }
/* The request form's action bar: the card's own footer, edge to edge, kept in view while scrolling. */
.actions--sticky {
    position: sticky;
    bottom: 0;
    z-index: 1;
    margin: 1.25rem -1.5rem -1.5rem;
    padding: .75rem 1.5rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 -4px 12px rgba(6, 18, 58, .08);
}

/* Flagged fields: outline, peach background and the ⚑ note, so they never rely on color alone. */
.field--flagged, .form-section--flagged, .dd--flagged, .row--flagged td {
    background: #FFF4EE;
}
.field--flagged { padding: .5rem .75rem; border-left: 4px solid var(--brand-orange-dark); }
.form-section--flagged { border-color: var(--brand-orange-dark); }
.flag-note { display: block; margin: .35rem 0 0; color: #8A2C00; font-size: .9rem; }
.changed {
    display: inline-block;
    padding: 0 .45rem;
    border: 1px solid var(--brand-blue);
    border-radius: 4px;
    color: var(--brand-blue);
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
}
.row--due td:first-child { border-left: 4px solid var(--brand-orange-dark); }

/* Review panel */
.review { margin: 1.5rem 0; padding: 1rem; border: 2px solid var(--brand-blue); border-radius: var(--radius); }
.review h2 { margin-top: 0; }
.panel { margin: 0 0 .75rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.panel > summary { padding: .75rem 1rem; font-weight: 600; cursor: pointer; color: var(--brand-blue); }
.panel > form { padding: 0 1rem 1rem; }
.flag-picker { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .35rem; }
.flag-pick { display: grid; grid-template-columns: auto 1fr; gap: .25rem .5rem; align-items: center; }
.flag-pick > label { font-weight: 400; margin: 0; }
.flag-pick__note { display: none; grid-column: 2; }
.flag-pick input[type="checkbox"]:checked ~ .flag-pick__note { display: block; }
.flag-pick__note textarea { width: 100%; max-width: 40rem; padding: .5rem; border: 1px solid #8A90A2; border-radius: 6px; font: inherit; }
.signatures dd { margin-bottom: .5rem; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 3px solid var(--brand-mist); }
.timeline > li { padding: 0 0 .75rem 1rem; }
.timeline p { margin: 0; }

.tabs { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0 0 1rem; border-bottom: 2px solid var(--border); }
.tabs__tab { padding: .5rem .75rem; border: 1px solid transparent; border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; text-decoration: none; }
.tabs__tab[aria-current="page"] { border-color: var(--border); background: var(--surface); font-weight: 600; color: var(--brand-navy); margin-bottom: -2px; border-bottom: 2px solid var(--surface); }

/* Print view: the paper form's layout, on white. */
.print-body { background: #FFFFFF; color: #000000; }
.print-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; max-width: 52rem; margin: 1rem auto; padding: 0 1rem; }
.print-sheet { max-width: 52rem; margin: 0 auto 2rem; padding: 1rem; }
.print-letterhead { display: flex; align-items: center; gap: 1rem; border-bottom: 2px solid #000000; padding-bottom: .75rem; }
.print-letterhead p { margin: 0; }
.print-letterhead__name { font-family: var(--font-heading, inherit); font-size: 1.4rem; font-weight: 700; text-transform: uppercase; }
.print-title { margin: 1rem 0 .25rem; font-size: 1.5rem; text-align: center; text-transform: uppercase; letter-spacing: .05em; color: #000000; }
.print-intro { margin: 0 0 1rem; text-align: center; font-style: italic; }
.print-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.5rem; margin: 0 0 1rem; }
.print-grid > div { padding: .35rem 0; border-bottom: 1px solid #555555; }
.print-grid__wide { grid-column: 1 / -1; }
.print-grid dt { font-size: .75rem; font-weight: 700; text-transform: uppercase; }
.print-grid dd { margin: .1rem 0 0; min-height: 1.3em; overflow-wrap: anywhere; }
.print-multiline { white-space: pre-line; }
.print-choice { display: inline-block; margin-right: 1.25rem; }
.print-banner { margin: 1rem 0; padding: .5rem; border: 2px solid #000000; text-align: center; font-weight: 700; }
.print-heading { margin: 1rem 0 .5rem; font-size: 1rem; text-transform: uppercase; color: #000000; }
.print-heading--rule { padding-top: .5rem; border-top: 3px double #000000; text-align: center; }
.print-signatures dd { font-style: italic; }
.print-list { margin: 0 0 1rem; }
.print-table { width: 100%; border-collapse: collapse; margin: 0 0 1rem; }
.print-table th, .print-table td { border: 1px solid #555555; padding: .35rem .5rem; text-align: left; }
.print-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin-top: 1.5rem; padding-top: .5rem; border-top: 1px solid #555555; font-size: .8rem; }

@media (max-width: 640px) {
    .print-grid { grid-template-columns: 1fr; }
    .print-letterhead img { width: 64px; height: 64px; }
}

@media (max-width: 640px) {
    /* Tables become stacked cards on phones. */
    .table, .table tbody, .table tfoot { display: block; width: 100%; }
    .table tfoot th { display: none; }
    .table thead { display: none; }
    .table tr { display: block; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: .75rem; padding: .5rem; }
    .table td { display: block; border: 0; padding: .25rem .25rem; overflow-wrap: anywhere; }
    .table td::before { content: attr(data-label); display: block; font-size: .75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }
    /* Label above value: long labels (the signature lines) don't fit beside it. */
    .details { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .details dd { margin-bottom: .6rem; }
}

@media (max-width: 480px) {
    h1 { font-size: 1.6rem; }
    .brand__short { font-size: 1.4rem; }
    .brand__logo { width: 44px; height: 44px; }
}

@media print {
    .site-header, .site-footer, .skip-link, .print-toolbar { display: none; }
    body { background: #FFFFFF; }
    .site-main { padding: 0; }
    .print-sheet { max-width: none; margin: 0; padding: 0; }
    .print-sheet--break { break-before: page; }
    .print-grid { grid-template-columns: 1fr 1fr; }
    .print-sheet a { color: inherit; text-decoration: none; }
}
