/* ==========================================================================
   Donation form v3
   One centred column, three clear steps (gift, details, payment), 44px+ touch
   targets, and no layout jumps. Works from 320px phones to wide desktops.
   Class names that the JavaScript builds or toggles are kept as they were:
   .hp-freq, .hp-combo, .hp-amt, [data-hp-*] hooks.
   ======================================================================== */

/* ---- Page frame ------------------------------------------------------- */
.hp-single--donate #give{padding-block:clamp(1.25rem,3.5vw,2.5rem) clamp(3rem,7vw,5rem);scroll-margin-top:4.5rem}
.hp-single--donate #give .hp-section-head{margin-inline:auto;text-align:center;margin-bottom:clamp(.9rem,2.2vw,1.4rem)}
.hp-single--donate #give .hp-section-head h2{font-size:clamp(1.5rem,3.2vw,2.1rem)}
.hp-single--donate #give .hp-section-intro{margin-inline:auto}
.hp-single--donate .hp-trustrow{gap:.5rem 1.4rem;margin-top:1rem}

/* ---- The card ---------------------------------------------------------- */
form.hp-donate-form.hp-formcard{max-width:1000px;margin-inline:auto;padding:clamp(1rem,3.5vw,2rem);container-type:inline-size;container-name:hpdf;scroll-margin-top:4.5rem}
.hp-donate-testmode{margin-bottom:1rem}

/* ---- Steps ------------------------------------------------------------- */
.hp-dstep{margin:0 0 1.25rem;padding:0 0 1.25rem;border-bottom:1px solid var(--hp-line)}
.hp-dstep:last-of-type{margin-bottom:0;padding-bottom:0;border-bottom:0}
.hp-dstep__title{display:flex;align-items:center;gap:.65rem;margin:0 0 .9rem;font-family:var(--hp-head);font-size:1.08rem;line-height:1.2;font-weight:700;color:var(--hp-ink)}
.hp-dstep__n{flex:0 0 auto;display:inline-grid;place-content:center;width:1.7rem;height:1.7rem;border-radius:50%;background:var(--hp-red);color:#fff;font-size:.85rem;font-weight:700;line-height:1}
.hp-sublabel{margin:0 0 .55rem;font-size:.92rem;font-weight:600;color:var(--hp-ink)}

/* ---- Give once / monthly ---------------------------------------------- */
.hp-freq{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;margin:0 0 .9rem;background:var(--hp-mist);border:1px solid var(--hp-line);border-radius:999px}
.hp-freq__opt{appearance:none;border:0;background:transparent;border-radius:999px;padding:.6rem 1rem;min-height:44px;font:inherit;font-weight:600;color:var(--hp-ink);cursor:pointer;transition:background .2s ease,color .2s ease}
.hp-freq__opt:hover:not(.is-on){background:#fff}
.hp-freq__opt.is-on{background:var(--hp-red);color:#fff}
.hp-monthly-info{margin:-.25rem 0 .9rem;padding:.65rem .9rem;border:1px solid var(--hp-line);border-left:4px solid var(--hp-red);border-radius:10px;background:var(--hp-mist);font-size:.9rem;line-height:1.5}
.hp-monthly-info p{margin:0}

/* ---- Preset amounts: fixed grid so nothing jumps when the set changes --- */
.hp-donate-form .hp-donate-amounts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.5rem;margin:0 0 .9rem;min-height:calc(2 * 46px + .5rem);align-content:start}
@container hpdf (min-width:520px){.hp-donate-form .hp-donate-amounts{grid-template-columns:repeat(5,minmax(0,1fr));min-height:46px}}
.hp-donate-form .hp-amt{min-height:46px;padding:.5rem .35rem;border:1.5px solid var(--hp-line);border-radius:12px;background:#fff;font-size:.95rem;font-weight:700;font-variant-numeric:tabular-nums;color:var(--hp-ink);text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hp-donate-form .hp-amt:hover{border-color:var(--hp-red)}
.hp-donate-form .hp-amt.is-on{background:var(--hp-red);border-color:var(--hp-red);color:#fff;box-shadow:0 8px 18px -10px rgba(164,0,0,.7)}
@media(max-width:480px){.hp-single--donate #give .hp-wrap{padding-inline:.75rem}}
@media(max-width:400px){.hp-donate-form .hp-amt{padding-inline:.15rem;font-size:.85rem;letter-spacing:-.01em}}

/* ---- Currency + amount ------------------------------------------------- */
.hp-amount-row{display:grid;grid-template-columns:minmax(0,1fr);gap:.75rem 1rem;align-items:start}
@container hpdf (min-width:520px){.hp-amount-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}}
.hp-donate-form .hp-amount-row .hp-field{margin:0;gap:0}
.hp-donate-form .hp-amount-row .hp-field > label{margin-bottom:.4rem}
.hp-currency{position:relative}
.hp-combo{position:relative}

.hp-donate-form .hp-currency select,
.hp-donate-form .hp-combo__input,
.hp-donate-form .hp-amount__control input[type=text]{min-height:50px}
.hp-donate-form input.hp-combo__input{width:100%;padding-right:2.4rem;cursor:pointer;text-overflow:ellipsis;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23A40000' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 1rem center}
.hp-combo__list{position:absolute;z-index:30;left:0;right:0;top:100%;margin:6px 0 0;padding:4px;max-height:min(16rem,50vh);overflow:auto;overscroll-behavior:contain;list-style:none;background:#fff;border:1px solid var(--hp-line);border-radius:12px;box-shadow:0 16px 36px -12px rgba(20,0,0,.25)}
.hp-combo__list li{padding:.7rem .85rem;min-height:44px;display:flex;align-items:center;border-radius:8px;cursor:pointer;font-size:.95rem;line-height:1.3}
.hp-combo__list li:hover,.hp-combo__list li.is-active{background:var(--hp-mist)}
.hp-combo__list li[aria-selected="true"]{font-weight:700;color:var(--hp-deep)}

.hp-amount__control{position:relative}
.hp-amount__code{position:absolute;z-index:1;left:.55rem;top:50%;transform:translateY(-50%);padding:.3rem .55rem;border-radius:8px;background:var(--hp-mist);border:1px solid var(--hp-line);font-size:.8rem;font-weight:700;letter-spacing:.02em;color:var(--hp-deep);pointer-events:none}
.hp-donate-form .hp-amount__control input[type=text]{padding-left:4.4rem;font-size:1.25rem;font-weight:700;font-variant-numeric:tabular-nums}

/* Messages under the amount: take no space while empty */
.hp-donate-form .hp-field .hp-amt-err{display:block;margin:0;color:#b3262d;font-size:.85rem;font-weight:600;line-height:1.4}
.hp-donate-form .hp-field .hp-amt-err:not(:empty){margin-top:.45rem}
.hp-amt-note{display:block;color:#5a4a4a;font-size:.82rem;line-height:1.4}
.hp-amt-note:not(:empty){margin-top:.35rem}

.hp-donate-summary{margin:0;font-weight:700;color:var(--hp-ink);line-height:1.4}
.hp-donate-summary:not(:empty){margin-top:.8rem;padding:.6rem .9rem;background:var(--hp-mist);border:1px solid var(--hp-line);border-radius:12px}
.hp-donate-rates{margin:0;font-size:.82rem;line-height:1.5;color:#5a4a4a}
.hp-donate-rates:not(:empty){margin-top:.45rem}

/* ---- Your details ------------------------------------------------------ */
.hp-donate-form .hp-field{margin:0 0 .85rem}
.hp-donate-form .hp-field-row{display:grid;grid-template-columns:minmax(0,1fr);gap:.85rem}
@container hpdf (min-width:520px){.hp-donate-form .hp-field-row{grid-template-columns:repeat(2,minmax(0,1fr));gap:.85rem 1rem}}
.hp-donate-form .hp-field-row .hp-field{margin:0}
.hp-donate-form .hp-anon:has(+ [hidden]){margin-bottom:0}
.hp-donate-form input[type=text],
.hp-donate-form input[type=email]{min-height:48px}
.hp-field__hint{margin-left:.3rem;font-size:.82rem;font-weight:400;color:#6b5a5a}
.hp-donate-form input,.hp-donate-form select{scroll-margin-top:7rem}

/* Errors */
.hp-donate-form .hp-err{color:#b3262d;font-size:.85rem;font-weight:600;line-height:1.4;margin-top:.4rem}
.hp-donate-form input[aria-invalid="true"]{border-color:#e5484d;box-shadow:0 0 0 3px rgba(229,72,77,.14)}
.hp-donate-form .hp-consent-err{margin:-.3rem 0 .7rem}

/* ---- Checkboxes: one look for every box in the form ------------------- */
.hp-donate-form input[type=checkbox]{appearance:none;-webkit-appearance:none;flex:0 0 auto;display:grid;place-content:center;width:22px;height:22px;margin:.1rem 0 0;border:2px solid #9c8383;border-radius:6px;background:#fff;cursor:pointer;transition:background .15s ease,border-color .15s ease}
.hp-donate-form input[type=checkbox]::before{content:"";width:11px;height:6px;border-left:2.5px solid #fff;border-bottom:2.5px solid #fff;transform:rotate(-45deg) scale(0);transition:transform .15s ease;margin-top:-2px}
.hp-donate-form input[type=checkbox]:checked{background:var(--hp-red);border-color:var(--hp-red)}
.hp-donate-form input[type=checkbox]:checked::before{transform:rotate(-45deg) scale(1)}
.hp-donate-form input[type=checkbox]:focus-visible{outline:3px solid var(--hp-deep);outline-offset:2px}

.hp-donate-form .hp-anon label,
.hp-donate-form .hp-recurring-consent label{display:flex;gap:.75rem;align-items:flex-start;padding:.9rem 1rem;border:1.5px solid var(--hp-line);border-radius:12px;background:#fff;cursor:pointer;font-size:.95rem;font-weight:500;line-height:1.45}
.hp-donate-form .hp-anon label:has(input:checked),
.hp-donate-form .hp-recurring-consent label:has(input:checked){border-color:var(--hp-red);background:var(--hp-mist)}
.hp-anon small{display:block;margin-top:.15rem;font-size:.85rem;font-weight:400;color:#6b5a5a}
.hp-donate-form .hp-recurring-consent{margin:.75rem 0 0}

.hp-donate-form .hp-consent{margin:.9rem 0 .6rem;font-size:.9rem;line-height:1.5;color:#4a3a3a;cursor:pointer}
.hp-donate-form .hp-consent a{color:var(--hp-deep)}

/* ---- Pay with ---------------------------------------------------------- */
.hp-donate-form .hp-radiogroup{margin:0}
.hp-donate-form .hp-radiogroup legend{padding:0;margin:0 0 .6rem;font-size:.92rem;font-weight:600;color:var(--hp-ink)}
.hp-donate-form .hp-gateways{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(13rem,100%),1fr));gap:.5rem}
.hp-donate-form .hp-gateway{display:flex;align-items:center;gap:.75rem;min-height:54px;padding:.55rem .9rem;border:1.5px solid var(--hp-line);border-radius:12px;background:#fff;font-size:.95rem;font-weight:600;line-height:1.25;cursor:pointer;transition:border-color .15s ease,background .15s ease}
.hp-donate-form .hp-gateway:hover{border-color:var(--hp-red)}
.hp-donate-form .hp-gateway input[type=radio]{flex:0 0 auto;width:20px;height:20px;margin:0;accent-color:var(--hp-red);cursor:pointer}
.hp-donate-form .hp-gateway:has(input:checked){border-color:var(--hp-red);background:var(--hp-mist);box-shadow:inset 0 0 0 1px var(--hp-red)}
.hp-donate-form .hp-gateway:has(input:focus-visible){outline:3px solid var(--hp-deep);outline-offset:2px}
.hp-donate-form .hp-gateway--bank svg{width:22px;height:22px}
.hp-donate-form .hp-bank{margin:1rem 0 0}

/* ---- Security check, submit, messages --------------------------------- */
.hp-donate-form .hp-ts{margin:0 0 .75rem;max-width:100%;overflow:hidden}
.hp-donate-form .hp-donate-submit{display:flex;align-items:center;justify-content:center;width:100%;min-height:56px;margin-top:.25rem;padding:.8rem 1.5rem;font-size:1.08rem;font-weight:700;background:var(--hp-red);color:#fff;border:2px solid var(--hp-red)}
.hp-donate-form .hp-donate-submit:disabled{opacity:.6;cursor:not-allowed;transform:none}
.hp-donate-submit[aria-busy="true"]{opacity:.75;cursor:progress}
.hp-donate-msg{margin:0;font-size:.95rem;line-height:1.45}
.hp-donate-msg:not(:empty){margin-top:.8rem}
.hp-donate-msg.is-error:not(:empty){padding:.75rem 1rem;border:1px solid #f2c0c4;border-radius:10px;background:#fdeef0;color:#b3262d;font-weight:600}
.hp-donate-msg.is-info:not(:empty){padding:.7rem 1rem;border:1px solid var(--hp-line);border-radius:10px;background:var(--hp-mist);color:var(--hp-ink);font-weight:600}
.hp-donate-secure{margin:.8rem 0 0;font-size:.78rem;line-height:1.5;color:#5a4a4a;text-align:center}

/* ---- Focus + misc ------------------------------------------------------ */
.hp-freq__opt:focus-visible,.hp-amt:focus-visible,.hp-combo__input:focus-visible{outline:3px solid var(--hp-deep);outline-offset:2px}
[hidden]{display:none!important}
.hp-manage-giving{max-width:560px;margin:0 auto}

/* ---- Small phones ------------------------------------------------------ */
@media(max-width:400px){
  form.hp-donate-form.hp-formcard{padding:1.1rem 1rem}
  .hp-dstep{margin-bottom:1.4rem;padding-bottom:1.4rem}
  .hp-donate-form .hp-amount__control input[type=text]{font-size:1.15rem;padding-left:4.1rem}
}

@media(prefers-reduced-motion:reduce){.hp-donate-form *{transition:none!important}}


/* ==========================================================================
   v1.27 One-screen layout, step-by-step on small screens, and form guards
   - Wide card (760px of content or more): gift and details sit side by side,
     payment runs underneath in two columns. About one screen tall.
   - Narrow card, or a phone: the script turns on .is-wizard and shows one
     step at a time with a progress bar, so no step needs scrolling.
   - Without JavaScript the three steps simply stack.
   ======================================================================== */

/* Hidden trap field: invisible to people, tempting to scripts */
.hp-hpot{position:absolute!important;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden}

.hp-dwrap{display:block}
.hp-dpay{display:block}

@container hpdf (min-width:760px){
  .hp-dwrap{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:clamp(1.5rem,4cqw,3rem);align-items:start}
  .hp-dstep{margin:0;padding:0;border-bottom:0}
  .hp-dstep--pay{grid-column:1 / -1;margin-top:1.1rem;padding-top:1.1rem;border-top:1px solid var(--hp-line)}
  .hp-dpay{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:clamp(1.5rem,4cqw,3rem);align-items:start}
  .hp-donate-form.is-bank .hp-dpay{grid-template-columns:minmax(0,1fr)}
  .hp-donate-form .hp-dpay__a > :last-child{margin-bottom:0}
  .hp-donate-form .hp-amount-row{grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr)}
  .hp-donate-form .hp-ts{margin-top:0}
  .hp-donate-form .hp-dstep--details .hp-field-row{grid-template-columns:minmax(0,1fr)}
  .hp-donate-form.is-bank .hp-dwrap{grid-template-columns:minmax(0,1fr)}
}

/* Wizard (phones and narrow spaces) */
.hp-wiz{margin:0 0 1rem}
.hp-wiz__label{margin:0 0 .45rem;font-size:.9rem;font-weight:700;color:var(--hp-ink)}
.hp-wiz__bar{height:6px;border-radius:999px;background:var(--hp-line);overflow:hidden}
.hp-wiz__bar span{display:block;height:100%;width:34%;border-radius:999px;background:var(--hp-red);transition:width .25s ease}
.hp-wiz__nav{display:flex;gap:.6rem;margin-top:1rem}
.hp-wiz__btn{appearance:none;flex:1 1 0;min-height:52px;padding:.7rem 1rem;border-radius:12px;font:inherit;font-weight:700;font-size:1rem;cursor:pointer;border:2px solid var(--hp-red);transition:background .15s ease,color .15s ease}
.hp-wiz__back{background:#fff;color:var(--hp-red)}
.hp-wiz__back:hover{background:var(--hp-mist)}
.hp-wiz__next{background:var(--hp-red);color:#fff}
.hp-wiz__btn[hidden]{display:none!important}
.hp-wiz__btn:focus-visible{outline:3px solid var(--hp-deep);outline-offset:2px}
.hp-donate-form.is-wizard .hp-dstep{display:none;margin:0;padding:0;border:0}
.hp-donate-form.is-wizard .hp-dstep.is-current{display:block}
.hp-donate-form.is-wizard .hp-dstep__n{display:none}
.hp-donate-form.is-wizard .hp-dstep__title{display:none}
.hp-wiz__label:focus{outline:0}
.hp-donate-form.is-wizard .hp-dstep--pay{margin:0;padding:0;border:0}
/* A wizard on a wide card (short screen) stays a comfortable single column,
   whatever the side-by-side rules above would otherwise do */
.hp-donate-form.is-wizard .hp-dwrap,.hp-donate-form.is-wizard .hp-dpay{display:block}
.hp-donate-form.is-wizard .hp-dstep{margin:0;padding:0;border:0}
@container hpdf (min-width:520px){.hp-donate-form.is-wizard .hp-amount-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}}
.hp-donate-form.is-wizard .hp-wiz,.hp-donate-form.is-wizard .hp-dwrap,.hp-donate-form.is-wizard .hp-wiz__nav{max-width:560px;margin-inline:auto}
.hp-donate-form.is-wizard .hp-wiz{margin-bottom:1rem}
.hp-donate-form.is-wizard .hp-wiz__nav{margin-top:1rem}
.hp-donate-form--bank{scroll-margin-top:4.5rem}
.hp-donate-form.is-wizard .hp-wiz__nav:has(.hp-wiz__next[hidden]) .hp-wiz__back{flex:0 1 auto;min-width:7rem}
.hp-dstep__title:focus{outline:0}

/* Steps leave the screen cleanly for people who prefer reduced motion */
@media(prefers-reduced-motion:reduce){.hp-wiz__bar span{transition:none}}

/* Bank transfer notice (no JavaScript needed) */
.hp-bank__pledge{margin-top:12px;border-top:1px solid rgba(0,0,0,.12);padding-top:10px;position:relative}
.hp-bank__pledge summary{cursor:pointer;font-weight:600}
.hp-bank__pledgeform p{margin:8px 0}
.hp-bank__pledgeform label{display:block;font-size:.9em}
.hp-bank__pledgeform input[type="text"],.hp-bank__pledgeform input[type="email"]{width:100%;max-width:360px;box-sizing:border-box;min-height:44px;padding:8px 10px}
.hp-bank__pledgebtn{min-height:44px;padding:8px 16px;cursor:pointer}
.hp-bank__pledgenote{font-size:.85em;opacity:.8}
.hp-bank__sent{margin:10px 0;padding:10px 14px;border-left:4px solid #0a7a0a;background:rgba(10,122,10,.08)}

.hp-bank__direct{margin-top:1.6rem}
.hp-bank__direct .hp-bank{margin:0;border-left-width:6px;box-shadow:0 14px 34px -22px rgba(26,11,11,.45)}
