/* ==========================================================================
   Donation landing page theme - "warm sand & ocean"
   ========================================================================== */

:root {
    --ink:          #172433;
    --ink-soft:     #45556a;
    --muted:        #758397;
    --line:         #e4e0da;

    --primary:      #1b5e8c;
    --primary-600:  #154c73;
    --primary-50:   #e9f2f9;

    --accent:       #d9693f;
    --accent-600:   #bf5530;
    --peach:        #f6c39a;
    --peach-600:    #eeab75;

    --sand:         #f3ebe2;
    --sand-deep:    #e3d2c3;
    --cream:        #fbf8f4;
    --white:        #ffffff;

    --field-bg:     #f3f4f6;
    --field-line:   #8b95a3;
    --label:        #1c6fa6;

    --danger:       #c0392b;
    --danger-50:    #fdecea;
    --success:      #2f855a;
    --warn-50:      #fff6e5;
    --warn:         #9a6200;

    --radius:       14px;
    --radius-sm:    8px;
    --shadow-sm:    0 1px 2px rgba(23, 36, 51, .06), 0 1px 3px rgba(23, 36, 51, .05);
    --shadow:       0 10px 30px -12px rgba(23, 36, 51, .18), 0 2px 6px rgba(23, 36, 51, .05);
    --shadow-lg:    0 30px 60px -20px rgba(23, 36, 51, .28);

    --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: "Fraunces", Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--cream);
    -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--primary); }
a:hover { color: var(--primary-600); }
code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .92em; }

.container      { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.container-wide { width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 24px; }
.narrow         { max-width: 760px; }
.center         { text-align: center; justify-content: center; }
.muted          { color: var(--muted); }
.small          { font-size: .875rem; }
.cap            { text-transform: capitalize; }
.req            { color: var(--danger); }

/* ---------- Typography ---------- */
.eyebrow {
    display: inline-block;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 14px;
}
.display, .display-sm {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -.01em;
    margin: 0 0 18px;
    text-wrap: balance;
}
.display    { font-size: clamp(2.3rem, 4.6vw, 3.7rem); }
.display em { font-style: italic; color: var(--accent); }
.display-sm { font-size: clamp(1.8rem, 3vw, 2.5rem); }
.lead       { font-size: 1.12rem; color: var(--ink-soft); margin: 0 0 24px; max-width: 62ch; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border: 1.5px solid transparent;
    border-radius: 999px;
    font: 600 .95rem/1 var(--font-body);
    text-decoration: none;
    cursor: pointer;
    transition: background-color .18s, border-color .18s, color .18s, transform .18s, box-shadow .18s;
}
.btn:hover   { transform: translateY(-1px); }
.btn:active  { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid var(--primary-50); outline-offset: 2px; }
.btn-sm      { padding: 9px 18px; font-size: .88rem; }
.btn-lg      { padding: 16px 30px; font-size: 1.02rem; }
.btn-block   { width: 100%; }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-600); color: var(--white); }
.btn-accent  { background: var(--accent); color: var(--white); box-shadow: 0 8px 20px -8px rgba(217, 105, 63, .7); }
.btn-accent:hover { background: var(--accent-600); color: var(--white); }
.btn-ghost   { background: transparent; color: var(--ink); border-color: rgba(23, 36, 51, .18); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-outline { background: var(--white); color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--white); }
.btn-peach   {
    background: var(--peach); color: var(--ink);
    border: 1px solid #c98b5c; border-radius: var(--radius-sm);
    padding: 12px 22px; align-self: flex-start;
}
.btn-peach:hover { background: var(--peach-600); }
.btn[disabled]   { opacity: .6; cursor: not-allowed; transform: none; }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(251, 248, 244, .86);
    backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid rgba(23, 36, 51, .06);
}
.header-inner { display: flex; align-items: center; gap: 28px; height: 104px; }
.brand {
    display: inline-flex; align-items: center; gap: 10px;
    color: var(--ink); text-decoration: none;
    font-family: var(--font-display); font-weight: 700; font-size: 1.3rem;
}
.brand:hover { color: var(--ink); }
/* The logo has a white background, so it sits on a white badge that also reads on dark pages. */
.brand-logo {
    display: block; height: 84px; width: auto;
    background: var(--white); border-radius: 14px; padding: 5px 8px;
    box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .45);
}
.header-cta { margin-left: auto; }
.header-secure {
    margin-left: auto; display: inline-flex; align-items: center; gap: 8px;
    font-size: .9rem; font-weight: 500; color: rgba(255, 255, 255, .9);
}
.header-secure svg { width: 16px; height: 16px; fill: var(--peach); }

/* Landing page: header floats over the photo. */
.is-fullscreen .site-header {
    position: absolute; left: 0; right: 0;
    background: transparent; backdrop-filter: none; border-bottom: 0;
}
.is-fullscreen .brand, .is-fullscreen .brand:hover { color: var(--white); }
.is-fullscreen .header-inner { max-width: 1400px; }
/* Soft warm glow behind the form. */
.stage::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(70% 60% at 72% 40%, rgba(255, 236, 214, .06), transparent 70%);
}
.stage > .container-wide { position: relative; }

/* ---------- Stage: one-screen landing page ---------- */
.stage {
    position: relative;
    min-height: 100vh; min-height: 100dvh;
    display: flex; align-items: center;
    padding: 112px 0 32px;
    color: var(--white);
    background:
        radial-gradient(900px 620px at 12% 18%, rgba(217, 105, 63, .30), transparent 62%),
        radial-gradient(820px 640px at 92% 88%, rgba(27, 94, 140, .55), transparent 62%),
        linear-gradient(135deg, #132130 0%, #172a3d 55%, #12283a 100%);
    background-color: var(--ink);
}
.stage-grid {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 56px; align-items: center;
}
.stage .eyebrow { color: var(--peach); }
.stage .lead    { color: rgba(255, 255, 255, .9); font-size: 1.05rem; margin-bottom: 22px; text-shadow: 0 1px 10px rgba(0, 0, 0, .35); }
.stage .display { color: var(--white); font-size: clamp(2rem, 3.3vw, 3.1rem); }
.stage .display em { color: var(--white); }

/* Painted brush stroke behind the headline. The SVG's turbulence filter roughens the edges. */
.brush-title { position: relative; display: inline-block; max-width: 100%; margin: 4px 0 22px; padding: 20px 30px 22px 26px; }
.brush-title::before {
    content: ""; position: absolute; inset: -4px -10px -10px -14px; z-index: 0;
    transform: rotate(-1.6deg);
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 240' preserveAspectRatio='none'%3E%3Cfilter id='r'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.035' numOctaves='3' seed='4'/%3E%3CfeDisplacementMap in='SourceGraphic' scale='22'/%3E%3C/filter%3E%3Cg filter='url(%23r)' fill='%23d9693f'%3E%3Cpath d='M22 40C70 16 150 30 220 20s150-12 220 2 120-8 140 20c12 30-6 52 6 80s-4 66-28 82c-60 16-140 2-210 10s-140 10-210 0-104 6-122-18c-14-28 4-56-8-84s-6-50 12-72z'/%3E%3Cpath d='M30 214h250v6H30zM330 28h220v5H330z' opacity='.55'/%3E%3C/g%3E%3C/svg%3E") center / 100% 100% no-repeat;
    opacity: .94;
}
.brush-title .display { position: relative; z-index: 1; margin: 0; }


.trust-row {
    display: flex; flex-wrap: wrap; gap: 8px 22px;
    list-style: none; padding: 0; margin: 0;
    color: rgba(255, 255, 255, .92); font-size: .9rem; font-weight: 500;
}
.trust-row li { display: inline-flex; align-items: center; gap: 8px; }
.trust-row svg { width: 17px; height: 17px; fill: var(--peach); }

/* ---------- Section (result pages) ---------- */
.section { padding: 92px 0; }

/* ---------- Donation form card ---------- */
.donate-card {
    color: var(--ink);
    background: rgba(255, 255, 255, .97);
    border-radius: 18px;
    padding: 22px 24px 18px;
    box-shadow: 0 30px 70px -24px rgba(0, 0, 0, .55);
}
.donate-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.donate-section { border: 0; padding: 0; margin: 0; min-width: 0; }
.panel-title {
    padding: 0; margin: 0 0 12px;
    color: var(--label);
    font-size: 1.02rem; font-weight: 700;
}
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.form-group { margin-bottom: 10px; }
.field {
    position: relative;
    background: var(--field-bg);
    border-radius: 6px 6px 0 0;
    border-bottom: 1px solid var(--field-line);
    transition: background-color .15s;
}
.field::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
    height: 2px; background: var(--primary);
    transform: scaleX(0); transition: transform .2s ease;
}
.field:hover { background: #eceef1; }
.field:focus-within::after, .field.is-focused::after { transform: scaleX(1); }

.field input, .field select, .field textarea, .stripe-input {
    display: block; width: 100%;
    border: 0; outline: 0; background: transparent;
    padding: 20px 12px 6px;
    font: 400 15px/1.4 var(--font-body);
    color: var(--ink);
    min-height: 48px;
}
.field select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer; }
.field--select::before {
    content: ""; position: absolute; right: 14px; top: 50%;
    border: 5px solid transparent; border-top-color: var(--ink-soft);
    margin-top: -2px; pointer-events: none;
}
.field label {
    position: absolute; left: 12px; top: 14px;
    color: var(--label); font-size: 13.5px;
    pointer-events: none; transform-origin: left top;
    transition: top .15s, font-size .15s, color .15s;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: calc(100% - 24px);
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field textarea:focus + label,
.field textarea:not(:placeholder-shown) + label,
.field.is-focused label,
.field.is-filled label {
    top: 4px; font-size: 11px;
}
.field input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px var(--field-bg) inset; }
.field input[readonly] { color: var(--ink-soft); }
.field:has(input[readonly]) { background: #f8f9fa; border-bottom-style: dashed; }

.field textarea { resize: none; min-height: 106px; }

.field--currency input { padding-left: 24px; }
.field-prefix { position: absolute; left: 12px; top: 20px; font-size: 15px; color: var(--ink); }
.field--currency label { left: 12px; }
/* Show the $ only once the amount box is in use, so it never overlaps the label. */
.field--currency:has(input:placeholder-shown:not(:focus)) .field-prefix { opacity: 0; }

.field input[type=number]::-webkit-inner-spin-button,
.field input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.field input[type=number] { -moz-appearance: textfield; }

.field-error { display: none; color: var(--danger); font-size: .78rem; margin: 3px 2px 0; }
.form-group.has-error .field { border-bottom-color: var(--danger); background: #fdf3f2; }
.form-group.has-error .field::after { background: var(--danger); }
.form-group.has-error .field label { color: var(--danger); }
.form-group.has-error .field-error { display: block; }

.donate-footer {
    display: flex; align-items: center; gap: 18px;
    margin-top: 8px; padding-top: 14px;
    border-top: 1px solid var(--line);
}
.secure-line {
    flex: 1; margin: 0; display: flex; align-items: flex-start; gap: 8px;
    font-size: .8rem; line-height: 1.45; color: var(--ink-soft);
}
.secure-line svg { width: 15px; height: 15px; fill: var(--primary); flex: none; margin-top: 2px; }
.pay-total { display: flex; flex-direction: column; align-items: flex-end; }
.pay-total-label { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.pay-total-value { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.btn-pay {
    min-width: 200px; padding: 14px 28px; border-radius: 10px;
    background: var(--accent); color: var(--white); font-size: 1rem;
    box-shadow: 0 10px 22px -10px rgba(217, 105, 63, .9);
}
.btn-pay:hover { background: var(--accent-600); color: var(--white); }
.btn-spinner {
    display: none; width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .35); border-top-color: var(--white);
    animation: spin .8s linear infinite;
}
.btn-pay.is-busy .btn-spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.alert {
    margin: 0 0 14px;
    border-radius: 10px; padding: 10px 14px; font-size: .9rem;
    background: var(--danger-50); color: var(--danger);
    border: 1px solid #f5c6c0; font-weight: 500;
}
.alert.is-warn { background: var(--warn-50); color: var(--warn); border-color: #f3d9a4; }

/* ---------- Result pages ---------- */
/* Thank-you page: the landing page's background with the receipt centred. */
.stage-center { display: flex; justify-content: center; }
.stage--result .result-card {
    width: 100%; max-width: 540px;
    padding: 28px 32px 22px;
    color: var(--ink); text-align: left;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 30px 70px -24px rgba(0, 0, 0, .55);
}
.result-head { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.result-head .eyebrow { margin-bottom: 4px; color: var(--accent); }
.result-head .display-sm { margin: 0; font-size: clamp(1.6rem, 2.4vw, 2rem); }
.stage--result .result-icon { margin: 0; flex: none; width: 56px; height: 56px; }
.stage--result .result-icon svg { width: 30px; height: 30px; }
.result-lead { margin: 0 0 16px; color: var(--ink-soft); font-size: .98rem; }
.stage--result .receipt { max-width: none; margin: 0 0 16px; padding: 4px 18px; }
.stage--result .receipt div { padding: 9px 0; }
.stage--result .hero-actions .btn { flex: 1; }
.result-note { margin: 14px 0 0; text-align: center; font-size: .85rem; color: var(--muted); }
.result-note--warn { margin: 0 0 14px; padding: 10px 12px; border-radius: 8px; background: var(--warn-50); color: var(--warn); text-align: left; }
.result-card {
    background: var(--white); border-radius: 22px; padding: 44px 40px;
    box-shadow: var(--shadow-lg); text-align: center;
}
.result-card .lead { margin-inline: auto; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.result-icon {
    display: grid; place-items: center; margin: 0 auto 18px;
    width: 70px; height: 70px; border-radius: 50%;
    background: #e6f4ec;
}
.result-icon svg { width: 36px; height: 36px; fill: var(--success); }
.result-icon--error { background: var(--danger-50); color: var(--danger); font-size: 2rem; font-weight: 700; }
.receipt {
    text-align: left; margin: 8px auto 22px; max-width: 460px;
    border: 1px solid var(--line); border-radius: 12px; padding: 8px 20px;
}
.receipt div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.receipt div:last-child { border-bottom: 0; }
.receipt dt { color: var(--ink-soft); }
.receipt dd { margin: 0; font-weight: 600; text-align: right; }
.receipt dd code { overflow-wrap: anywhere; }
.receipt-total dt, .receipt-total dd { color: var(--ink); font-size: 1.08rem; font-weight: 700; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: rgba(255, 255, 255, .78); padding: 56px 0 26px; }
.footer-inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 30px; flex-wrap: wrap; }
.brand--footer, .brand--footer:hover { color: var(--white); }
.footer-copy { margin: 12px 0 0; max-width: 40ch; }
.footer-secure { display: flex; align-items: center; gap: 10px; font-size: .92rem; }
.footer-secure svg { width: 18px; height: 18px; fill: var(--peach); }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 36px; padding-top: 20px; font-size: .85rem; color: rgba(255, 255, 255, .55); }

/* ---------- Responsive ---------- */
/* Large enough for both halves: lock the landing page to one screen. If the form ever
   grows taller than the window (e.g. several validation messages), it scrolls inside itself. */
@media (min-width: 1100px) and (min-height: 620px) {
    .is-fullscreen { height: 100vh; overflow: hidden; }
    .stage { height: 100vh; height: 100dvh; }
    .donate-card { max-height: calc(100vh - 148px); max-height: calc(100dvh - 148px); overflow-y: auto; }
}
/* The receipt card is small enough to stay on one screen at any width with a normal height. */
@media (min-height: 640px) {
    body:has(.stage--result) { height: 100vh; overflow: hidden; }
    .stage.stage--result { height: 100vh; height: 100dvh; align-items: center; padding: 108px 0 24px; }
}
@media (max-height: 760px) and (min-width: 1100px) {
    .stage .display { font-size: clamp(1.8rem, 2.8vw, 2.5rem); }
    .brush-title { margin-bottom: 16px; padding: 16px 26px 18px 22px; }
    .stage .lead { font-size: .98rem; margin-bottom: 16px; }
    .field textarea { min-height: 84px; }
}
@media (max-width: 1099px) {
    .stage { align-items: flex-start; padding-top: 120px; }
    .stage-grid { grid-template-columns: 1fr; gap: 32px; }
    .stage-copy { max-width: 680px; }
}
@media (max-width: 760px) {
    .container, .container-wide { padding: 0 16px; }
    .section { padding: 64px 0; }
    .stage { padding: 96px 0 24px; }
    .brand-logo { height: 64px; }
    .header-inner { height: 84px; }
    .brush-title { padding: 16px 18px 18px 16px; }
    .brush-title::before { inset: -2px -4px -6px -6px; }
    .donate-card { padding: 18px 16px 16px; }
    .donate-cols { grid-template-columns: 1fr; gap: 6px; }
    .donate-footer { flex-wrap: wrap; }
    .secure-line { flex-basis: 100%; }
    .pay-total { align-items: flex-start; }
    .btn-pay { min-width: 0; flex: 1; }
    .header-secure { display: none; }
    .result-card { padding: 34px 22px; }
    .stage--result .result-card { padding: 22px 18px 18px; }
    .result-head .display-sm { font-size: 1.45rem; }
    .stage--result .receipt { padding: 2px 12px; font-size: .9rem; }
}
@media (max-width: 420px) {
    .row-2 { grid-template-columns: 1fr; gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media print {
    .site-header, .site-footer, .hero-actions { display: none; }
    .result-card { box-shadow: none; }
    body:has(.stage--result) { height: auto; overflow: visible; }
    .stage--result { background: none; height: auto; min-height: 0; padding: 0; }
}
