@font-face { font-family: Onest; src: url('/assets/fonts/Onest-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: Onest; src: url('/assets/fonts/Onest-Bold.ttf') format('truetype'); font-weight: 600 800; font-display: swap; }

:root {
  color-scheme: light;
  --ink: #031c39;
  --muted: #546478;
  --line: #dedfdc;
  --control: #818c98;
  --surface: #f7f7f5;
  --accent: #d91517;
  --accent-hover: #b81113;
  --error: #a82525;
  --focus: #315c95;
  font-family: Onest, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: var(--surface);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100dvh; }
body:has(.identity-dialog[open]) { overflow: hidden; }
a { color: inherit; text-underline-offset: 3px; }
button, input { font: inherit; }
button, a { touch-action: manipulation; }
button, input, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
::selection { color: white; background: var(--ink); }
input { caret-color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.brand { background: white; border-bottom: 1px solid var(--line); }
.bar { max-width: 1000px; margin: auto; padding: 20px 32px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand a { display: inline-flex; gap: 10px; align-items: center; font-size: 16px; font-weight: 700; text-decoration: none; }
.brand img { border-radius: 7px; }
.association { color: var(--muted); font-size: 13px; }
main { width: min(100%, 532px); margin: clamp(36px, 8vh, 86px) auto 0; padding-inline: 16px; }
.panel { background: white; border: 1px solid var(--line); border-radius: 16px; min-width: 0; }
.form-panel { padding: 28px 30px; }
h1, h2, .identity-dialog p { margin: 0; }
h1 { font-size: 30px; line-height: 1.14; letter-spacing: -.035em; text-wrap: balance; }
.lead { margin: 10px 0 0; font-size: 16px; color: var(--muted); line-height: 1.5; }
footer { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px; color: var(--muted); font-size: 13px; margin: 12px auto 0; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
footer a { padding: 14px 0; }

fieldset { min-width: 0; border: 0; margin: 0; padding: 0; }
#donation-form { margin-top: 22px; }
legend, .field label { font-size: 14px; font-weight: 700; }
legend { margin-bottom: 9px; }
.amount-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.amount-option { position: relative; cursor: pointer; }
.amount-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.amount-option span { display: grid; grid-auto-flow: column; justify-content: center; align-content: center; gap: .2em; min-height: 48px; border: 1px solid var(--control); border-radius: 7px; font-size: 15px; }
.amount-option small { font-size: inherit; }
.amount-option input:checked + span { color: white; background: var(--ink); border-color: var(--ink); font-weight: 700; }
.amount-option input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.amount-options { margin-bottom: 18px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
.full { grid-column: 1/-1; }
.field label { display: block; margin-bottom: 5px; }
.optional { font-weight: 400; color: var(--muted); }
input:not([type=radio]):not([type=checkbox]) { width: 100%; min-height: 48px; border: 1px solid var(--control); border-radius: 7px; padding: 10px 12px; color: var(--ink); background: white; font-size: 16px; }
#custom-wrap { margin-top: 14px; }
.money-input { position: relative; }
.money-input input { padding-right: 54px !important; }
.money-input span { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; }
.hint, .field-error, .prefill, .notice, .payment-note, .larger-gift { font-size: 13px; line-height: 1.5; color: var(--muted); }
.hint, .field-error { margin: 6px 0 0; }
.hint { display: none; }
#custom-wrap:not([hidden]) ~ .hint { display: block; }
#custom-wrap:not([hidden]) ~ .field-grid, #amount-error:not([hidden]) ~ .field-grid { margin-top: 14px; }
.field-error { color: var(--error); }
input[aria-invalid=true] { border-color: var(--error) !important; }
.declaration { display: flex; align-items: flex-start; gap: 9px; margin: 19px 0 0; font-size: 13px; line-height: 1.5; cursor: pointer; }
.declaration input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ink); flex-shrink: 0; }
#anti-bot { max-width: 100%; overflow: hidden; }
#anti-bot:not([hidden]):not(:empty) { margin-top: 16px; }
#submit, #form-reload { margin-top: 18px; }
#manual-redirect { margin-top: 12px; }
#submit[aria-busy="true"]::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: payment-progress 900ms linear infinite;
}
@keyframes payment-progress { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) { #submit[aria-busy="true"]::before { animation: none; } }
.payment-note { margin: 8px 0 0; text-align: center; }
.larger-gift { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.primary, .secondary { display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 8px; padding: 12px 16px; width: 100%; min-height: 50px; text-align: center; font-size: 16px; font-weight: 700; line-height: 1.4; text-decoration: none; cursor: pointer; }
.primary { background: var(--accent); color: white; }
.secondary { background: white; color: var(--ink); border-color: var(--line); }
.primary:disabled, .secondary:disabled { color: #4e5c6a; background: #e6e8ea; border-color: transparent; cursor: default; }
@media (hover:hover) {
  .primary:hover:not(:disabled) { background: var(--accent-hover); }
  .secondary:hover:not(:disabled), .amount-option:hover input:not(:checked):not(:disabled) + span { background: var(--surface); }
  .copy:hover { color: var(--ink); }
}

.result-hero { text-align: center; padding: 36px 28px 0; }
.result h1 { font-size: 40px; }
.result .lead { max-width: 39ch; margin-inline: auto; }
#result-title:focus, #identity-title:focus { outline: none; }
.result-symbol { display: grid; place-items: center; margin: 0 auto 17px; width: 54px; height: 54px; border-radius: 50%; background: #eaf0f7; color: #355e80; }
.result[data-tone=success] .result-symbol { background: #e4f2eb; color: #146145; }
.result[data-tone=error] .result-symbol { background: #fcf0ee; color: var(--error); }
.result-symbol svg > * { display: none; }
.result[data-tone=success] .icon-success, .result[data-tone=error] .icon-error, .result[data-tone=waiting] .icon-waiting, .result[data-tone=neutral] .icon-neutral { display: inline; }
.result-actions { display: grid; gap: 9px; padding: 26px 38px 28px; }
.result-actions:not(:has(> :not([hidden]))) { padding: 0; margin-block-end: 24px; }
body:has(#back-to-site:not([hidden])) footer { display: none; }
body:has(#form-panel:not([hidden])) footer :is(span, a[href^="mailto:"]),
body:has(#result-help:not([hidden])) footer :is(span, a[href^="mailto:"]) { display: none; }
.receipt { border-top: 1px solid var(--line); padding: 13px 26px 22px; }
.amount-row, .ref-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 700; }
.amount-row { padding: 9px 0; }
.amount-row strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.copy { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; background: none; border: 0; padding: 0 3px; color: var(--muted); font-size: 13px; cursor: pointer; }
.receipt code { display: block; font: 13px/1.55 Onest, sans-serif; color: var(--muted); overflow-wrap: anywhere; }
.message, .identity-notice { background: var(--surface); color: var(--ink); padding: 12px 14px; border-radius: 8px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; margin: 16px 0 0; }
.result .message { margin-inline: 26px; }
.identity-notice button { display: block; min-height: 44px; padding: 4px 0; background: none; border: 0; text-decoration: underline; cursor: pointer; }
.identity-dialog { width: min(420px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow: auto; margin: auto; background: white; border: 0; border-radius: 16px; color: var(--ink); padding: 28px 24px 24px; }
.identity-dialog::backdrop { background: rgb(3 28 57 / .48); }
.identity-dialog h2 { font-size: 24px; line-height: 1.25; letter-spacing: -.025em; margin-right: 26px; }
.identity-dialog p { margin: 12px 0 20px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.identity-dialog .secondary { margin-top: 9px; }
.dialog-close { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 44px; height: 44px; color: var(--ink); border: none; background: none; border-radius: 8px; cursor: pointer; }
@media (max-width: 580px) {
  :root { background: white; }
  .bar { padding: 15px 20px; }
  .association { font-size: 11px; }
  main { margin: 0 auto; padding-inline: 20px; }
  .panel { border: 0; border-radius: 0; }
  .form-panel { padding: 26px 0 0; }
  .result-hero { padding: 44px 0 0; }
  .result h1 { font-size: 36px; }
  .result-actions { padding: 24px 0; }
  .receipt { border-bottom: 1px solid var(--line); padding: 8px 0 18px; }
  .result .message { margin-inline: 0; }
  footer { margin-top: 6px; }
  .identity-dialog { margin: auto auto max(16px, env(safe-area-inset-bottom)); }
}
@media (max-width: 359px) { .field-grid { grid-template-columns: 1fr; }.association { display: none; } }
