/* Focused donation page; shared brand tokens live in tokens.css. */
.donation-page { background: var(--bg); }
.giving-header { background: var(--white); border-bottom: 1px solid var(--line-soft); }
.giving-header .container { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 88px; max-width: 1180px; }
.giving-header .brand { max-width: 340px; }
.giving-home { color: var(--ink-600); font-size: var(--fs-sm); text-decoration: none; padding-block: var(--space-3); white-space: nowrap; }
.giving-home:hover { text-decoration: underline; }
.giving-layout { max-width: 1140px; display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: var(--layout-gap); padding-block: var(--space-7); align-items: start; }
#donate-form { margin: 0; border-color: var(--line-soft); scroll-margin-top: 20px; }
.giving-heading h2 { font-size: var(--fs-lg); margin-bottom: var(--space-1); }
.giving-heading h2:focus { outline: none; }
.giving-heading p { margin-bottom: var(--space-4); }
.checkout-notice { margin-block: 0 var(--space-5); font-size: var(--fs-xs); }
.step-description { color: var(--ink-600); font-size: var(--fs-sm); }
#donate-form .toggle { border: 0; background: var(--green-25); padding: var(--space-1); border-radius: 0; margin-bottom: var(--space-4); }
#donate-form .toggle button { border-radius: 0; min-height: 44px; font-size: var(--fs-sm); }
#donate-form .field label { text-transform: none; letter-spacing: 0; font-size: var(--fs-sm); color: var(--ink-900); }
#donate-form .field input { width: 100%; min-width: 0; background: var(--white); border: 1px solid var(--field-line); padding: var(--space-3) var(--space-3); }
#donate-form .field input:focus-visible { border-color: var(--green-800); outline: 3px solid var(--marigold-400); outline-offset: 2px; }
#donate-form .field input[aria-invalid="true"] { border-color: var(--error); }
/* The same key as every other page: its own width, centred under the form. */
#donate-form #donate-btn { display: flex; width: fit-content; min-width: min(262px, 100%); margin-inline: auto; }
#donate-form .fields-2 { grid-template-columns: minmax(0, 1fr); gap: 0; }
.giving-review { border: 1px solid var(--field-line); border-radius: 0; padding: var(--space-4); margin-top: var(--space-4); background: var(--green-25); overflow-wrap: anywhere; }
.giving-review h3 { font-size: var(--fs-md); }
.giving-review dl { margin: 0; }
.giving-review dl div { padding-block: var(--space-2); border-bottom: 1px solid var(--line-soft); }
.giving-review dt { color: var(--ink-600); font-size: var(--fs-xs); }
.giving-review dd { margin: 0; }
.giving-review p { font-size: var(--fs-sm); margin: var(--space-4) 0 0; }
.giving-footer { text-align: center; color: var(--ink-600); font-size: var(--fs-xs); padding: 0 var(--space-4) var(--space-6); }
.giving-footer a { display: block; margin-top: var(--space-1); }
@media (max-width: 799px) {
 .giving-layout { grid-template-columns: minmax(0, 1fr); max-width: 600px; padding-block: var(--space-5); gap: var(--space-5); }
 .giving-header .container { min-height: 76px; gap: var(--space-3); }
 .giving-header .brand { font-size: var(--fs-xs); gap: var(--space-2); }
 .giving-header .brand img { width: 36px; height: 36px; }
 .giving-home { font-size: var(--fs-xs); white-space: normal; min-width: 72px; }
 #donate-form { padding: var(--space-5) var(--space-4); border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Long custom amounts and translated text must wrap within the card. */
.giving-summary { flex-wrap: wrap; }
.giving-summary strong { overflow-wrap: anywhere; min-width: 0; }
.giving-summary button { font: inherit; color: var(--green-800); }
.giving-header .brand { min-width: 0; }

/* Checkout states use the same type and spacing tokens as the rest of the site. */
#donate-form .toggle small { display: block; font-size: var(--fs-xs); line-height: var(--lh-snug); }
#donate-form [aria-disabled="true"] { color: var(--ink-600); cursor: not-allowed; }
#donate-form .giving-review { margin-top: 0; }
.text-button { font: inherit; font-size: var(--fs-sm); border: 0; background: transparent; color: var(--green-800); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; min-height: 44px; padding: var(--space-2) 0; }
button:disabled { background: var(--paper-shade); border-color: var(--line); color: var(--ink-600); cursor: wait; }
/* Confirmation: one centred card over the same cow video, with the amount as the hero and a compact receipt slip. */
.confirmation-main { display: flex; flex: 1 1 auto; align-items: center; justify-content: center; max-width: 1240px; padding-block: var(--space-3); }
.confirmation-card { width: min(100%, 520px); padding: var(--space-6) var(--space-5) var(--space-5); border-radius: var(--radius-soft); background: var(--paper); color: var(--ink); text-align: center; }
.confirmation-card p { max-width: none; }
.confirmation-art { width: 128px; height: 128px; margin: calc(var(--space-2) * -1) auto var(--space-2); }
.confirmation-art canvas { display: block; width: 100%; height: 100%; }
.confirmation-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto var(--space-3); color: var(--green-800); background: var(--paper-3); border-radius: 50%; font-size: var(--fs-xl); font-weight: 700; }
.confirmation-icon[hidden], .confirmation-art[hidden] { display: none; }
[data-status="failed"] .confirmation-icon { color: var(--accent); }
.confirmation-card h1 { margin: 0 auto var(--space-3); max-width: 18ch; color: var(--green-800); font-size: var(--fs-xl); line-height: 1.12; text-wrap: balance; }
.confirmation-card h1.is-thanks { max-width: none; text-wrap: initial; }
.thanks-lead { display: block; font-size: var(--fs-xl); line-height: 1.1; }
.thanks-gift { display: block; margin-top: var(--space-1); font-size: var(--fs-lg); line-height: 1.2; text-wrap: balance; }
.thanks-amount { color: var(--accent); white-space: nowrap; }
.thanks-detail { display: block; max-width: 42ch; margin: var(--space-3) auto 0; color: var(--ink-600); font: 400 var(--fs-sm)/1.55 var(--font-body); letter-spacing: normal; text-wrap: pretty; overflow-wrap: anywhere; }
.thanks-detail strong { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
/* The receipt arrives by email only, so this line is the main message under the thanks. */
.receipt-email { margin: var(--space-4) auto var(--space-2); max-width: 36ch; color: var(--ink-600); font-size: var(--fs-base); line-height: 1.5; text-align: center; text-wrap: pretty; overflow-wrap: anywhere; }
/* The address is what the donor must check, so it is larger and in Mukta ExtraBold (Lato stops at Bold). */
.receipt-email strong { color: var(--ink); font: 800 var(--fs-md)/1.3 var(--font-deva); }
.receipt-email:empty { display: none; }
.confirmation-message { margin: 0 auto var(--space-2); color: var(--ink); font-size: var(--fs-base); }
.confirmation-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
.confirmation-actions[hidden] { display: none; }
.confirmation-actions { align-items: center; }
.confirmation-actions .btn--donate { flex: 1 1 100%; }
.give-again { display: inline-flex; align-items: center; min-height: 44px; margin-top: var(--space-1); color: var(--green-800); font-size: var(--fs-sm); font-weight: 700; text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: .3em; }
.give-again:hover { text-decoration-color: currentColor; }
.confirmation-actions .btn[hidden] { display: none; }
.confirmation-error { margin: var(--space-2) 0 0; color: var(--error); font-size: var(--fs-sm); }
.confirmation-error:empty { display: none; }
@media (max-width: 599px) {
  .confirmation-card { padding: var(--space-5) var(--space-4) var(--space-4); }
  .confirmation-art { width: 112px; height: 112px; }
  .confirmation-actions { flex-direction: column; align-items: center; }
  .confirmation-actions .btn { flex: 0 0 auto; width: 100%; }
  .confirmation-actions .btn.btn--ghost { align-self: center; }
}
@media (max-height: 700px) {
  .confirmation-art { width: 96px; height: 96px; }
  .confirmation-card { padding-block: var(--space-4); }
}

/* The donation page's video ground: the cow fills the page and one centred form, holding the petal bloom, sits over it.
   donate.html and confirmation.html carry .giving-video. */
.giving-video { background: var(--night); color: var(--on-night); }
.giving-backdrop, .giving-wash { position: fixed; inset: 0; width: 100%; height: 100lvh; z-index: 0; pointer-events: none; }
.giving-backdrop { object-fit: cover; object-position: 50% 40%; background: var(--night); }
.giving-wash { background: color-mix(in srgb, var(--night) 58%, transparent); }
.giving-wash::after { content: ""; position: absolute; inset: 0; background: var(--night); opacity: var(--giving-dim, 0); }
.giving-video > :not(.giving-backdrop, .giving-wash, .skip, dialog) { position: relative; z-index: 1; }
.giving-video .giving-header { background: transparent; border-bottom: 0; }
.giving-video .giving-header .container { max-width: 1240px; }
.giving-video .giving-header .brand { color: var(--on-night-strong); }
.giving-video .giving-header .brand img { border-radius: 50%; }
.giving-video .giving-home { color: var(--on-night-strong); }
.giving-video .image-note, .giving-video .image-note a { color: var(--on-night-muted); font-size: var(--fs-xs); }
.giving-video #bowl-stage:not([hidden]) { display: grid; }
body.giving-video #donate-form { color: var(--ink); border-radius: var(--radius-soft); border: 0; outline: 0; box-shadow: none; }

.bowl-stage { text-align: center; }
#giving-choice .field label { text-align: center; }
#donate-form #custom { font: 700 var(--fs-xl)/1.2 var(--font-head); text-align: center; font-variant-numeric: tabular-nums; }
.bowl-box { position: relative; width: min(100%, 300px); aspect-ratio: 1; margin-inline: auto; }
#bowl-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#bowl-canvas { touch-action: pan-y; cursor: pointer; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }

/* One frame: the page is exactly as tall as the screen and the petal bloom takes the height left over.
   A screen too small for the fields still scrolls, because the fields keep their size and nothing is clipped. */
body.giving-video { display: flex; flex-direction: column; height: 100dvh; }
.giving-video .giving-header .container { min-height: 56px; }
.giving-video .giving-header .brand img { width: 32px; height: 32px; }
.giving-video main.giving-layout { display: flex; flex: 1 1 auto; align-items: stretch; justify-content: center; max-width: 1240px; padding-block: 0; }
.giving-video .giving-panel { display: flex; flex-direction: column; justify-content: center; width: min(100%, 620px); }
.giving-video #donate-form { display: flex; flex-direction: column; padding: var(--space-4); }
.giving-video #donate-form p { max-width: none; }
.giving-video .giving-heading h2 { font-size: var(--fs-md); margin: 0 0 var(--space-2); text-align: center; }
.giving-video #checkout-mode:not(.sr-only) { margin: 0 0 var(--space-2); padding: var(--space-1) var(--space-2); font-size: var(--fs-xs); line-height: var(--lh-snug); text-align: center; }
.giving-video #giving-choice:not([hidden]) { display: flex; flex-direction: column; }
.giving-video .amount-field { margin: 0; }
.amount-picks { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); margin-top: var(--space-2); }
.amount-picks button { min-height: 40px; padding: 0 var(--space-3); border: 1px solid var(--green-100); border-radius: var(--radius-pill); background: var(--green-100); color: var(--green-800); font: 700 var(--fs-sm)/1 var(--font-body); font-variant-numeric: tabular-nums; cursor: pointer; touch-action: manipulation; transition: background-color .15s, color .15s; }
.amount-picks button:hover { border-color: var(--green-800); }
.amount-picks button[aria-pressed="true"] { background: var(--green-800); border-color: var(--green-800); color: var(--white); }
.amount-picks button:focus-visible { outline: 3px solid var(--marigold-400); outline-offset: 2px; }
#donate-form #donate-btn[aria-disabled="true"] { background: var(--paper-shade); border-color: var(--paper-shade); color: var(--ink-600); box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .amount-picks button { transition: none; } }
#donate-form #custom { min-height: 52px; padding-block: 0; font-size: var(--fs-lg); -moz-appearance: textfield; appearance: textfield; }
#donate-form #custom::-webkit-outer-spin-button, #donate-form #custom::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.giving-video #bowl-stage:not([hidden]) { grid-template-rows: auto auto auto auto; }
.giving-video #bowl-stage #donate-btn { margin-block: var(--space-3) var(--space-2); }
.bowl-caption { margin: var(--space-1) 0 0; color: var(--green-800); font-size: var(--fs-xs); font-weight: 700; }
/* The card starts small and grows with the flower: the flower is drawn at one fixed size, and the well around it
   is only as tall as the flower needs (set by giving-bowl.js), so the card wraps it at every amount. */
.bowl-well { position: relative; overflow: clip; height: 120px; transition: height .5s cubic-bezier(.2, .8, .2, 1); }
.bowl-well .bowl-box { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: min(100%, max(220px, calc(100dvh - 330px)), 560px); }
@media (prefers-reduced-motion: reduce) { .bowl-well { transition: none; } }
.bowl-note { margin: 0; color: var(--green-800); font-size: var(--fs-xs); font-weight: 700; }
.bowl-note:empty { display: none; }
.giving-video #donate-form #donate-btn { flex: 0 0 auto; margin-top: var(--space-3); }
.giving-video .form-msg { margin-top: var(--space-2); }
.giving-video .form-msg:empty { display: none; }
/* Cloudflare Turnstile: takes no space unless Cloudflare asks the donor to tick the box. */
.human-check { display: flex; justify-content: center; }
.giving-video #giving-details .field { margin-bottom: var(--space-2); }
.giving-video .giving-review { padding: var(--space-3); }
.giving-video .giving-review h3 { font-size: var(--fs-base); margin-bottom: var(--space-1); }
.giving-video .giving-review p { font-size: var(--fs-xs); line-height: var(--lh-snug); margin: 0; }
.giving-video .giving-review dl { margin-top: var(--space-1); }
.giving-video .giving-review dl div { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 var(--space-3); padding-block: var(--space-1); }
.giving-video .giving-review dd { font-size: var(--fs-sm); font-weight: 700; text-align: right; }
.giving-video .giving-review .text-button { min-height: 32px; padding-block: 0; }
.giving-trust { flex: 0 0 auto; padding: var(--space-2) var(--space-4); text-align: center; color: var(--on-night); font-size: var(--fs-xs); line-height: var(--lh-snug); }
.giving-trust p { max-width: none; margin: 0; }
.giving-trust span { white-space: nowrap; }
.giving-video .giving-summary { padding: var(--space-2) var(--space-3); margin-bottom: var(--space-2); }
.giving-video #giving-details .step-description { display: none; }
.giving-video #giving-details .note { margin-top: 0; line-height: var(--lh-snug); }
.giving-video #giving-details .field input { padding-block: var(--space-2); }
@media (min-width: 560px) { .giving-video #donate-form .fields-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-3); } }
/* Short screens give up the label's own line and a little padding before they give up the bloom. */
@media (max-height: 720px) {
  .giving-video .giving-header .container { min-height: 44px; }
  .giving-video #donate-form { padding: var(--space-3); }
  .giving-video .giving-heading h2 { margin-bottom: var(--space-1); font-size: var(--fs-base); }
  .giving-video .amount-field label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .giving-video #donate-form #donate-btn { min-height: 48px; margin-top: var(--space-2); }
  .giving-trust { padding-block: var(--space-1); }
}
.giving-trust a { color: var(--on-night-strong); }

@media (max-width: 799px) {
  .giving-backdrop { object-position: 74% 40%; }
  .giving-video .giving-header .container { min-height: 44px; }
  .giving-video .giving-header .brand img { width: 28px; height: 28px; }
  .giving-video .giving-header .brand { color: var(--on-night-strong); font-size: var(--fs-xs); line-height: var(--lh-snug); }
  .giving-video .giving-home { min-width: 0; white-space: nowrap; }
  .giving-video #donate-form { padding: var(--space-3); }
  .giving-video .amount-picks { gap: var(--space-1); }
  .giving-video .amount-picks button { flex: 1 1 0; padding-inline: var(--space-1); }
  .giving-trust { padding: var(--space-2) var(--space-4); text-align: center; }
  #donate-form #custom::placeholder { font-size: var(--fs-base); }
}

/* Custom amount: no border or outline; a soft inner shadow makes it read as a well.
   Focus deepens the shadow so keyboard users still see where they are. */
#donate-form #custom, #donate-form #custom:focus, #donate-form #custom:focus-visible { border: 0; outline: 0; background: var(--white, #fff); }
#donate-form #custom { box-shadow: inset 0 2px 6px rgb(28 43 29 / .14), inset 0 0 0 1px rgb(28 43 29 / .05); transition: box-shadow .2s ease; }
#donate-form #custom:focus, #donate-form #custom:focus-visible { box-shadow: inset 0 2px 9px rgb(28 43 29 / .24), inset 0 0 0 1px rgb(28 43 29 / .08); }

/* "Back to site": a frosted pill over the video backdrop, with a chevron that nudges left on hover. */
.giving-video .giving-home {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0; min-height: 40px;
  padding: 8px 16px 8px 11px; border-radius: 999px; white-space: nowrap;
  color: var(--on-night-strong); font-size: var(--fs-sm); font-weight: 700; letter-spacing: .01em; text-decoration: none;
  background: rgb(255 255 255 / .12); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .22), 0 4px 14px rgb(0 0 0 / .18);
  -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2);
  transition: background-color .2s ease, box-shadow .2s ease;
}
.giving-video .giving-home:hover { text-decoration: none; background: rgb(255 255 255 / .2); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .34), 0 6px 18px rgb(0 0 0 / .22); }
.giving-video .giving-home:focus-visible { outline: 3px solid var(--marigold-400); outline-offset: 3px; }
.giving-home__icon { flex: none; transition: transform .2s ease; }
.giving-home:hover .giving-home__icon { transform: translateX(-2px); }
@media (prefers-reduced-motion: reduce) { .giving-home__icon { transition: none; } }

/* The Back to site pill keeps its own width; the trust name beside it wraps instead. */
.giving-video .giving-home { flex: none; }
/* Tablets and phones: the card keeps 20px of padding so its fields never crowd its edges. */
@media (max-width: 799px) {
  .giving-video #donate-form { padding: var(--space-5) 1.25rem; }
}
/* Phones: more breathing room so the header, the card and its fields never crowd the screen edges. */
@media (max-width: 599px) {
  body.giving-video { --gutter: 1.25rem; }
  .giving-video .giving-header .container { padding-inline: var(--gutter); gap: var(--space-3); }
  .giving-video .giving-header .container { min-height: 60px; }
  .giving-video main.giving-layout { padding-inline: var(--gutter); }
  .giving-video #donate-form { padding: var(--space-5) 1.25rem; }
  .giving-video .giving-home { min-height: 36px; padding: 6px 14px 6px 10px; font-size: var(--fs-xs); }
  .giving-video .amount-picks { gap: var(--space-2); }
  .giving-trust { padding-inline: var(--gutter); }
}

/* Trust lines: registration under the amounts; secure payment and receipt in a shaded box at the final button;
   a contact email on every step. Each is one short line so the card stays calm. */
.giving-registration { margin: var(--space-3) 0 0; color: var(--ink-600); font-size: var(--fs-xs); line-height: var(--lh-snug); text-align: center; }
.giving-registration a, .giving-contact a { color: var(--green-800); }
.giving-assure { margin-top: var(--space-3); padding: var(--space-2) var(--space-3); border-radius: var(--radius-soft); background: var(--green-100); color: var(--green-800); font-size: var(--fs-xs); line-height: var(--lh-snug); text-align: center; }
.giving-assure[hidden] { display: none; }
.giving-assure p { margin: 0; max-width: none; }
.giving-assure__secure { display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 700; }
.giving-assure__secure svg { flex: none; }
.giving-assure__receipt { margin-top: 2px !important; color: var(--ink-600); }
.giving-contact { margin: var(--space-2) 0 0; color: var(--ink-600); font-size: var(--fs-xs); text-align: center; }
.giving-address { margin: var(--space-1) 0 0; color: var(--ink-600); font-size: var(--fs-xs); font-style: normal; text-align: center; }
.giving-registration .nowrap { white-space: nowrap; }
/* Where your gift goes: three photo tiles (fodder, medical, shelter) at the top of the amount step. */
.giving-uses { margin: var(--space-4) 0 0; padding-top: var(--space-4); border-top: 1px solid rgb(28 43 29 / .1); }
.giving-uses__title { margin: 0 0 var(--space-2); color: var(--ink-600); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; text-align: center; }
.giving-uses__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.giving-uses__list li { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.giving-uses__list img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-soft, 10px); box-shadow: 0 2px 8px rgb(0 0 0 / .14); }
.giving-uses__list span { color: var(--ink-600); font-size: var(--fs-xs); font-weight: 600; line-height: 1.25; text-align: center; }
@media (max-height: 720px) { .giving-uses__list img { aspect-ratio: 16 / 9; } }

/* Frosted glass card over the background video. 80% white with a strong blur keeps every text colour in the
   card at WCAG AA (4.5:1) even over the darkest frame; the card's grey text is a shade darker to make that hold.
   Fields and buttons stay solid. Browsers without backdrop-filter get a solid card. */
body.giving-video #donate-form, body.giving-video .confirmation-card {
  --ink-600: #3D4A38; --error: #8E2412; --appeal-accent: #933507;
  background: rgb(255 255 255 / .8);
  -webkit-backdrop-filter: blur(22px) saturate(1.4); backdrop-filter: blur(22px) saturate(1.4);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .55), 0 18px 48px rgb(0 0 0 / .32);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  body.giving-video #donate-form, body.giving-video .confirmation-card { background: var(--white, #fff); }
}
