/* Donate page (frontend/checkout/donate-new). Builds on checkout.css (.co tokens, boxes, logos, pay button). */

/* causes: two per row, the whole tile is the choice; the tiles share the box's height */
.dn .dn-causes { flex:1 0 auto; display:grid; grid-template-columns:1fr 1fr; grid-auto-rows:1fr; gap:14px; }
.dn .dn-cause { --c:#015caa; --ct:#e8f1fa; position:relative; display:flex; flex-direction:column; align-items:center; justify-content:flex-start; gap:10px; margin:0; padding:20px 14px 16px; border:1.5px solid var(--line); border-radius:18px; background:#fff; cursor:pointer; font-weight:400; text-align:center; transition:border-color .2s, box-shadow .2s, background .2s, transform .2s; }
.dn .dn-cause.is-g { --c:#17a43b; --ct:#eaf7ee; }
.dn .dn-cause.is-o { --c:#e07b00; --ct:#fff3e0; }
.dn .dn-cause:hover { border-color:var(--c); transform:translateY(-2px); }
.dn .dn-cause input { position:absolute; opacity:0; width:1px; height:1px; left:auto; pointer-events:none; }   /* the tile shows the choice */
.dn-cause__pic { flex:none; width:84px; height:84px; transition:transform .25s; }
.dn-cause__pic svg { display:block; width:100%; height:100%; }
.dn .dn-cause:hover .dn-cause__pic { transform:scale(1.05); }
/* the picture stays at the top and the amount at the bottom of every tile; the name fills the space between, centred,
   so a one-line name and a three-line name keep their picture and amount at the same height */
.dn-cause__name { flex:1 0 auto; display:flex; align-items:center; justify-content:center; font:700 15px/1.3 Outfit,sans-serif; color:var(--ink); }
.dn-cause__amt { flex:none; display:inline-block; padding:4px 12px; border-radius:999px; background:var(--ct); font-size:12.5px; font-weight:800; color:var(--c); }
.dn-cause__tick { position:absolute; top:12px; right:12px; width:24px; height:24px; border-radius:50%; display:grid; place-items:center; border:1.5px solid var(--line); background:#fff; color:transparent; font-size:11px; transition:all .2s; }
.dn .dn-cause:has(input:checked) { border-color:var(--c); background:var(--ct); box-shadow:0 14px 26px -18px var(--c); }
.dn-cause:has(input:checked) .dn-cause__amt { background:var(--c); color:#fff; }
.dn-cause:has(input:checked) .dn-cause__tick { background:var(--c); border-color:var(--c); color:#fff; }
.dn .dn-cause:has(input:focus-visible) { outline:3px solid rgba(1,92,170,.35); outline-offset:2px; }
/* the chosen cause's picture in the summary */
.dn .dn-sum-pic { padding:5px; }
.dn-sum-pic svg { display:block; width:100%; height:100%; }

/* amount */
.dn-amount { padding-top:18px; }
.dn .dn-amount h3 { font:700 16px Outfit,sans-serif; color:var(--ink); margin:0 0 10px; padding:0; text-transform:none; }
.dn-chips { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin-bottom:10px; }
.dn .dn-chip { margin:0; font-weight:400; cursor:pointer; }
.dn .dn-chip input { position:absolute; opacity:0; width:1px; height:1px; left:auto; pointer-events:none; }
.dn-chip span { display:flex; align-items:center; justify-content:center; height:42px; border:1.5px solid var(--line); border-radius:12px; background:#fff; font-size:14px; font-weight:700; color:var(--ink); white-space:nowrap; transition:all .2s; }
.dn-chip:hover span { border-color:var(--b); }
.dn-chip input:checked + span { border-color:var(--b); background:var(--b); color:#fff; }
.dn-chip input:focus-visible + span { outline:3px solid rgba(1,92,170,.35); outline-offset:2px; }
.dn .dn-other { display:flex; align-items:center; margin:0; height:48px; border:1.5px solid var(--line); border-radius:12px; background:#fff; overflow:hidden; font-weight:400; transition:border-color .2s, box-shadow .2s; }
.dn .dn-other:focus-within { border-color:var(--b); box-shadow:0 0 0 4px rgba(1,92,170,.12); }
.dn-other__pkr { flex:none; align-self:stretch; display:grid; place-items:center; padding:0 14px; background:#f6f9fc; border-right:1.5px solid var(--line); font-size:13px; font-weight:800; color:var(--mut); }
.dn .dn-other input { flex:1; min-width:0; height:100%; margin:0; padding:0 14px; border:0; background:transparent; font:700 17px Roboto,sans-serif; color:var(--ink); box-shadow:none; }
.dn .dn-other input:focus { outline:0; }
.dn .dn-other input::placeholder { text-transform:none; letter-spacing:0; font-weight:400; font-size:15px; color:#9aa8b6; }
.dn .dn-hint { margin:8px 0 0; font-size:12.5px; color:var(--mut); }
.dn-hint a { color:var(--b); font-weight:700; }
.dn .dn-hint.is-warn { color:#b45f00; font-weight:600; }   /* someone tried to go above the limit */

/* details */
.dn-fields { display:grid; grid-template-columns:1fr 1fr; gap:12px 12px; margin:18px 0 0; }
.dn-field--full { grid-column:1 / -1; }
.dn .dn-field { display:block; margin:0; font-weight:400; min-width:0; }
.dn .dn-field > span { display:flex; align-items:center; gap:7px; margin-bottom:6px; font-size:13px; font-weight:700; color:var(--ink); }
.dn-field > span .fa { color:var(--b); width:14px; text-align:center; }
.dn-field > span em { font-style:normal; font-weight:400; color:var(--mut); }
.dn .dn-field input { width:100%; height:46px; margin:0; padding:0 14px; border:1.5px solid var(--line); border-radius:12px; background:#fff; font:15px Roboto,sans-serif; color:var(--ink); box-shadow:none; transition:border-color .2s, box-shadow .2s; }
.dn .dn-field input::placeholder { text-transform:none; letter-spacing:0; color:#9aa8b6; }
.dn .dn-field input:focus { outline:0; border-color:var(--b); box-shadow:0 0 0 4px rgba(1,92,170,.12); }
.dn .dn-err { margin:12px 0 0; padding:10px 14px; border-radius:12px; background:#fdecec; color:#b42318; font-size:13.5px; font-weight:600; }
.dn .dn-check { display:flex; align-items:flex-start; gap:10px; margin:16px 0 18px; font-size:14.5px; font-weight:400; color:#34465a; cursor:pointer; text-align:left; }
.dn .dn-check input { position:static; left:auto; flex:none; width:18px; height:18px; margin:2px 0 0; accent-color:var(--g); }   /* the site hides real checkboxes off-screen */

@media (max-width:767px) {
    .dn-chips { grid-template-columns:1fr 1fr; }
    .dn-fields { grid-template-columns:1fr; }
}
@media (max-width:420px) {
    /* one per row: the picture on the left, the name with the amount under it, the tick on the right (all centred) */
    .dn .dn-causes { grid-template-columns:1fr; grid-auto-rows:auto; }
    .dn .dn-cause { display:grid; grid-template-columns:60px 1fr; grid-template-rows:auto auto; column-gap:14px; row-gap:6px; align-items:center; align-content:center; padding:14px 46px 14px 14px; text-align:left; }
    .dn-cause__pic { grid-row:1 / 3; width:60px; height:60px; }
    .dn-cause__name { display:block; align-self:end; }
    .dn-cause__amt { justify-self:start; align-self:start; }
    .dn-cause__tick { top:50%; transform:translateY(-50%); }
}

/* back from PayFast without a completed payment (DonateController::failedPage): the same orange note as the Payment not completed page */
.dn .dn-failed { display:flex; gap:14px; align-items:flex-start; max-width:1000px; margin:0 auto 22px; padding:14px 16px; border-radius:16px; background:#fff3e0; border:1px solid #fbd9a8; text-align:left; }
.dn-failed__icon { flex:none; width:40px; height:40px; border-radius:50%; display:grid; place-items:center; background:#e07b00; color:#fff; font-size:18px; }
.dn-failed b { display:block; font:700 16px/1.3 Outfit,sans-serif; color:var(--ink); margin-bottom:3px; }
.dn-failed div > span { display:block; font-size:14px; color:#5b4630; }

/* "Taking you to PayFast…" (donate-redirect) */
.dn .dn-go { max-width:520px; margin:0 auto; align-items:center; text-align:center; }
.dn .dn-go p { text-align:center; margin:0 0 18px; font-size:15px; color:#34465a; }
.dn .dn-go form { width:100%; }
.dn .dn-go .dn-go__note { margin:14px 0 0; font-size:13px; color:var(--mut); }
.dn-go__note .fa { color:var(--b); margin-right:4px; }
.dn-go__spin { width:46px; height:46px; margin-bottom:14px; border-radius:50%; border:4px solid var(--btint); border-top-color:var(--b); animation:dnSpin .9s linear infinite; }
@keyframes dnSpin { to { transform:rotate(360deg); } }

/* Thank you (donate-thanks): the cause the donor supported */
.dn .dn-ty-cause { --c:#015caa; --ct:#e8f1fa; }
.dn .dn-ty-cause.is-g { --c:#17a43b; --ct:#eaf7ee; }
.dn .dn-ty-cause.is-o { --c:#e07b00; --ct:#fff3e0; }
.dn-ty-cause__box { display:flex; flex-direction:column; align-items:center; gap:10px; padding:22px 16px; border-radius:18px; background:var(--ct); border:1.5px solid var(--c); text-align:center; }
.dn-ty-cause__box b { font:700 16px/1.3 Outfit,sans-serif; color:var(--ink); }
.dn-ty-cause__box .dn-cause__amt { background:var(--c); color:#fff; }
.dn .dn-ty-cause__text { margin:16px 0 18px; font-size:14.5px; color:#34465a; text-align:center; }
