/* ==========================================================================
   Fairfield Education Foundation public site
   ========================================================================== */

:root {
    --accent: #c8102e;
    --accent-dark: #96061f;
    --accent-soft: rgba(200, 16, 46, 0.08);

    --ink: #14181f;
    --ink-soft: #48505c;
    --ink-faint: #6b7482;

    --paper: #ffffff;
    --paper-tint: #f5f6f8;
    --line: #e2e5ea;

    --header-h: 4.75rem;
    --wrap: 72rem;
    --wrap-narrow: 46rem;
    --radius: 0.75rem;
    --shadow: 0 1px 2px rgba(16, 22, 32, 0.05), 0 8px 24px -12px rgba(16, 22, 32, 0.18);

    --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
            "Helvetica Neue", Arial, sans-serif;
}

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

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

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
    margin: 0 0 0.5em;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.015em;
    text-wrap: balance;
}

p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent-dark); text-underline-offset: 0.15em; }
a:hover { color: var(--accent); }

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
    border-radius: 2px;
}

.wrap {
    width: min(100% - 2.5rem, var(--wrap));
    margin-inline: auto;
}
.wrap--narrow { width: min(100% - 2.5rem, var(--wrap-narrow)); }

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 100;
    background: var(--ink);
    color: #fff;
    padding: 0.7rem 1.1rem;
    border-radius: 0 0 var(--radius) var(--radius);
    text-decoration: none;
    transition: top 0.15s ease;
}
.skip-link:focus { top: 0; color: #fff; }

/* --------------------------------------------------------------------------
   Header + navigation
   -------------------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--ink);
    color: #fff;
    border-bottom: 3px solid var(--accent);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: var(--header-h);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 0;
}

.brand__mark {
    width: 2.75rem;
    height: 2.75rem;
    object-fit: contain;
    background: #fff;
    border-radius: 50%;
    padding: 0.2rem;
    flex: none;
}

.brand__text { display: flex; flex-direction: column; }

.brand__name {
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.brand__tagline {
    font-size: 0.72rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.66);
}

.site-nav__list {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav__link {
    display: block;
    padding: 0.55rem 0.85rem;
    color: rgba(255, 255, 255, 0.86);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 0.4rem;
    position: relative;
}

.site-nav__link:hover { color: #fff; background: rgba(255, 255, 255, 0.09); }

.site-nav__link.is-current { color: #fff; }
.site-nav__link.is-current::after {
    content: "";
    position: absolute;
    left: 0.85rem;
    right: 0.85rem;
    bottom: 0.2rem;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}

.nav-toggle {
    display: none;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 0.45rem;
    color: #fff;
    font: inherit;
    font-size: 0.9rem;
    padding: 0.5rem 0.8rem;
    cursor: pointer;
}

.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
    display: block;
    width: 1.1rem;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.18s ease, opacity 0.18s ease;
}
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before,
.nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -0.35rem; }
.nav-toggle__bars::after { top: 0.35rem; }

.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(0.35rem) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-0.35rem) rotate(-45deg); }

@media (max-width: 52rem) {
    .nav-toggle { display: inline-flex; }

    .site-nav {
        position: absolute;
        inset-inline: 0;
        top: 100%;
        background: var(--ink);
        border-bottom: 3px solid var(--accent);
        display: none;
    }
    .site-nav.is-open { display: block; }

    .site-nav__list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0.5rem 1.25rem 1.25rem;
    }
    .site-nav__link { padding: 0.85rem 0.5rem; border-radius: 0; }
    .site-nav__link + .site-nav__link { border-top: 1px solid rgba(255, 255, 255, 0.08); }
    .site-nav__link.is-current::after { left: 0.5rem; right: auto; width: 1.5rem; bottom: 0.5rem; }

    .site-header__inner { position: relative; flex-wrap: wrap; }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
    position: relative;
    isolation: isolate;
    background: var(--ink);
    color: #fff;
    display: grid;
    align-items: center;
    overflow: hidden;
}

.hero__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
}

.hero--image::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(12, 16, 22, 0.72) 0%, rgba(12, 16, 22, 0.55) 45%, rgba(12, 16, 22, 0.78) 100%);
}

/*
 * Banner heights match the previous WordPress site, measured at two widths and
 * interpolated between them: the home banner ran 373px on a phone to 724px on a
 * 1280px desktop, the inner pages 234px to 530px. min-height rather than height
 * so a long title can still push the banner taller instead of overflowing it.
 */
.hero--large { min-height: clamp(373px, calc(219px + 39.44vw), 724px); }
.hero--medium { min-height: clamp(234px, calc(104px + 33.26vw), 530px); }
.hero--compact { min-height: clamp(180px, calc(80px + 25vw), 380px); }

.hero__content {
    padding-block: 2.5rem;
    text-align: center;
}

.hero--compact { background: linear-gradient(140deg, #1b212c 0%, #0f1319 60%); }

.hero__eyebrow {
    margin: 0 0 1rem;
    font-size: clamp(1rem, 2vw, 1.3rem);
    font-weight: 600;
    letter-spacing: 0.01em;
}

.hero__eyebrow::after {
    content: "";
    display: block;
    width: 3.5rem;
    height: 3px;
    margin: 0.9rem auto 0;
    background: var(--accent);
    border-radius: 3px;
}

.hero__title {
    margin: 0;
    font-size: clamp(2.1rem, 7vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    text-transform: uppercase;
}

.hero--compact .hero__title,
.hero--medium .hero__title { font-size: clamp(1.9rem, 5vw, 3.1rem); }

.hero__subtitle {
    margin: 1.1rem auto 0;
    max-width: 42rem;
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: rgba(255, 255, 255, 0.82);
}

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

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin: 1.75rem 0 0;
}

.btn {
    --btn-bg: var(--accent);
    --btn-fg: #fff;
    --btn-border: var(--accent);

    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--btn-border);
    border-radius: 999px;
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.12s ease, background-color 0.15s ease, color 0.15s ease;
}

.btn:hover { transform: translateY(-1px); color: var(--btn-fg); }
.btn:active { transform: translateY(0); }

.btn--primary:hover { --btn-bg: var(--accent-dark); --btn-border: var(--accent-dark); }

.btn--outline { --btn-bg: transparent; --btn-fg: var(--accent-dark); --btn-border: currentColor; }
.btn--outline:hover { --btn-bg: var(--accent); --btn-fg: #fff; --btn-border: var(--accent); }

.btn--ghost { --btn-bg: transparent; --btn-fg: #fff; --btn-border: rgba(255, 255, 255, 0.6); }
.btn--ghost:hover { --btn-bg: rgba(255, 255, 255, 0.14); --btn-border: #fff; }

.btn__ext { font-size: 0.85em; }

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

.section { padding-block: clamp(3rem, 7vw, 5.25rem); }
.section--light { background: var(--paper-tint); }

.section--accent {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: #fff;
}
.section--accent .section__heading { color: #fff; }
.section--accent .section__heading::after { background: rgba(255, 255, 255, 0.75); }
/* Plain links only. Buttons set their own colour below. */
.section--accent a:not(.btn) { color: #fff; }

/* A red button on the red banner would disappear, so invert it instead. */
.section--accent .btn--primary,
.section--accent .btn--primary:hover {
    --btn-bg: #fff;
    --btn-fg: var(--accent-dark);
    --btn-border: #fff;
    color: var(--accent-dark);
}
.section--accent .btn--primary:hover { --btn-bg: #f1f2f4; --btn-border: #f1f2f4; }

.section--accent .btn--outline {
    --btn-bg: transparent;
    --btn-fg: #fff;
    --btn-border: rgba(255, 255, 255, 0.7);
    color: #fff;
}
.section--accent .btn--outline:hover {
    --btn-bg: #fff;
    --btn-border: #fff;
    color: var(--accent-dark);
}

.section__heading {
    font-size: clamp(1.5rem, 3.5vw, 2.1rem);
    margin-bottom: 1.1rem;
}

.section__heading::after {
    content: "";
    display: block;
    width: 3rem;
    height: 3px;
    margin-top: 0.85rem;
    background: var(--accent);
    border-radius: 3px;
}

.prose { color: var(--ink-soft); font-size: 1.05rem; }
.prose a { font-weight: 500; }
.section--accent .prose { color: rgba(255, 255, 255, 0.92); }

/* Our History: same left edge as the sections around it, a readable line
   length, and justified text with hyphenation so there are no rivers */
#history .wrap--narrow { width: min(100% - 2.5rem, var(--wrap)); }
#history .prose { max-width: var(--wrap-narrow); }
#history .prose p {
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
    hyphenate-limit-chars: 7 3 3;
    text-wrap: pretty;
}

/* Split layout: text beside an image */

.split { display: grid; gap: clamp(2rem, 5vw, 3.5rem); align-items: center; }

@media (min-width: 48rem) {
    .split { grid-template-columns: 1.35fr 1fr; }
    .split--image-left .split__text { order: 2; }
    .split--image-left .split__media { order: 1; }
}

.split__media img {
    margin-inline: auto;
    max-width: 20rem;
    border-radius: var(--radius);
}

/* Standalone photo section */

.figure { margin: 0; }

.figure img {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.figure figcaption {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--ink-faint);
    text-align: center;
}

/* Checklist */

.checklist {
    list-style: disc;
    margin: 1.25rem 0 0;
    padding-left: 1.4rem;
    display: grid;
    gap: 0.6rem;
}

.checklist li {
    padding-left: 0.3rem;
    color: var(--ink-soft);
    font-size: 1.05rem;
}

.checklist li::marker { color: var(--ink-soft); }

/* Stat cards */

.stat-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
}

.stat-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-top: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: clamp(1.5rem, 3vw, 2.25rem);
    box-shadow: var(--shadow);
}

.stat-card__title {
    font-size: 1.2rem;
    color: var(--ink);
    margin-bottom: 0.35rem;
}

.stat-card__value {
    margin: 0;
    font-size: clamp(2.25rem, 5vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--accent);
    line-height: 1.05;
}

.stat-card__note {
    margin: 0.15rem 0 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.stat-card__body { font-size: 1rem; }

/* Call to action */

.cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem 2.5rem;
}

.cta__text { flex: 1 1 24rem; }
.cta__text .section__heading { margin-bottom: 0.75rem; }
.cta__actions { margin: 0; justify-content: flex-start; }

/* A call to action with buttons only: centred, and close to what follows. */
.section--cta-bare { padding-block: clamp(2rem, 4vw, 2.75rem) 0; }
.section--cta-bare .cta { justify-content: center; }
.section--cta-bare .cta__actions { justify-content: center; }

/* Givebutter donation form. assets/js/donate.js sizes the frame to the form;
   this fixed height is the fallback, and the form scrolls inside it then. */
.section--donate { padding-block: clamp(1.25rem, 3vw, 2rem) 0; }
.donate-frame {
    display: block;
    width: 100%;
    height: 760px;
    border: 0;
}
.section--donate .section__heading + .donate-frame,
.section--donate .prose + .donate-frame { margin-top: 1.5rem; }
.donate-fallback {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--ink-faint);
    text-align: center;
}

/* --------------------------------------------------------------------------
   Board of directors
   -------------------------------------------------------------------------- */

.board-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 17.5rem), 1fr));
}

.board-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.75rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.board-card__photo {
    position: relative;
    width: 8.5rem;
    height: 8.5rem;
    margin: 0 auto 1.15rem;
    border-radius: 50%;
    overflow: hidden;
    background: var(--paper-tint);
    border: 3px solid var(--paper);
    outline: 2px solid var(--line);
    display: grid;
    place-items: center;
    flex: none;
}

/*
 * Most headshots are portrait, so filling a circular frame crops the height.
 * Centring that crop takes the top of the head off; biasing the window upward
 * keeps faces intact. Square photos are unaffected, with nothing to crop.
 *
 * The photo is positioned rather than sized with percentages: as a centred grid
 * item its height:100% is indefinite, which Safari resolves against the image's
 * own aspect instead of the frame. The image then keeps its natural shape,
 * object-fit has nothing to crop, and tall portraits spill out of the circle.
 * Pinning it to the frame's edges gives object-fit a definite square to work
 * with in every browser. The initials fallback stays centred by the grid.
 */
.board-card__photo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 22%;
}

.board-card__initials {
    font-size: 2rem;
    font-weight: 700;
    color: var(--ink-faint);
    letter-spacing: 0.02em;
}

.board-card__name { font-size: 1.15rem; margin-bottom: 0.25rem; }

.board-card__role {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--accent);
}

.board-card__note {
    margin: 0.3rem 0 0;
    font-size: 0.85rem;
    color: var(--ink-faint);
    font-style: italic;
}

.board-card__bio {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
    font-size: 0.95rem;
    text-align: left;
    line-height: 1.6;
}

/*
 * Compact roster, used for former directors.
 *
 * Name and dates sit on their own lines rather than side by side. Side by side,
 * one long name pushed the date onto a second line and, because grid items
 * stretch, every tile in that row grew with it. A fixed two-line stack keeps
 * all of them the same height whatever the name length.
 */

.roster {
    list-style: none;
    margin: 1.5rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.3rem;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
}

.roster__item {
    padding: 0.45rem 0.7rem;
    background: var(--paper-tint);
    border-left: 3px solid var(--line);
    border-radius: 0 0.3rem 0.3rem 0;
    line-height: 1.3;
}

.section--light .roster__item { background: var(--paper); }

.roster__name {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    /* Long names break rather than widening the column. */
    overflow-wrap: break-word;
}

.roster__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--ink-faint);
}

.roster__role {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}

.roster__years { font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   Contact page
   -------------------------------------------------------------------------- */

.contact-layout { display: grid; gap: clamp(2rem, 5vw, 3.5rem); }

@media (min-width: 52rem) {
    .contact-layout { grid-template-columns: 1.5fr 1fr; align-items: start; }
}

.contact-info__block { margin-bottom: 1.75rem; }
.contact-info__block:last-child { margin-bottom: 0; }

.contact-info h3 {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.4rem;
}

.contact-info address { font-style: normal; color: var(--ink-soft); }

/* Forms */

.form { margin-top: 1.5rem; display: grid; gap: 1.15rem; }
.form__field { margin: 0; display: grid; gap: 0.4rem; }

.form__field label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink);
}

.req { color: var(--accent); }

.form input[type="text"],
.form input[type="email"],
.form textarea {
    width: 100%;
    padding: 0.7rem 0.85rem;
    font: inherit;
    font-size: 1rem;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 0.5rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form input:focus,
.form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form textarea { resize: vertical; min-height: 9rem; }

.form__actions { margin: 0.25rem 0 0; }

.form__honeypot {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.notice {
    margin: 1.5rem 0 0;
    padding: 1rem 1.15rem;
    border-radius: 0.5rem;
    border-left: 4px solid;
    font-size: 0.98rem;
}

.notice ul { margin: 0.5rem 0 0; padding-left: 1.2rem; }

.notice--success { background: #edf7f0; border-color: #2f8f52; color: #1d5c35; }
.notice--error { background: #fdf0f2; border-color: var(--accent); color: #8c1226; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
    background: var(--ink);
    color: rgba(255, 255, 255, 0.74);
    padding-block: clamp(2.5rem, 6vw, 4rem) 1.5rem;
    font-size: 0.95rem;
    border-top: 3px solid var(--accent);
}

.site-footer a { color: rgba(255, 255, 255, 0.86); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }

.site-footer__grid {
    display: grid;
    gap: 2.25rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}

.site-footer__brand img {
    background: #fff;
    border-radius: 50%;
    padding: 0.25rem;
    margin-bottom: 0.9rem;
}

.site-footer__name { color: #fff; font-weight: 600; margin-bottom: 0.5rem; }
.site-footer__note { font-size: 0.85rem; color: rgba(255, 255, 255, 0.55); max-width: 26rem; }

.site-footer__heading {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: #fff;
    margin-bottom: 0.9rem;
}

.site-footer__nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }

.site-footer__contact address { font-style: normal; line-height: 1.8; }

.site-footer__legal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    justify-content: space-between;
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.5);
}

.site-footer__legal p { margin: 0; }

/* --------------------------------------------------------------------------
   Print
   -------------------------------------------------------------------------- */

@media print {
    .site-header, .site-footer, .nav-toggle, .button-row { display: none !important; }
    .hero { background: none; color: #000; }
    .hero__bg, .hero--image::after { display: none; }
    body { font-size: 11pt; }
}

/* --------------------------------------------------------------------------
   Scholarships: the scholarships and the application form
   -------------------------------------------------------------------------- */

.apply-deadline { margin: 0 0 1.75rem; font-size: 1.1rem; color: var(--ink-soft); }
.apply-closed { margin: 0 0 2rem; background: var(--paper-tint); border-color: var(--ink-faint); color: var(--ink-soft); }

.form.apply { margin-top: 0; display: block; }
.form.apply[hidden] { display: none; }

/* An emailed link that would replace the application open in this browser */
.resume-prompt { max-width: 50rem; margin: 0 0 2rem; background: var(--paper-tint); border-color: var(--accent); color: var(--ink); }
.resume-prompt:focus { outline: none; }
.resume-prompt__title { margin: 0 0 0.6rem; font-size: 1.15rem; }
.resume-prompt p { margin: 0 0 0.5rem; }
.resume-prompt__note { color: var(--ink-soft); }
.resume-prompt__error { color: #8c1226; font-weight: 600; }
.resume-prompt .resume-prompt__actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; margin: 1.1rem 0 0; }
.apply__body { max-width: 50rem; margin-top: 2.75rem; }

.apply__group { border: 0; margin: 0 0 2.75rem; padding: 0; min-width: 0; }
.apply__legend {
    padding: 0;
    margin-bottom: 1rem;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.apply__grid {
    display: grid;
    gap: 1.15rem 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
    margin-bottom: 1.15rem;
}
.apply__grid:last-child { margin-bottom: 0; }

.form input[type="tel"] {
    width: 100%;
    padding: 0.7rem 0.85rem;
    font: inherit;
    font-size: 1rem;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 0.5rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.apply [aria-invalid="true"] { border-color: var(--accent); }

.field-error { font-size: 0.88rem; font-weight: 500; color: #a3112b; }
.field-error:empty { display: none; }

/* "$" and "%" beside the cost and percentage boxes */
.affix { display: flex; }
.affix input { flex: 1 1 auto; min-width: 0; }
.affix__text {
    display: grid;
    place-items: center;
    padding: 0 0.8rem;
    background: var(--paper-tint);
    border: 1px solid var(--line);
    color: var(--ink-faint);
    font-weight: 600;
}
.affix__text:first-child { border-right: 0; border-radius: 0.5rem 0 0 0.5rem; }
.affix__text:last-child { border-left: 0; border-radius: 0 0.5rem 0.5rem 0; }
.form .affix__text + input { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.form .affix input:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }

/* Scholarship cards. The whole card ticks its box. */

.scholarship-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15.5rem), 1fr));
}

.scholarship {
    position: relative;
    padding: 1.15rem 1.25rem 1.3rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.scholarship__name { margin: 0 0 0.2rem; font-size: 1.15rem; }
.scholarship__name label { display: flex; gap: 0.65rem; align-items: flex-start; cursor: pointer; }
.scholarship__name label::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.scholarship__name input {
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    margin: 0.05rem 0 0;
    accent-color: var(--accent);
    cursor: pointer;
}

.scholarship__full { margin: 0 0 0.8rem; font-size: 0.85rem; line-height: 1.4; color: var(--ink-faint); }

.scholarship__reqs {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.4rem;
    font-size: 0.93rem;
    line-height: 1.45;
    color: var(--ink-soft);
}
.scholarship__reqs li { position: relative; padding-left: 1rem; }
.scholarship__reqs li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 0.38rem;
    height: 0.38rem;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.5;
}
.scholarship__reqs li.is-unmet { color: #a3112b; font-weight: 600; }
.scholarship__reqs li.is-unmet::before { opacity: 1; }

.apply:not([data-closed]) .scholarship__full,
.apply:not([data-closed]) .scholarship__reqs { margin-left: 1.9rem; }

.apply:not([data-closed]) .scholarship:hover { border-color: #c4cad3; }
.scholarship.is-chosen,
.scholarship:has(input:checked) {
    border-color: var(--accent);
    background: #fffbfb;
    box-shadow: 0 0 0 1px var(--accent), var(--shadow);
}
.scholarship:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Essays */

.essay { margin-bottom: 2rem; }
.essay:last-child { margin-bottom: 0; }
.essay__name { display: block; margin-bottom: 0.15rem; font-size: 1.05rem; font-weight: 700; }
.essay__prompt { margin: 0 0 0.65rem; color: var(--ink-soft); }
.form .essay textarea { min-height: 15rem; line-height: 1.6; }
.essay__meta { display: flex; gap: 1rem; justify-content: space-between; margin: 0.35rem 0 0; font-size: 0.88rem; }
.essay__count { margin-left: auto; white-space: nowrap; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.essay__count.is-over { color: #a3112b; font-weight: 600; }

/* Letters of recommendation */

.letter {
    padding: 1rem 1.15rem 1.15rem;
    background: var(--paper);
    border: 1.5px dashed #c4cad3;
    border-radius: var(--radius);
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
.letter.has-files { border-style: solid; border-color: var(--line); }
.letter.is-dragging { border-color: var(--accent); background: var(--accent-soft); }

.letter__name { margin: 0 0 0.65rem; font-weight: 700; }

.letter__files { list-style: none; margin: 0 0 0.8rem; padding: 0; display: grid; gap: 0.5rem; }
.letter__files:empty { display: none; }

.letter__file {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.1rem 0.75rem;
    align-items: center;
    padding: 0.55rem 0.75rem;
    background: var(--paper-tint);
    border-radius: 0.5rem;
    font-size: 0.92rem;
}
.letter__file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.letter__file-meta { grid-column: 1; font-size: 0.8rem; color: var(--ink-faint); }
.letter__file.is-failed .letter__file-meta { color: #a3112b; }

.letter__remove {
    grid-column: 2;
    grid-row: 1 / span 2;
    padding: 0.25rem;
    background: none;
    border: 0;
    font: inherit;
    font-size: 0.85rem;
    color: var(--accent-dark);
    text-decoration: underline;
    text-underline-offset: 0.15em;
    cursor: pointer;
}
.letter__remove:disabled { opacity: 0.5; cursor: default; }

.letter__bar { grid-column: 1 / -1; height: 4px; margin-top: 0.3rem; background: var(--line); border-radius: 2px; overflow: hidden; }
.letter__bar span { display: block; width: 0; height: 100%; background: var(--accent); transition: width 0.2s ease; }

.letter__pick { position: relative; cursor: pointer; }
.letter__pick input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    clip-path: inset(50%);
}
.letter__pick:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Sending */

.apply__finish { padding-top: 1.75rem; border-top: 1px solid var(--line); }
.apply__missing { margin: 0 0 1.5rem; }
.apply__missing p { margin: 0; font-weight: 600; }
.apply__missing a { color: inherit; }
.apply__missing:focus { outline: none; }

.apply__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin: 0; }
.apply__submit:disabled { opacity: 0.7; cursor: progress; transform: none; }

.apply__link {
    padding: 0;
    background: none;
    border: 0;
    font: inherit;
    font-size: 0.95rem;
    color: var(--accent-dark);
    text-decoration: underline;
    text-underline-offset: 0.15em;
    cursor: pointer;
}
.apply__link:disabled { opacity: 0.6; cursor: progress; }

.apply-status {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 20;
    margin: 0;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--paper);
    color: var(--ink-soft);
    font-size: 0.85rem;
    box-shadow: var(--shadow);
    pointer-events: none;
}
.apply-status:empty { display: none; }
.apply-status.is-offline { border-color: var(--accent); color: #8c1226; }

.apply-done:focus { outline: none; }
.apply-done__mail { margin-top: 1.25rem; color: var(--ink-soft); }

@media print {
    .apply-status, .apply__finish, .letter__pick { display: none !important; }
}
