:root {
  --red: #a3171d;
  --red-dark: #7f1015;
  --ink: #1d1b1b;
  --muted: #6b6361;
  --line: #e7e1df;
  --bg: #f7f3f2;
  --card: #ffffff;
  --radius: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }

.hero {
  background: linear-gradient(160deg, var(--red) 0%, var(--red-dark) 100%);
  color: #fff;
  padding: 32px 20px 68px;
  text-align: center;
}
.logo { display: block; margin: 0 auto 10px; height: 56px; width: auto; }
.hero h1 { margin: 0; font-size: 2rem; letter-spacing: -0.01em; }
.eyebrow { margin: 0; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.85; }
.sub { margin: 0; opacity: 0.9; }

.card {
  background: var(--card);
  max-width: 520px;
  margin: -48px auto 24px;
  padding: 24px 20px;
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(60, 20, 20, 0.12);
}

.section-title { font-size: 1rem; margin: 0 0 12px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.funds { display: grid; gap: 10px; }
.fund {
  display: grid;
  grid-template-columns: 1fr 140px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.fund.has-value { border-color: var(--red); background: #fdf6f6; }
.fund label { font-weight: 600; }
.money { position: relative; }
.money span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.money input { padding-left: 26px; text-align: right; }

input {
  width: 100%;
  font: inherit;
  font-size: 16px; /* prevents iOS zoom */
  padding: 11px 12px;
  border: 1px solid #cfc7c5;
  border-radius: 8px;
  background: #fff;
}
input:focus { outline: 2px solid var(--red); outline-offset: 1px; border-color: var(--red); }

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 16px 2px 20px;
  font-size: 1.1rem;
}
.total-row strong { font-size: 1.5rem; }

.wallet-wrap { position: relative; min-height: 52px; }
.wallet-wrap.is-disabled #express-checkout { opacity: 0.35; pointer-events: none; filter: grayscale(0.6); }
.wallet-hint { margin: 8px 0 0; font-size: 0.85rem; color: var(--muted); text-align: center; }
.wallet-wrap:not(.is-disabled) .wallet-hint { display: none; }

.link-btn {
  display: block;
  width: 100%;
  margin: 18px 0 0;
  padding: 10px;
  background: none;
  border: 0;
  font: inherit;
  font-size: 0.92rem;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-btn:hover { color: var(--red); }
#ach-section { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }

.divider { display: flex; align-items: center; gap: 12px; margin: 26px 0 18px; color: var(--muted); font-size: 0.9rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.field-row { margin-bottom: 12px; }
.field-row label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 6px; }
.payment-element { margin: 14px 0 16px; }

.btn {
  display: inline-block;
  width: 100%;
  padding: 14px 16px;
  font: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  background: var(--red);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn:hover:not(:disabled) { background: var(--red-dark); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary { background: #fff; color: var(--red); border: 1px solid var(--red); margin-top: 16px; }
.btn-secondary:hover { background: #fdf6f6 !important; }

.fine { font-size: 0.8rem; color: var(--muted); margin: 10px 0 0; line-height: 1.4; }

.error {
  background: #fdecec;
  color: #8a1116;
  border: 1px solid #f3c2c4;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.result-icon { font-size: 2.6rem; line-height: 1; margin: 8px 0 6px; }

.foot { text-align: center; color: var(--muted); font-size: 0.78rem; padding: 4px 16px 32px; }
.foot p { margin: 4px 0; }
.foot a { color: var(--red); font-weight: 600; text-decoration: none; }

@media (max-width: 400px) {
  .fund { grid-template-columns: 1fr 118px; }
  .hero h1 { font-size: 1.7rem; }
}
