/* pages/css/give.css — layout only; every color/size comes from tokens.css */

/* ========== HERO (solid) ==========
   No photo. The old photo hero put white text over a light flare at 2.4:1 and
   cost 597px of scroll before the form. */
.give-hero { padding: var(--space-8) 0 var(--space-5); background: var(--color-bg); }
.give-hero__inner { display: grid; gap: var(--space-2); text-align: center; justify-items: center; }
.give-hero h1 { margin-bottom: var(--space-3); }
.give-hero .lead { color: var(--color-text-muted); margin-bottom: var(--space-5); max-width: 52ch; }
.give-hero .cluster { gap: var(--space-3); justify-content: center; }

.give-section { padding-top: var(--space-5); }
.section-title--center { text-align: center; margin-bottom: var(--space-5); }

/* ========== THE GIVING CARD ========== */
.give-card { position: relative; }

.give-toggle { display: flex; background: var(--color-surface-2); border-radius: var(--radius-pill); padding: 4px; margin-bottom: var(--space-5); }
.give-toggle button { flex: 1; min-height: 44px; border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--color-text-muted); font-weight: 800; font-size: var(--text-sm); text-transform: uppercase; letter-spacing: 0.04em; transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.give-toggle button.active { background: var(--brand-orange); color: var(--color-on-orange); }

/* Four presets, not nine. $2,500-$10,000 read as a pricing table on a phone and
   the Other box already accepts up to $50,000. */
.amount-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); margin-bottom: var(--space-3); }
.amount-btn {
  min-height: 52px; padding: var(--space-2) var(--space-1);
  border-radius: var(--radius-sm); border: 1px solid var(--color-border-strong);
  background: var(--color-surface-2); color: var(--color-text);
  font-weight: 700; font-size: var(--text-md); line-height: 1.15; white-space: normal;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.amount-btn:hover { border-color: var(--brand-orange-hot); }
/* A tinted chip reads "picked"; the old thin orange outline read "focused" and
   was identical to the focus state of the field below it. */
.amount-btn.selected { background: var(--primary-a15); border-color: var(--brand-orange); color: var(--color-text); }

.amount-note { margin: 0 0 var(--space-4); font-size: var(--text-sm); color: var(--color-text-muted); text-align: center; }
.amount-note[hidden] { display: none; }

/* The whole 52px box is the tap target - it used to be a 27px strip, so tapping
   the "$" or the padding did nothing. */
.custom-amount { display: flex; align-items: stretch; min-height: 52px; padding: 0 var(--space-4); border-radius: var(--radius-sm); border: 1px solid var(--color-border-strong); background: var(--color-surface-2); margin-bottom: var(--space-2); transition: border-color var(--dur-fast) var(--ease); cursor: text; }
.custom-amount:focus-within { border-color: var(--brand-orange); }
.custom-amount span { display: flex; align-items: center; font-weight: 700; color: var(--color-text-muted); margin-right: var(--space-2); }
.custom-amount input { flex: 1; min-width: 0; align-self: stretch; background: none; border: 0; font-size: var(--text-md); font-weight: 600; }
.custom-amount.invalid, .donor-input.invalid { border-color: var(--color-error); }
/* --color-text-faint is 3.46:1 on surface-2 (it only clears AA on --color-bg). */
.custom-amount input::placeholder, .donor-input::placeholder { color: var(--color-text-muted); }

.army-badge { display: flex; align-items: center; justify-content: center; gap: var(--space-2); margin: 0 0 var(--space-4); padding: var(--space-3); border-radius: var(--radius-sm); background: var(--primary-a15); font-size: var(--text-sm); font-weight: 700; color: var(--color-text); }
.army-badge[hidden] { display: none; }
.army-badge svg { width: 18px; height: 18px; flex: none; color: var(--brand-orange-hot); }

/* ========== PURPOSE CHIPS ==========
   Visible options instead of an OS picker, so the designation is part of the
   picture rather than one tap behind it. */
.purpose-field { margin-bottom: var(--space-5); }
.purpose-chips { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-2); margin-top: var(--space-2); }
.purpose-chip {
  min-height: 48px; padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm); border: 1px solid var(--color-border-strong);
  background: var(--color-surface-2); color: var(--color-text-muted);
  font-weight: 700; font-size: var(--text-sm); line-height: 1.2; text-align: center;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.purpose-chip:hover { border-color: var(--brand-orange-hot); color: var(--color-text); }
.purpose-chip.selected { background: var(--primary-a15); border-color: var(--brand-orange); color: var(--color-text); }

/* ========== EXPRESS CHECKOUT (wallets) ========== */
.express-wrap { margin-bottom: var(--space-5); }
.express-wrap[hidden] { display: none; }
#express-element { min-height: 48px; }
.or-rule { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-4); color: var(--color-text-muted); font-size: var(--text-sm); }
.or-rule::before, .or-rule::after { content: ''; flex: 1; height: 1px; background: var(--color-border); }

/* Donor name + email */
.donor-fields { display: grid; gap: var(--space-3); margin-bottom: var(--space-2); }
.field { display: grid; gap: var(--space-1); }
.field-label { display: block; font-size: var(--text-sm); font-weight: 700; color: var(--color-text-muted); }
.field-hint { margin: 0 0 var(--space-3); font-size: var(--text-xs); color: var(--color-text-muted); }
.donor-input { width: 100%; min-height: 48px; padding: 0 var(--space-4); border-radius: var(--radius-sm); border: 1px solid var(--color-border-strong); background: var(--color-surface-2); font-size: var(--text-md); transition: border-color var(--dur-fast) var(--ease); }
.donor-input:focus { border-color: var(--brand-orange); }
.amount-error { margin-top: var(--space-2); font-size: var(--text-sm); color: var(--color-error); }
.amount-error[hidden] { display: none; }

/* Buttons that carry long JS-set labels may wrap on narrow phones */
.give-card .btn--block { white-space: normal; height: auto; padding-block: var(--space-3); }
#giveNowBtn[hidden] { display: none; }

/* ========== PAYMENT SECTION (slides open) ==========
   visibility is what keeps Tab and screen readers out of the collapsed panel;
   opacity:0 alone left three focusable, announced-but-invisible controls. */
.payment-section {
  max-height: 0; overflow: hidden; opacity: 0; visibility: hidden;
  transition: max-height var(--dur-slow) var(--ease), opacity var(--dur) var(--ease), visibility 0s linear var(--dur-slow);
}
.payment-section.open { max-height: 2000px; opacity: 1; visibility: visible; overflow: visible; transition-delay: 0s, 0s, 0s; }

.payment-summary { display: grid; gap: var(--space-1); padding: var(--space-4) var(--space-5); margin: var(--space-5) 0; border-radius: var(--radius-sm); background: var(--primary-a15); border: 1px solid var(--primary-a22); }
.payment-summary-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.payment-summary-amount { font-family: var(--font-display); font-size: var(--text-h2); font-weight: 800; color: var(--color-text); font-variant-numeric: tabular-nums; line-height: 1.05; }
.payment-summary-edit { flex: none; min-height: 44px; padding: 0 var(--space-2); border: 0; background: none; color: var(--color-link); font-weight: 700; font-size: var(--text-sm); text-decoration: underline; text-underline-offset: 2px; }
.payment-summary-meta { font-size: var(--text-sm); color: var(--color-text); }

.stripe-mount { min-height: 40px; margin-bottom: var(--space-5); }
.recurring-note { margin: 0 0 var(--space-3); font-size: var(--text-sm); color: var(--color-text-muted); text-align: center; }
.recurring-note[hidden] { display: none; }
.payment-error { display: none; margin-top: var(--space-3); font-size: var(--text-sm); color: var(--color-error); text-align: center; }
.give-secure { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: var(--space-4); font-size: var(--text-xs); color: var(--color-text-muted); }
.give-secure svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.5; }
.give-other { margin: var(--space-5) auto 0; max-width: 60ch; text-align: center; font-size: var(--text-sm); }

/* ========== SUCCESS (receipt-shaped) ========== */
.success-overlay { display: none; flex-direction: column; align-items: center; justify-content: center; padding: var(--space-7) var(--space-4); text-align: center; }
.success-checkmark { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: var(--space-4); background: color-mix(in srgb, var(--color-success) 15%, transparent); border: 2px solid var(--color-success); animation: scaleIn var(--dur) var(--ease-out); }
.success-checkmark svg { width: 32px; height: 32px; stroke: var(--color-success); fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.success-title { font-size: var(--text-h3); margin-bottom: var(--space-4); }
.receipt { width: 100%; max-width: 36ch; margin: 0 0 var(--space-4); display: grid; gap: var(--space-2); text-align: left; padding: var(--space-4); border-radius: var(--radius-sm); background: var(--color-surface-2); border: 1px solid var(--color-border); }
.receipt > div { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.receipt dt { font-size: var(--text-sm); color: var(--color-text-muted); }
.receipt dd { margin: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.success-message { color: var(--color-text-muted); max-width: 40ch; margin: 0 0 var(--space-5); font-size: var(--text-sm); }
.success-next { width: 100%; max-width: 36ch; padding-top: var(--space-5); border-top: 1px solid var(--color-border); }
.success-next[hidden] { display: none; }
.success-next p { font-size: var(--text-sm); color: var(--color-text); margin-bottom: var(--space-3); }
@keyframes scaleIn { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.give-card.success-state .form-content { display: none; }
.give-card.success-state .success-overlay { display: flex; }

/* ========== $100 ARMY (story) ========== */
.army__card { text-align: center; padding: var(--space-6) var(--space-5); }
/* `display: grid` + max-content: as inline-grid the list and the button shared a
   row on desktop, leaving a 3px gap between the first bullet and the button. */
.army__list { list-style: none; padding: 0; margin: 0 auto var(--space-6); display: grid; width: max-content; max-width: 100%; gap: var(--space-3); text-align: left; font-size: var(--text-md); }
.army__list li { display: flex; gap: var(--space-3); align-items: baseline; }
.army__list li::before { content: '\25C6'; color: var(--color-text-muted); font-size: var(--text-xs); flex: none; }
.army__card > .btn { display: inline-flex; }

@media (min-width: 600px) {
  .give-card, .army__card { padding: var(--space-7); }
  .donor-fields { grid-template-columns: 1fr 1fr; }
  .amount-grid { grid-template-columns: repeat(4, 1fr); }
  .purpose-chips { grid-template-columns: repeat(4, 1fr); }
}
