/* Donor page (spec §3.1). Mobile-first, single column, light theme only.
   Older, mobile-heavy audience: big type, big targets, high contrast, no motion beyond one spinner. */

:root {
  color-scheme: light;
  --ink: #171a15;
  --ink-soft: #4b514a;
  --line: #b9beb4;
  --paper: #ffffff;
  --ground: #f5f6f3;
  --error: #a01313;
  --focus: #12507a;
  --ok: #16610f;
  /* Light branding, same three values as the emails and the live site: the accent, the panel
     tint it sits on, and the hairline used for purely decorative rules. Body ink stays --ink;
     --focus stays the darker blue because it also colours footer links on --ground, where
     #167eae would fall under 4.5:1. */
  --brand: #167eae;
  --brand-tint: #f7fcfe;
  --brand-line: #d5edf8;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 18px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.yrs-page { max-width: 520px; margin: 0 auto; padding: 20px 16px 48px; }

/* ---- brand strip ----
   The 4px accent bar and bold brand line the confirmation emails open with, so arriving here from
   the WordPress home page is not a jump into an unbranded document. One flex row that wraps at
   narrow widths: the back link drops under the name (space-between leaves a lone item at the
   start), nothing is nowrap, so 320px never scrolls sideways. Both links are 44px tall for touch. */
.yrs-brandbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0 16px;
  margin: 0 0 20px; padding: 4px 14px;
  background: var(--brand-tint);
  border-top: 4px solid var(--brand);
  border-bottom: 1px solid var(--brand-line);
  border-radius: 0 0 10px 10px;
}
.yrs-brandname {
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: 1rem; font-weight: 700; letter-spacing: 0.01em;
  color: var(--brand);
}
.yrs-brandname a { color: var(--brand); text-decoration: none; }
.yrs-brandname a:hover { text-decoration: underline; }
.yrs-back {
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: 0.9rem; font-weight: 700;
  color: var(--focus); overflow-wrap: anywhere;
}

.yrs-header { margin-bottom: 20px; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 8px; }
h2 { font-size: 1.25rem; line-height: 1.3; margin: 0 0 8px; }
p { margin: 0 0 12px; }

.yrs-facts { color: var(--ink-soft); margin-bottom: 8px; }
.yrs-seats { font-weight: 700; margin-bottom: 8px; }
.yrs-badge {
  display: inline-block; margin: 4px 0 0; padding: 2px 10px;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: #5a4300; background: #ffe9a8; border: 1px solid #e0c37a; border-radius: 999px;
}

/* ---- form ---- */
.field { margin: 0 0 20px; }
label { display: block; font-weight: 700; margin-bottom: 6px; }

input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  display: block; width: 100%;
  padding: 12px; min-height: 48px;
  font-size: 17px; font-family: inherit; line-height: 1.4;
  color: var(--ink); background: var(--paper);
  border: 2px solid var(--line); border-radius: 8px;
  -webkit-appearance: none; appearance: none;
}
select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%234b514a' d='M4 6l4 5 4-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
  padding-right: 40px;
}
textarea { min-height: 88px; resize: vertical; }

:focus-visible, input:focus, select:focus, textarea:focus, button:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.field-hint { font-size: 0.9rem; color: var(--ink-soft); margin: 6px 0 0; }
.field-error, .form-error {
  color: var(--error); font-weight: 700; font-size: 0.95rem; margin: 6px 0 0;
}
.form-error { margin: 0 0 16px; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: var(--error);
}

.field-consent .checkbox {
  display: flex; align-items: flex-start; gap: 12px;
  font-weight: 400; min-height: 44px;
}
.field-consent input[type="checkbox"] {
  width: 26px; height: 26px; min-width: 26px; margin: 2px 0 0;
  accent-color: var(--focus);
}

/* ---- pay button ---- */
.pay-button {
  display: block; width: 100%;
  min-height: 56px; padding: 14px 16px;
  font-size: 19px; font-weight: 700; font-family: inherit;
  color: #12100b; background: #ffc439;
  border: 2px solid #e3ab26; border-radius: 8px;
  cursor: pointer;
}
.pay-button:active { background: #f0b52f; }
.pay-button[disabled] { background: #e6e6e2; border-color: var(--line); color: #6c706a; cursor: default; }
.pay-note { font-size: 0.9rem; color: var(--ink-soft); margin: 10px 0 0; text-align: center; }

/* ---- states ---- */
.yrs-state { background: var(--paper); border: 1px solid var(--brand-line); border-radius: 12px; padding: 20px 16px; }
.yrs-status .yrs-state { margin-top: 0; }
#state-result[data-kind="success"] { border-color: #9ccf95; }
#state-result[data-kind="success"] #result-heading { color: var(--ok); }
#state-result[data-kind="recovery"] { border-color: #e7b3ae; }
.result-summary { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--brand-line); }
.result-summary-heading { font-size: 1rem; margin: 0 0 10px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; }
.result-facts { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 8px 12px; margin: 0 0 12px; font-size: 1.05rem; }
.result-facts dt { color: var(--ink-soft); }
.result-facts dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.result-facts dd.wrap { white-space: pre-line; }

.phone-line a, .yrs-footer a { color: var(--focus); font-weight: 700; }
.phone-line a, .yrs-footer a { display: inline-block; min-height: 44px; line-height: 44px; }
.yrs-footer { margin-top: 24px; text-align: center; color: var(--ink-soft); }
/* "Name · host", the same sign-off the emails end with, over the same hairline. */
.yrs-brandline { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--brand-line); font-size: 0.85rem; }
.yrs-footer p:first-child.yrs-brandline { margin-top: 0; padding-top: 0; border-top: 0; }

.spinner {
  width: 28px; height: 28px; margin: 0 auto 12px;
  border: 4px solid #d7dbd3; border-top-color: var(--focus); border-radius: 50%;
  animation: yrs-spin 1s linear infinite;
}
@keyframes yrs-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; border-top-color: #d7dbd3; }
}

/* Honeypot: off-screen but still focusable-by-bot, never announced or shown. */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}

@media (min-width: 560px) {
  body { font-size: 17px; }
  .yrs-page { padding-top: 32px; }
}
