@font-face {
    font-display: swap;
    font-family: "Amaranth";
    font-style: normal;
    font-weight: 400;
    src: url("/wp-content/themes/smol-updated/assets/fonts/amaranth/amaranth-regular.ttf") format("truetype");
}

@font-face {
    font-display: swap;
    font-family: "Amaranth";
    font-style: normal;
    font-weight: 700;
    src: url("/wp-content/themes/smol-updated/assets/fonts/amaranth/amaranth-bold.ttf") format("truetype");
}

@font-face {
    font-display: swap;
    font-family: "Imprima";
    font-style: normal;
    font-weight: 400;
    src: url("/wp-content/themes/smol-updated/assets/fonts/imprima/imprima-regular.ttf") format("truetype");
}

:root {
    --primary: #0a4597;
    --primary-dark: #07356f;
    --accent: #1491b6;
    --ink: #172033;
    --muted: #5b6678;
    --line: #d9e1eb;
    --surface: #ffffff;
    --soft: #f4f8fc;
    --success: #176b45;
    --success-soft: #eaf7f0;
    --warning: #805d0b;
    --warning-soft: #fff7dd;
    --danger: #a22727;
    --danger-soft: #fff0f0;
    --radius: 18px;
    --shadow: 0 18px 45px rgba(24, 50, 82, 0.1);
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: light;
}

body {
    margin: 0;
    background: linear-gradient(180deg, #eef6fb 0, #f8fafc 340px, #f8fafc 100%);
    color: var(--ink);
    font-family: "Imprima", Arial, sans-serif;
    line-height: 1.55;
}

body.embedded {
    background: #fff;
}

body.embedded .site-header,
body.embedded .form-footer,
body.embedded .form-topline {
    display: none;
}

body.embedded .form-shell {
    max-width: none;
    padding: 0;
}

body.embedded .form-heading,
body.embedded > .notice,
body.embedded .form-shell > .notice {
    margin-left: 30px;
    margin-right: 30px;
}

body.embedded .form-heading {
    padding-top: 30px;
}

body.embedded .form-card {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

a {
    color: var(--primary);
}

.site-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin: 0 auto;
    max-width: 1180px;
    padding: 22px 28px;
}

.brand {
    display: inline-flex;
}

.brand img {
    background: #fff;
    border-radius: 10px;
    height: 62px;
    object-fit: contain;
    padding: 5px;
    width: 92px;
}

.header-link,
.back-link {
    font-size: 0.94rem;
    font-weight: 700;
    text-decoration: none;
}

.header-link:hover,
.back-link:hover {
    text-decoration: underline;
}

.page-shell,
.form-shell {
    margin: 0 auto;
    max-width: 1180px;
    padding: 42px 28px 80px;
}

.form-shell {
    max-width: 920px;
}

.intro {
    max-width: 760px;
}

.eyebrow {
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    margin: 0 0 10px;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3,
.eyebrow,
.button,
.step-chip {
    font-family: "Amaranth", Arial, sans-serif;
}

h1 {
    font-size: clamp(2.25rem, 6vw, 4.4rem);
    letter-spacing: -0.045em;
    line-height: 1.02;
    margin-bottom: 18px;
}

.lead {
    color: var(--muted);
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    max-width: 700px;
}

.notice {
    align-items: flex-start;
    background: #e8f3fb;
    border: 1px solid #c3dfef;
    border-radius: 14px;
    display: flex;
    gap: 14px;
    margin: 34px 0;
    padding: 18px 20px;
}

.notice p {
    color: #36536b;
    margin: 4px 0 0;
}

.notice p + p {
    margin-top: 12px;
}

.notice-icon {
    align-items: center;
    background: var(--primary);
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    flex: 0 0 26px;
    font-family: Georgia, serif;
    font-weight: 700;
    height: 26px;
    justify-content: center;
}

.notice-warning {
    background: var(--warning-soft);
    border-color: #e7cf82;
    color: var(--warning);
}

.notice-warning p {
    color: #654a0a;
}

.notice-warning .notice-icon {
    background: var(--warning);
}

.grant-grid {
    display: grid;
    gap: 22px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grant-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(24, 50, 82, 0.06);
    display: flex;
    flex-direction: column;
    min-height: 410px;
    padding: 26px;
}

.grant-card.featured {
    border-color: #80bfd4;
    box-shadow: var(--shadow);
    transform: translateY(-8px);
}

.grant-card-top {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 26px;
}

.grant-number {
    color: #a7b6c7;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.status-badge {
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 6px 10px;
    text-transform: uppercase;
}

.status-open {
    background: var(--success-soft);
    color: var(--success);
}

.status-upcoming {
    background: var(--warning-soft);
    color: var(--warning);
}

.grant-card h2 {
    font-size: 1.45rem;
    line-height: 1.2;
    margin-bottom: 12px;
}

.grant-card > p,
.grant-facts {
    color: var(--muted);
}

.grant-facts {
    font-size: 0.92rem;
    margin: 8px 0 26px;
    padding-left: 20px;
}

.grant-facts li + li {
    margin-top: 7px;
}

.button {
    align-items: center;
    border: 0;
    border-radius: 10px;
    display: inline-flex;
    font: inherit;
    font-weight: 800;
    gap: 10px;
    justify-content: center;
    margin-top: auto;
    min-height: 48px;
    padding: 12px 18px;
    text-decoration: none;
}

.button-primary {
    background: var(--primary);
    color: #fff;
    cursor: pointer;
}

.button-primary:hover {
    background: var(--primary-dark);
}

.button-secondary {
    background: #e7eef7;
    color: var(--primary);
    cursor: pointer;
}

.button-disabled {
    background: #eef1f5;
    color: #7e8795;
}

.button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(20, 145, 182, 0.35);
    outline-offset: 3px;
}

.muted-card {
    background: #fbfcfd;
}

.form-footer {
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.88rem;
    padding: 28px;
    text-align: center;
}

.form-topline {
    margin-bottom: 28px;
}

.form-heading {
    margin-bottom: 32px;
}

.form-heading-compact {
    margin-bottom: 20px;
}

.form-heading h1 {
    font-size: clamp(2rem, 5vw, 3.4rem);
}

.step-chip {
    background: #e5eef9;
    border-radius: 999px;
    color: var(--primary);
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 800;
    margin-bottom: 14px;
    padding: 7px 11px;
    text-transform: uppercase;
}

.form-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.form-section {
    border: 0;
    border-bottom: 1px solid var(--line);
    margin: 0;
    padding: 30px;
}

.form-section:last-of-type {
    border-bottom: 0;
}

.section-heading {
    margin-bottom: 24px;
}

.section-heading h2 {
    font-size: 1.28rem;
    margin-bottom: 6px;
}

.section-heading p {
    color: var(--muted);
    margin-bottom: 0;
}

.field-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-grid .full-width {
    grid-column: 1 / -1;
}

.field label,
.field-label {
    display: block;
    font-size: 0.92rem;
    font-weight: 750;
    margin-bottom: 7px;
}

.required {
    color: var(--danger);
}

.field input,
.field textarea,
.field select {
    background: #fff;
    border: 1px solid #aebaca;
    border-radius: 9px;
    color: var(--ink);
    font: inherit;
    min-height: 48px;
    padding: 11px 12px;
    width: 100%;
}

.field textarea {
    min-height: 120px;
    resize: vertical;
}

.field small {
    color: var(--muted);
    display: block;
    margin-top: 6px;
}

.file-field {
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px;
}

.field.file-field input[type="file"] {
    background: transparent;
    border: 0;
    min-height: 46px;
    padding: 8px 0 0;
}

.field.file-field input[type="file"]::file-selector-button {
    background: #e5eef9;
    border: 0;
    border-radius: 8px;
    color: var(--primary);
    cursor: pointer;
    font-family: "Amaranth", Arial, sans-serif;
    font-weight: 700;
    margin-right: 12px;
    min-height: 42px;
    padding: 9px 14px;
}

.calculation-panel {
    background: var(--soft);
    border: 1px solid #caddeb;
    border-radius: 14px;
    grid-column: 1 / -1;
    padding: 20px;
}

.calculation-panel.is-valid {
    background: var(--success-soft);
    border-color: #a9d5bd;
}

.calculation-panel.is-invalid {
    background: var(--danger-soft);
    border-color: #efb9b9;
}

.calculation-label {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.calculation-value {
    color: var(--primary-dark);
    display: block;
    font-size: clamp(1.7rem, 5vw, 2.5rem);
    font-weight: 850;
    letter-spacing: -0.04em;
    margin: 4px 0;
}

.calculation-detail {
    color: var(--muted);
    margin: 0;
}

.checkbox-row {
    align-items: flex-start;
    display: flex;
    gap: 11px;
}

.checkbox-row input {
    flex: 0 0 20px;
    height: 20px;
    margin-top: 2px;
    width: 20px;
}

.checkbox-row label {
    font-weight: 500;
    margin: 0;
}

.form-actions {
    align-items: center;
    background: #f7f9fc;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    padding: 24px 30px;
}

.form-actions p {
    color: var(--muted);
    font-size: 0.87rem;
    margin: 0;
    max-width: 450px;
}

.preview-panel {
    background: var(--success-soft);
    border: 1px solid #a9d5bd;
    border-radius: 14px;
    margin-top: 24px;
    padding: 24px;
}

.preview-panel[hidden] {
    display: none;
}

.preview-panel h2 {
    color: var(--success);
    font-size: 1.25rem;
}

.summary-list {
    display: grid;
    gap: 8px 18px;
    grid-template-columns: max-content 1fr;
    margin: 18px 0 0;
}

.summary-list dt {
    color: var(--muted);
    font-weight: 650;
}

.summary-list dd {
    font-weight: 750;
    margin: 0;
}

@media (max-width: 850px) {
    .grant-grid {
        grid-template-columns: 1fr;
    }

    .grant-card,
    .grant-card.featured {
        min-height: 0;
        transform: none;
    }
}

@media (max-width: 620px) {
    .site-header,
    .page-shell,
    .form-shell {
        padding-left: 18px;
        padding-right: 18px;
    }

    .page-shell,
    .form-shell {
        padding-top: 24px;
    }

    .field-grid {
        grid-template-columns: 1fr;
    }

    .field-grid .full-width {
        grid-column: auto;
    }

    .form-section,
    .form-actions {
        padding: 22px 18px;
    }

    .form-actions .button {
        width: 100%;
    }

    .summary-list {
        grid-template-columns: 1fr;
    }

    .summary-list dd + dt {
        margin-top: 8px;
    }

    body.embedded .form-heading,
    body.embedded .form-shell > .notice {
        margin-left: 18px;
        margin-right: 18px;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .button,
    .grant-card {
        transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
    }

    .grant-card:hover {
        box-shadow: var(--shadow);
        transform: translateY(-4px);
    }
}

/* Attachment lists are shared by both expense forms. */
.expense-attachment-list { list-style: none; margin: 12px 0; padding: 0; }
.expense-attachment-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 0; border-bottom: 1px solid #d9e1eb; }
.expense-attachment-row a { overflow-wrap: anywhere; min-width: 0; }
.expense-attachment-row button { margin-left: auto; border: 1px solid #a22727; border-radius: 6px; background: white; color: #a22727; padding: 5px 10px; cursor: pointer; }
.attachment-removed { opacity: .7; }
.attachment-removed a { text-decoration: line-through; }
.attachment-note { color: #5b6678; font-size: .9rem; margin-top: 10px; }

/* Keep the complete acknowledgement clear of the iframe's clipped edges. */
.form-shell.submission-success {
    display: flow-root;
}
body.embedded .form-shell.submission-success {
    padding: 24px;
}
.submission-success .preview-panel {
    margin: 0;
}
.submission-success .preview-panel > :last-child {
    margin-bottom: 0;
}
@media (max-width: 600px) {
    body.embedded .form-shell.submission-success {
        padding: 16px;
    }
    .submission-success .preview-panel {
        padding: 20px;
    }
}
