/*
 * IEF Donations - public donation pages.
 * Self-contained: no framework, no web fonts, nothing loaded from elsewhere.
 * Colours come from the INCEIF Endowment Fund mark (its blue, its green).
 */
:root {
    --ink: #1d2b33;
    --ink-2: #4a5c66;
    --muted: #5f6f79;
    --line: #d5e0e6;
    --line-soft: #e8eef1;
    --paper: #ffffff;
    --page: #f2f7f9;
    --blue: #0a8fc7;
    --blue-deep: #0b6791;
    --blue-dark: #094f70;
    --blue-wash: #e6f4fa;
    --green: #3c9f4a;
    --green-deep: #2c7a2f;
    --green-wash: #e7f5e4;
    --amber-wash: #fff6dd;
    --amber-ink: #7a4f00;
    --red: #b4291f;
    --red-wash: #fdecea;
    --radius: 12px;
    --font: "Avenir Next", Avenir, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

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

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--page);
}

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

a {
    color: var(--blue-deep);
    text-underline-offset: 2px;
}

a:hover {
    color: var(--ink);
}

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

[hidden] {
    display: none !important;
}

.wrap {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

.wrap--narrow {
    max-width: 760px;
}

.skip {
    position: absolute;
    left: -9999px;
    top: 8px;
    z-index: 10;
    padding: 10px 14px;
    color: #ffffff;
    background: var(--blue-deep);
    border-radius: 8px;
}

.skip:focus {
    left: 8px;
}

/* ------------------------------------------------------------------- header */
.top {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.top__in {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px 28px;
    min-height: 84px;
    padding-top: 12px;
    padding-bottom: 12px;
}

.top__logo {
    display: block;
    flex: none;
    line-height: 0;
}

.top__logo img {
    width: auto;
    height: 58px;
}

.top__home {
    flex: none;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
}

.top__home:hover {
    text-decoration: underline;
}

/* Details -> Review -> Payment is a real sequence, so it is numbered. */
.steps {
    display: flex;
    flex: 1 1 auto;
    justify-content: center;
    gap: 8px 28px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.steps li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: var(--muted);
    counter-increment: step;
}

.steps li::before {
    content: counter(step);
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    font-size: 13px;
}

.steps li.is-now {
    color: var(--ink);
}

.steps li.is-now::before {
    color: #ffffff;
    background: var(--blue-deep);
    border-color: var(--blue-deep);
}

.steps li.is-done {
    color: var(--green-deep);
}

.steps li.is-done::before {
    content: "\2713";
    color: #ffffff;
    background: var(--green);
    border-color: var(--green);
}

/* -------------------------------------------------------------------- intro */
.intro {
    position: relative;
    padding: 56px 0 40px;
    overflow: hidden;
}

.intro__text {
    position: relative;
    max-width: 640px;
}

.intro h1 {
    margin: 0 0 16px;
    font-size: clamp(32px, 4.6vw, 50px);
    line-height: 1.06;
    font-weight: 700;
    letter-spacing: -0.025em;
    text-wrap: balance;
}

.intro__lead {
    margin: 0;
    max-width: 56ch;
    font-size: 18px;
    line-height: 1.6;
    color: var(--ink-2);
}

.petals {
    position: absolute;
    right: 24px;
    top: 8px;
    width: 250px;
    height: 250px;
    pointer-events: none;
}

/* ------------------------------------------------------------------- layout */
.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 24px 32px;
    align-items: start;
    padding-bottom: 72px;
}

.layout > .block,
.layout > .send {
    grid-column: 1;
}

.layout > .side {
    grid-column: 2;
    grid-row: 1 / span 4;
    position: sticky;
    top: 24px;
}

.block {
    padding: 28px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.block h2 {
    margin: 0 0 4px;
    font-size: 22px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.block__note {
    margin: 0 0 20px;
    color: var(--muted);
}

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

.field {
    margin: 0 0 18px;
}

.field label,
.legend {
    display: block;
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
}

.optional {
    font-weight: 400;
    color: var(--muted);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="number"],
.field select {
    display: block;
    width: 100%;
    height: 48px;
    padding: 0 14px;
    font: inherit;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid #a9bcc6;
    border-radius: 8px;
    appearance: none;
}

.field select {
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231d2b33' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.field input:focus,
.field select:focus {
    border-color: var(--blue-deep);
    outline: 3px solid rgba(10, 143, 199, 0.28);
    outline-offset: 0;
}

.hint {
    margin: 6px 0 0;
    font-size: 14px;
    color: var(--muted);
}

.err {
    margin: 6px 0 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--red);
}

.has-error input,
.has-error select {
    border-color: var(--red);
}

.notice {
    margin: 0 0 24px;
    padding: 14px 16px;
    border-radius: 10px;
    color: var(--blue-dark);
    background: var(--blue-wash);
}

.notice--bad {
    color: var(--red);
    background: var(--red-wash);
}

.notice--warn {
    color: var(--amber-ink);
    background: var(--amber-wash);
}

.notice--good {
    color: #1f6b24;
    background: var(--green-wash);
}

.notice strong {
    color: inherit;
}

.trap {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ------------------------------------------------------------ purpose tiles */
.choice {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 20px;
}

.choice__item {
    position: relative;
    display: block;
    padding: 16px 16px 16px 46px;
    border: 1px solid #a9bcc6;
    border-radius: 10px;
    cursor: pointer;
}

.choice__item input {
    position: absolute;
    left: 16px;
    top: 19px;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--blue-deep);
}

.choice__item strong {
    display: block;
    font-size: 16px;
}

.choice__item span {
    display: block;
    font-size: 14px;
    color: var(--muted);
}

.choice__item.is-on {
    border-color: var(--blue-deep);
    background: var(--blue-wash);
    box-shadow: inset 0 0 0 1px var(--blue-deep);
}

.money {
    display: flex;
    align-items: stretch;
    max-width: 280px;
}

.money span {
    display: flex;
    align-items: center;
    padding: 0 14px;
    font-weight: 600;
    color: var(--ink-2);
    background: var(--page);
    border: 1px solid #a9bcc6;
    border-right: 0;
    border-radius: 8px 0 0 8px;
}

.field .money input[type="number"],
.money input[type="number"] {
    flex: 1 1 auto;
    min-width: 0;
    height: 48px;
    padding: 0 14px;
    font: inherit;
    font-weight: 600;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid #a9bcc6;
    border-radius: 0 8px 8px 0;
    appearance: textfield;
    -moz-appearance: textfield;
}

.money input::-webkit-outer-spin-button,
.money input::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.money input:focus {
    border-color: var(--blue-deep);
    outline: 3px solid rgba(10, 143, 199, 0.28);
    outline-offset: 0;
}

.quick {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
}

.quick button {
    height: 40px;
    padding: 0 16px;
    font: inherit;
    font-weight: 600;
    color: var(--blue-dark);
    background: var(--paper);
    border: 1px solid #a9bcc6;
    border-radius: 999px;
    cursor: pointer;
}

.quick button:hover {
    border-color: var(--blue-deep);
}

.quick button.is-on {
    color: #ffffff;
    background: var(--blue-deep);
    border-color: var(--blue-deep);
}

.purposes {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--line-soft);
}

.purposes li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    align-items: center;
    gap: 10px 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line-soft);
}

.purposes label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-weight: 600;
    cursor: pointer;
}

.purposes input[type="checkbox"],
.agree input[type="checkbox"] {
    flex: none;
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--blue-deep);
}

.purposes .money {
    max-width: none;
}

.purposes__extra {
    grid-column: 1 / -1;
}

.purposes__extra input {
    display: block;
    width: 100%;
    height: 48px;
    padding: 0 14px;
    font: inherit;
    border: 1px solid #a9bcc6;
    border-radius: 8px;
}

.agree {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-weight: 600;
    cursor: pointer;
}

.agree input {
    margin-top: 2px !important;
}

.small {
    margin: 12px 0 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--muted);
}

/* ------------------------------------------------------------------ buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 26px;
    font: inherit;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
}

.btn--primary {
    color: #ffffff;
    background: var(--blue-deep);
}

.btn--primary:hover {
    color: #ffffff;
    background: var(--blue-dark);
}

.btn--quiet {
    color: var(--blue-dark);
    background: var(--paper);
    border-color: #a9bcc6;
}

.btn--quiet:hover {
    color: var(--ink);
    border-color: var(--blue-deep);
}

.btn--block {
    width: 100%;
}

.send {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
}

.send p {
    margin: 0;
    font-size: 14px;
    color: var(--muted);
}

/* --------------------------------------------- the Statement of Trust sheet */
.sheet {
    position: relative;
    padding: 30px 26px 24px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 4px;
    box-shadow: 0 1px 0 #cfdbe1, 0 14px 30px -18px rgba(29, 43, 51, 0.35);
}

/* INCE in blue, IF in green - the two inks of the wordmark. */
.sheet::before,
.sheet::after {
    content: "";
    position: absolute;
    top: -1px;
    height: 5px;
}

.sheet::before {
    left: -1px;
    width: 68%;
    background: var(--blue);
    border-radius: 4px 0 0 0;
}

.sheet::after {
    right: -1px;
    width: calc(32% + 2px);
    background: var(--green);
    border-radius: 0 4px 0 0;
}

.sheet__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 16px;
}

.sheet__title {
    margin: 0;
    font-size: 26px;
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

/* The document's name sits quietly above its number (SOT#1743). */
.sheet__kind {
    display: block;
    margin: 0 0 4px;
    font-size: 13px;
    line-height: 1.3;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--muted);
}

.sheet__tag {
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 700;
    color: var(--amber-ink);
    background: var(--amber-wash);
    border-radius: 999px;
    white-space: nowrap;
}

.sheet__tag--paid {
    color: #1f6b24;
    background: var(--green-wash);
}

.sheet__tag--off {
    color: var(--ink-2);
    background: var(--line-soft);
}

.sheet dl {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    margin: 0;
    font-size: 14px;
}

.sheet dt,
.sheet dd {
    margin: 0;
    padding: 7px 0;
    border-top: 1px solid var(--line-soft);
}

.sheet dt {
    color: var(--muted);
}

.sheet dd {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.sheet .is-empty {
    font-weight: 400;
    color: #8696a0;
}

.sheet__lines {
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
    font-size: 15px;
}

.sheet__lines li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-top: 1px solid var(--line-soft);
}

.sheet__lines span:last-child,
.sheet__total strong {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.sheet__total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 0;
    padding: 14px 0 0;
    border-top: 2px solid var(--ink);
}

.sheet__total > span {
    font-size: 15px;
    font-weight: 600;
}

.sheet__total strong {
    font-size: 34px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.sheet__total small {
    margin-right: 4px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--ink-2);
}

.sheet__foot {
    margin: 16px 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
}

.tax {
    margin: 16px 0 0;
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--amber-ink);
    background: var(--amber-wash);
    border-radius: 10px;
}

.tax strong {
    display: block;
}

/* ------------------------------------------------------------------- review */
.review {
    display: grid;
    grid-template-columns: 400px minmax(0, 1fr);
    gap: 32px;
    align-items: start;
    padding: 48px 0 72px;
}

.review h1,
.plain h1,
.terms h1 {
    margin: 0 0 12px;
    font-size: clamp(28px, 3.6vw, 40px);
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.lead {
    margin: 0 0 24px;
    max-width: 58ch;
    font-size: 18px;
    color: var(--ink-2);
}

.option {
    padding: 22px 24px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.option + .option {
    margin-top: 16px;
}

.option h2 {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 700;
}

.option p {
    margin: 0 0 16px;
    color: var(--ink-2);
}

.links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 24px;
}

.again {
    margin: 24px 0 0;
    font-size: 15px;
    color: var(--muted);
}

/* --------------------------------------- back from a gateway, not yet confirmed */
.confirming {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin: 0 0 16px;
    padding: 18px 20px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-left: 4px solid var(--blue);
    border-radius: var(--radius);
}

.confirming p {
    margin: 0;
    color: var(--ink-2);
}

.confirming strong {
    display: block;
    margin: 0 0 2px;
    color: var(--ink);
}

.confirming__dot {
    flex: none;
    width: 14px;
    height: 14px;
    margin-top: 5px;
    background: var(--blue);
    border-radius: 50%;
    animation: ief-pulse 1.6s ease-out infinite;
}

@keyframes ief-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(10, 143, 199, 0.45);
    }

    100% {
        box-shadow: 0 0 0 12px rgba(10, 143, 199, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .confirming__dot {
        animation: none;
    }
}

/* ----------------------------------------------------------- payments received */
.paid {
    margin: 32px 0 0;
}

.paid h2 {
    margin: 0 0 12px;
    font-size: 20px;
    font-weight: 700;
}

.paid__scroll {
    overflow-x: auto;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.paid__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.paid__table th,
.paid__table td {
    padding: 12px 14px;
    text-align: left;
    vertical-align: top;
    border-top: 1px solid var(--line-soft);
}

.paid__table thead th {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    background: var(--page);
    border-top: 0;
}

.paid__table .paid__num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.paid__nowrap {
    white-space: nowrap;
}

.paid__ref {
    min-width: 150px;
    font-size: 13px;
    color: var(--ink-2);
    overflow-wrap: anywhere;
}

/* --------------------------------------------------------- plain text pages */
.plain {
    padding: 56px 0 72px;
}

.bank {
    width: 100%;
    margin: 0 0 20px;
    border-collapse: collapse;
    font-size: 15px;
}

.bank th,
.bank td {
    padding: 10px 12px;
    text-align: left;
    border: 1px solid var(--line);
}

.bank th {
    font-weight: 600;
    background: var(--page);
}

.bank td:last-child {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.address {
    margin: 0 0 20px;
    padding-left: 16px;
    border-left: 3px solid var(--line);
    color: var(--ink-2);
}

.terms {
    padding: 48px 0 72px;
}

.terms__back {
    margin: 0 0 20px;
    font-size: 15px;
}

.terms__lead {
    margin: 0 0 8px;
    font-size: 18px;
    color: var(--ink-2);
}

.terms__meta {
    margin: 0 0 20px;
    font-size: 14px;
    color: var(--muted);
}

.terms__item {
    padding: 22px 0;
    border-top: 1px solid var(--line);
}

.terms__item h2 {
    margin: 0 0 10px;
    font-size: 19px;
    line-height: 1.3;
    font-weight: 700;
}

.terms__no {
    color: var(--blue-deep);
}

.terms__item p,
.terms__item ol,
.terms__item ul {
    margin: 0 0 10px;
    color: var(--ink-2);
}

.terms__item li {
    margin-bottom: 4px;
}

/* ------------------------------------------------------------------- footer */
.foot {
    padding: 28px 0 36px;
    font-size: 14px;
    color: var(--muted);
    background: var(--paper);
    border-top: 1px solid var(--line);
}

.foot__in {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 24px;
}

.foot p {
    margin: 0;
}

/* --------------------------------------------------------------- responsive */
@media (max-width: 960px) {
    .layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .layout > .side {
        grid-column: 1;
        grid-row: auto;
        position: static;
    }

    .review {
        grid-template-columns: minmax(0, 1fr);
        padding-top: 32px;
    }

    .petals {
        width: 200px;
        height: 200px;
        right: -60px;
        opacity: 0.5;
    }
}

@media (max-width: 640px) {
    /* Payments received: one card per payment, so the receipt link is always in view. */
    .paid__scroll {
        overflow: visible;
    }

    .paid__table thead {
        display: none;
    }

    .paid__table tr {
        display: block;
        padding: 6px 0;
        border-top: 1px solid var(--line-soft);
    }

    .paid__table tr:first-child {
        border-top: 0;
    }

    .paid__table td {
        display: flex;
        justify-content: space-between;
        gap: 16px;
        padding: 6px 14px;
        border-top: 0;
    }

    .paid__table td::before {
        content: attr(data-label);
        flex: none;
        font-size: 13px;
        font-weight: 600;
        color: var(--muted);
    }

    .paid__table .paid__num,
    .paid__ref {
        text-align: right;
    }

    .wrap {
        padding: 0 16px;
    }

    .top__in {
        flex-wrap: wrap;
        min-height: 0;
    }

    .top__logo img {
        height: 46px;
    }

    .steps {
        order: 3;
        flex-basis: 100%;
        justify-content: flex-start;
        gap: 6px 16px;
    }

    .steps li {
        font-size: 14px;
    }

    .intro {
        padding: 32px 0 24px;
    }

    .intro__lead {
        font-size: 17px;
    }

    .petals {
        display: none;
    }

    .block {
        padding: 20px 16px;
    }

    .grid-2,
    .choice {
        grid-template-columns: minmax(0, 1fr);
    }

    .purposes li {
        grid-template-columns: minmax(0, 1fr);
    }

    .money {
        max-width: none;
    }

    .send .btn {
        width: 100%;
    }

    .sheet__total strong {
        font-size: 30px;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .btn,
    .quick button,
    .choice__item {
        transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
    }
}

@media print {
    .top__home,
    .steps,
    .petals,
    .foot,
    .btn {
        display: none !important;
    }

    body {
        background: #ffffff;
    }
}
