/*
 * Given Gladly — shared design system for the donor-facing pages (donation page, donor portal,
 * printable documents, home, 404).
 *
 * THEME. Each nonprofit supplies up to four colours: primary, accent, background, text. pages/_layout.php
 * validates them and prints the tokens below into a small <style> block per page. Everything that has a
 * contrast requirement (text on the card, text on the page background, the button fill and its label,
 * control outlines) is computed there from the tenant's colours so it always passes WCAG AA; this file
 * only derives the decorative tints, with color-mix() and a server-computed fallback (--qgf-*) for
 * browsers that lack it. Nothing here is tied to one brand colour.
 */

/* ------------------------------------------------------------------ 1. Tokens */
:root {
  color-scheme: light;

  /* From the tenant (defaults are the Given Gladly house colours). */
  --qg-primary: #2e7d5b;
  --qg-accent: #1b5e40;
  --qg-bg: #f7f9f7;

  /* Computed per tenant in pages/_layout.php (these are the defaults for the house colours). */
  --qg-ink: #1d2126;          /* text on the page background */
  --qg-ink-muted: #5b6168;    /* secondary text on the page background (4.5:1) */
  --qg-ink-line: #d9dcdb;     /* hairlines on the page background */
  --qg-ink-link: #2e7d5b;     /* primary, adjusted to 4.5:1 on the page background */
  --qg-surface: #ffffff;      /* cards */
  --qg-text: #1d2126;         /* text on cards */
  --qg-muted: #5f646b;        /* secondary text on cards (4.5:1) */
  --qg-control-card: #939497; /* outlines of inputs and buttons on a card (3:1 against it) */
  --qg-control-page: #8c8f8d; /* the same, for a control sitting on the page background */
  --qg-control: var(--qg-control-page);
  --qg-link: #2e7d5b;         /* primary, adjusted to 4.5:1 on cards: links, selected outlines, focus */
  --qg-fill: #2e7d5b;         /* primary button / selected fill */
  --qg-on-fill: #ffffff;      /* text on the fill (4.5:1) */
  --qg-fill-hover: #256a4c;
  --qg-bar-end: #1b5e40;      /* far end of the progress bar */

  /* Decorative tints: fallback first, color-mix() below when the browser has it. */
  --qg-soft: var(--qgf-soft, #eef5f2);
  --qg-soft-strong: var(--qgf-soft2, #dcebe4);
  --qg-line: var(--qgf-line, #e3e4e6);
  --qg-ring: var(--qgf-ring, rgba(46, 125, 91, .3));
  --qg-wash: var(--qgf-wash, #f4f5f5);

  /* Status colours (all on white cards). */
  --qg-danger: #b42318;
  --qg-danger-soft: #fef3f2;
  --qg-danger-line: #fda29b;
  --qg-danger-text: #912018;
  --qg-warn-soft: #fffaeb;
  --qg-warn-line: #fedf89;
  --qg-warn-text: #7a2e0e;
  --qg-ok-soft: #ecfdf3;
  --qg-ok-line: #abefc6;
  --qg-ok-text: #085d3a;

  --qg-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --qg-radius: 12px;
  --qg-radius-lg: 20px;
  --qg-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 12px 32px -10px rgba(16, 24, 40, .14);
  --qg-shadow-lg: 0 24px 64px -12px rgba(16, 24, 40, .3);
}

@supports (color: color-mix(in srgb, #fff 50%, #000)) {
  :root {
    --qg-soft: color-mix(in srgb, var(--qg-primary) 8%, var(--qg-surface));
    --qg-soft-strong: color-mix(in srgb, var(--qg-primary) 17%, var(--qg-surface));
    --qg-line: color-mix(in srgb, var(--qg-text) 13%, var(--qg-surface));
    --qg-ring: color-mix(in srgb, var(--qg-link) 30%, transparent);
    --qg-wash: color-mix(in srgb, var(--qg-text) 5%, var(--qg-surface));
  }
}

/* ------------------------------------------------------------------ 2. Base */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  font: 400 1rem/1.55 var(--qg-font);
  color: var(--qg-ink);
  background: var(--qg-bg);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure, fieldset, legend { margin: 0; padding: 0; }
fieldset { border: 0; min-width: 0; }
ul[class], ol[class] { list-style: none; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; margin: 0; }
button { cursor: pointer; }
[hidden] { display: none !important; }

a { color: var(--qg-link); text-underline-offset: .15em; }
@media (hover: hover) { a:hover { text-decoration-thickness: 2px; } }

/* One focus treatment everywhere: a solid ring in the tenant's primary, adjusted for contrast against
   whatever it sits on (the page background, or a white card). */
body { --qg-focus: var(--qg-ink-link); --qg-control: var(--qg-control-page); }
.qg-card { --qg-focus: var(--qg-link); --qg-control: var(--qg-control-card); }
:focus-visible { outline: 3px solid var(--qg-focus, var(--qg-link)); outline-offset: 2px; border-radius: 4px; }

.qg-sr {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

.qg-skip {
  position: absolute; left: 12px; top: -80px; z-index: 100; padding: 12px 16px; border-radius: 10px;
  background: var(--qg-surface); color: var(--qg-text); font-weight: 650; box-shadow: var(--qg-shadow);
}
.qg-skip:focus { top: 12px; }

.qg-icon { width: 1.125em; height: 1.125em; flex: none; vertical-align: -0.17em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------------ 3. Page chrome */
.qg-banner {
  display: flex; justify-content: center; align-items: center; gap: 8px;
  padding: 7px 16px; font-size: .875rem; font-weight: 600; line-height: 1.4; text-align: center;
  color: var(--qg-warn-text); background: var(--qg-warn-soft); border-bottom: 1px solid var(--qg-warn-line);
}
.qg-banner::before {
  content: ""; width: 8px; height: 8px; flex: none; border-radius: 50%; background: #dc6803;
}

.qg-foot {
  padding: 8px 16px 32px; text-align: center; font-size: .875rem; color: var(--qg-ink-muted);
}
.qg-foot a { color: inherit; font-weight: 600; }

.qg-card {
  background: var(--qg-surface); color: var(--qg-text);
  border: 1px solid var(--qg-line); border-radius: var(--qg-radius-lg);
  box-shadow: var(--qg-shadow);
}

/* A plain message page (unavailable page, portal not found). */
.qg-plain { max-width: 520px; margin: 0 auto; padding: 48px 16px; }
.qg-plain .qg-card { padding: 32px 28px; text-align: center; }
.qg-plain h1 { font-size: 1.5rem; line-height: 1.25; letter-spacing: -.01em; margin-bottom: 10px; }
.qg-plain p { color: var(--qg-muted); }
.qg-plain p + p { margin-top: 12px; }

/* ------------------------------------------------------------------ 4. Buttons */
.qg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 20px; border-radius: var(--qg-radius);
  border: 1px solid var(--qg-control); background: var(--qg-surface); color: var(--qg-text);
  font-weight: 650; font-size: 1rem; line-height: 1.2; text-align: center; text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .05s ease;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
@media (hover: hover) { .qg-btn:hover { background: var(--qg-soft); border-color: var(--qg-link); } }
.qg-btn:active { transform: translateY(1px); }
.qg-btn:focus-visible { border-radius: var(--qg-radius); }

.qg-btn--primary { background: var(--qg-fill); border-color: var(--qg-fill); color: var(--qg-on-fill); }
@media (hover: hover) { .qg-btn--primary:hover { background: var(--qg-fill-hover); border-color: var(--qg-fill-hover); } }

.qg-btn--ghost { border-color: transparent; background: transparent; color: var(--qg-link); }
@media (hover: hover) { .qg-btn--ghost:hover { border-color: transparent; background: var(--qg-soft); } }

.qg-btn--danger { background: var(--qg-danger); border-color: var(--qg-danger); color: #fff; }
@media (hover: hover) { .qg-btn--danger:hover { background: #912018; border-color: #912018; } }
.qg-btn--danger-quiet { color: var(--qg-danger); }
@media (hover: hover) { .qg-btn--danger-quiet:hover { background: var(--qg-danger-soft); border-color: var(--qg-danger); } }

.qg-btn--lg { min-height: 56px; padding: 12px 24px; font-size: 1.125rem; font-weight: 700; border-radius: 14px; }
.qg-btn--lg:focus-visible { border-radius: 14px; }
.qg-btn--sm { min-height: 40px; padding: 6px 14px; font-size: .9375rem; }
.qg-btn--block { display: flex; width: 100%; }

.qg-btn[disabled], .qg-btn[aria-disabled="true"] { cursor: default; transform: none; }
.qg-btn[disabled]:not(.is-busy), .qg-btn[aria-disabled="true"]:not(.is-busy) { opacity: .55; }
.qg-btn.is-busy { cursor: progress; }

.qg-spinner {
  width: 1.1em; height: 1.1em; flex: none; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: qg-spin .7s linear infinite;
}
@keyframes qg-spin { to { transform: rotate(360deg); } }

.qg-linkbtn {
  padding: 0; border: 0; background: none; color: var(--qg-link); font-weight: 600;
  text-decoration: underline; text-underline-offset: .15em; cursor: pointer; min-height: 24px;
}
@media (hover: hover) { .qg-linkbtn:hover { text-decoration-thickness: 2px; } }
.qg-linkbtn[disabled] { color: var(--qg-muted); text-decoration: none; cursor: default; }

/* ------------------------------------------------------------------ 5. Form controls */
.qg-field { display: block; min-width: 0; }
.qg-label {
  display: block; margin-bottom: 6px; font-size: .9375rem; font-weight: 600; line-height: 1.35; color: var(--qg-text);
}
.qg-opt { font-weight: 400; color: var(--qg-muted); }

.qg-input {
  display: block; width: 100%; min-height: 48px; padding: 11px 14px;
  font-size: 1rem; line-height: 1.5; color: var(--qg-text);
  background: var(--qg-surface); border: 1px solid var(--qg-control); border-radius: 10px;
  outline: 2px solid transparent; outline-offset: 0;
  transition: border-color .15s ease, box-shadow .15s ease;
  appearance: none; -webkit-appearance: none;
}
textarea.qg-input { min-height: 88px; resize: vertical; }
select.qg-input {
  padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 21px) 50%, calc(100% - 15px) 50%;
  background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
}
input[type="date"].qg-input { min-width: 0; }
.qg-input::placeholder { color: var(--qg-muted); opacity: 1; }
@media (hover: hover) { .qg-input:hover { border-color: var(--qg-text); } }
.qg-input:focus, .qg-input.is-focus {
  border-color: var(--qg-link); box-shadow: 0 0 0 3px var(--qg-ring); outline-color: transparent;
}
.qg-input[aria-invalid="true"], .qg-input.is-invalid { border-color: var(--qg-danger); box-shadow: 0 0 0 3px var(--qg-danger-soft); }
.qg-input[readonly] { background: var(--qg-wash); }

.qg-hint { margin-top: 6px; font-size: .875rem; line-height: 1.45; color: var(--qg-muted); }
.qg-error {
  display: flex; gap: 6px; align-items: flex-start; margin-top: 6px;
  font-size: .875rem; line-height: 1.45; font-weight: 600; color: var(--qg-danger);
}
.qg-error::before {
  content: "!"; flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%;
  background: var(--qg-danger); color: #fff; font-size: .75rem; font-weight: 800; line-height: 18px; text-align: center;
}
.qg-error:empty { display: none; }

.qg-row { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.qg-row--city { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, 1.3fr); }
.qg-stack { display: grid; gap: 14px; }
.qg-stack > div:empty { display: none; }

/* Checkbox rows: the whole row is the target (44px tall). */
.qg-check {
  display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 12px; align-items: start;
  padding: 10px 0; min-height: 44px; cursor: pointer; line-height: 1.4;
}
.qg-check input {
  appearance: none; -webkit-appearance: none; width: 24px; height: 24px; margin: 0; flex: none;
  border: 1.5px solid var(--qg-control); border-radius: 6px; background: var(--qg-surface);
  display: grid; place-content: center; cursor: pointer;
  transition: background-color .12s ease, border-color .12s ease;
}
.qg-check input::after {
  content: ""; width: 7px; height: 12px; margin-top: -2px;
  border: solid var(--qg-on-fill); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) scale(0);
  transition: transform .12s ease;
}
.qg-check input:checked { background: var(--qg-fill); border-color: var(--qg-link); }
.qg-check input:checked::after { transform: rotate(45deg) scale(1); }
@media (hover: hover) { .qg-check input:hover { border-color: var(--qg-link); } }
.qg-check__text { padding-top: 1px; font-weight: 600; }
.qg-check__hint { margin: -8px 0 4px 36px; font-size: .875rem; line-height: 1.45; color: var(--qg-muted); }
.qg-checks { display: grid; gap: 2px; }

/* Radio rows share the look. */
.qg-radio { display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 12px; align-items: center; min-height: 44px; padding: 8px 0; cursor: pointer; }
.qg-radio input {
  appearance: none; -webkit-appearance: none; width: 24px; height: 24px; margin: 0;
  border: 1.5px solid var(--qg-control); border-radius: 50%; background: var(--qg-surface);
  display: grid; place-content: center; cursor: pointer;
}
.qg-radio input::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--qg-fill); transform: scale(0); transition: transform .12s ease; }
.qg-radio input:checked { border-color: var(--qg-link); border-width: 2px; }
.qg-radio input:checked::after { transform: scale(1); }

/* Segmented control: real radios underneath, so arrow keys and screen readers just work. */
.qg-seg {
  display: flex; flex-wrap: wrap; gap: 4px; padding: 4px;
  background: var(--qg-wash); border: 1px solid var(--qg-control); border-radius: 14px;
}
.qg-seg__item { position: relative; flex: 1 1 88px; min-width: 0; }
.qg-seg__item input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.qg-seg__face {
  display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 6px 10px;
  border-radius: 10px; font-weight: 650; font-size: 1rem; line-height: 1.2; text-align: center; color: var(--qg-text);
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
@media (hover: hover) { .qg-seg__item input:hover + .qg-seg__face { background: var(--qg-soft-strong); } }
.qg-seg__item input:checked + .qg-seg__face {
  background: var(--qg-fill); color: var(--qg-on-fill); box-shadow: inset 0 0 0 2px var(--qg-link), 0 1px 2px rgba(16, 24, 40, .12);
}
.qg-seg__item input:focus-visible + .qg-seg__face { outline: 3px solid var(--qg-link); outline-offset: 2px; }

/* Choice buttons (gift amounts): also radios. */
.qg-choices { display: flex; flex-wrap: wrap; gap: 10px; }
.qg-choice { position: relative; flex: 1 1 calc(25% - 10px); min-width: 72px; }
.qg-choices[data-count="3"] .qg-choice, .qg-choices[data-count="5"] .qg-choice, .qg-choices[data-count="6"] .qg-choice { flex-basis: calc(33.333% - 10px); }
.qg-choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.qg-choice__face {
  display: flex; align-items: center; justify-content: center; min-height: 56px; padding: 8px 6px;
  border: 1px solid var(--qg-control); border-radius: var(--qg-radius); background: var(--qg-surface);
  font-size: 1.1875rem; font-weight: 700; line-height: 1.1; color: var(--qg-text); font-variant-numeric: tabular-nums;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
@media (hover: hover) { .qg-choice input:hover + .qg-choice__face { border-color: var(--qg-link); background: var(--qg-soft); } }
.qg-choice input:checked + .qg-choice__face {
  background: var(--qg-fill); border-color: var(--qg-link); color: var(--qg-on-fill); box-shadow: inset 0 0 0 1px var(--qg-link);
}
.qg-choice input:focus-visible + .qg-choice__face { outline: 3px solid var(--qg-link); outline-offset: 2px; }

/* An input with a fixed lead-in (the "Other $" amount). */
.qg-group {
  display: flex; align-items: stretch; min-height: 56px;
  border: 1px solid var(--qg-control); border-radius: var(--qg-radius); background: var(--qg-surface);
  transition: border-color .15s ease, box-shadow .15s ease;
}
@media (hover: hover) { .qg-group:hover { border-color: var(--qg-text); } }
.qg-group:focus-within { border-color: var(--qg-link); box-shadow: 0 0 0 3px var(--qg-ring); }
.qg-group.is-selected { border-color: var(--qg-link); box-shadow: inset 0 0 0 1px var(--qg-link); background: var(--qg-soft); }
.qg-group.is-selected:focus-within { box-shadow: inset 0 0 0 1px var(--qg-link), 0 0 0 3px var(--qg-ring); }
.qg-group.is-invalid { border-color: var(--qg-danger); box-shadow: 0 0 0 3px var(--qg-danger-soft); }
.qg-group__lead {
  display: flex; align-items: center; gap: 10px; padding: 0 0 0 16px;
  font-weight: 600; color: var(--qg-muted); white-space: nowrap; cursor: text;
}
.qg-group__cur { font-size: 1.1875rem; font-weight: 700; color: var(--qg-text); }
.qg-group input {
  flex: 1 1 auto; min-width: 0; width: 100%; padding: 8px 14px 8px 4px; border: 0; background: transparent;
  font-size: 1.1875rem; font-weight: 700; font-variant-numeric: tabular-nums; outline: 2px solid transparent; outline-offset: -2px;
}
.qg-group input::placeholder { color: var(--qg-muted); font-weight: 500; opacity: 1; }

/* Quiet disclosures (native <details>). */
.qg-disclosures { border: 1px solid var(--qg-line); border-radius: var(--qg-radius); }
.qg-disc + .qg-disc { border-top: 1px solid var(--qg-line); }
.qg-disc > summary {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 14px;
  font-weight: 600; color: var(--qg-text); cursor: pointer; list-style: none; border-radius: 11px;
}
.qg-disc > summary::-webkit-details-marker { display: none; }
.qg-disc > summary::after {
  content: ""; flex: none; width: 9px; height: 9px; margin: -4px 4px 0 auto;
  border: solid var(--qg-muted); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .15s ease;
}
.qg-disc[open] > summary::after { transform: rotate(225deg); margin-top: 4px; }
@media (hover: hover) { .qg-disc > summary:hover { background: var(--qg-soft); } }
.qg-disc > summary:focus-visible { outline-offset: -3px; border-radius: 11px; }
.qg-disc__body { padding: 4px 14px 16px; }
.qg-disc__note { font-weight: 400; color: var(--qg-muted); font-size: .875rem; }

/* ------------------------------------------------------------------ 6. Feedback */
.qg-alert {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--qg-soft-strong); background: var(--qg-soft); color: var(--qg-text);
  font-size: .9375rem; line-height: 1.45;
}
.qg-alert::before {
  content: "i"; flex: none; width: 20px; height: 20px; border-radius: 50%; margin-top: 1px;
  background: var(--qg-link); color: var(--qg-surface); font-size: .8125rem; font-weight: 800; line-height: 20px; text-align: center;
  font-family: Georgia, "Times New Roman", serif;
}
.qg-alert--error { border-color: var(--qg-danger-line); background: var(--qg-danger-soft); color: var(--qg-danger-text); }
.qg-alert--error::before { content: "!"; background: var(--qg-danger); color: #fff; font-family: inherit; }
.qg-alert--warn { border-color: var(--qg-warn-line); background: var(--qg-warn-soft); color: var(--qg-warn-text); }
.qg-alert--warn::before { content: "!"; background: #b54708; color: #fff; font-family: inherit; }
.qg-alert--ok { border-color: var(--qg-ok-line); background: var(--qg-ok-soft); color: var(--qg-ok-text); }
.qg-alert--ok::before { content: "✓"; background: #067647; color: #fff; font-family: inherit; }
.qg-alert:empty { display: none; }
.qg-alert__body { min-width: 0; flex: 1 1 auto; }
.qg-alert strong { font-weight: 700; }
.qg-alert a, .qg-alert .qg-linkbtn { color: inherit; }

.qg-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: .8125rem; font-weight: 650; line-height: 1.35; white-space: nowrap;
  background: var(--qg-wash); color: var(--qg-muted); border: 1px solid var(--qg-line);
}
.qg-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.qg-pill--ok { background: var(--qg-ok-soft); color: var(--qg-ok-text); border-color: var(--qg-ok-line); }
.qg-pill--warn { background: var(--qg-warn-soft); color: var(--qg-warn-text); border-color: var(--qg-warn-line); }
.qg-pill--danger { background: var(--qg-danger-soft); color: var(--qg-danger-text); border-color: var(--qg-danger-line); }
.qg-pill--plain::before { display: none; }

.qg-skel {
  display: block; border-radius: 8px; background: var(--qg-wash);
  background-image: linear-gradient(90deg, transparent 0, rgba(255, 255, 255, .7) 50%, transparent 100%);
  background-size: 200% 100%; background-repeat: no-repeat; animation: qg-shimmer 1.4s ease-in-out infinite;
}
@keyframes qg-shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }

/* Card brand marks, drawn in CSS so they cost no requests and work from PHP and JS alike. */
.qg-brand {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 24px;
  border: 1px solid #d0d5dd; border-radius: 5px; background: #fff; color: #344054;
  font: 800 9px/1 var(--qg-font); letter-spacing: .02em; overflow: hidden; white-space: nowrap; vertical-align: middle;
}
.qg-brand--visa { color: #1a1f71; font-style: italic; font-size: 10px; }
.qg-brand--mastercard {
  font-size: 0;
  background-image: radial-gradient(circle at 37% 50%, #eb001b 0 6.5px, transparent 7px), radial-gradient(circle at 63% 50%, #f79e1b 0 6.5px, transparent 7px);
  background-color: #fff;
}
.qg-brand--amex { background: #1f72cd; border-color: #1f72cd; color: #fff; font-size: 8px; }
.qg-brand--discover { font-size: 7px; color: #23272e; gap: 2px; }
.qg-brand--discover::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #f47216; }
.qg-brand--card { font-size: 0; background-image: linear-gradient(#98a2b3, #98a2b3); background-size: 100% 5px; background-position: 0 6px; background-repeat: no-repeat; }

/* ------------------------------------------------------------------ 7. Donation page layout */
.qg-give {
  max-width: 1120px; margin: 0 auto; padding: 20px 16px 24px;
  display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "head" "card" "story";
}
.qg-give__head { grid-area: head; min-width: 0; }
.qg-give__card { grid-area: card; min-width: 0; }
.qg-give__story { grid-area: story; min-width: 0; padding-top: 4px; }
.qg-give--solo { max-width: 520px; }

.qg-brandrow { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
/* A fixed height (and the image's own proportions) so a logo with no stated size, like most SVGs, still shows. */
.qg-logo { display: block; height: 48px; width: auto; max-width: min(220px, 60vw); object-fit: contain; object-position: left center; }
.qg-org {
  font-size: .875rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--qg-ink-link); line-height: 1.3;
}
.qg-headline {
  margin-top: 6px; font-size: clamp(1.625rem, 1.2rem + 2.1vw, 2.625rem); line-height: 1.14; font-weight: 700; letter-spacing: -.022em;
  text-wrap: balance;
}
.qg-headline--long { font-size: clamp(1.5rem, 1.15rem + 1.6vw, 2.125rem); line-height: 1.2; }

.qg-body { font-size: 1.0625rem; line-height: 1.65; color: var(--qg-ink); max-width: 62ch; }
.qg-body p + p { margin-top: 1em; }

.qg-hero {
  display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--qg-radius-lg);
  background: var(--qg-ink-line); margin-top: 24px;
}

.qg-story > * + * { margin-top: 28px; }
.qg-story > .qg-hero { margin-top: 24px; }
.qg-h {
  font-size: .875rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--qg-ink-muted); margin-bottom: 12px;
}

/* Campaign progress */
.qg-progress { padding: 20px; border: 1px solid var(--qg-ink-line); border-radius: var(--qg-radius-lg); }
.qg-progress__name { font-weight: 700; margin-bottom: 2px; }
.qg-progress__desc { color: var(--qg-ink-muted); font-size: .9375rem; margin-bottom: 14px; }
.qg-progress__top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-bottom: 10px; }
.qg-progress__raised { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.qg-progress__goal { color: var(--qg-ink-muted); }
.qg-progress__bar { height: 12px; border-radius: 999px; background: var(--qg-ink-line); overflow: hidden; }
.qg-progress__fill {
  display: block; height: 100%; width: var(--qg-progress, 0%); min-width: 12px; border-radius: 999px;
  background: linear-gradient(90deg, var(--qg-ink-link), var(--qg-bar-end));
  transform-origin: left center; animation: qg-grow .9s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes qg-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.qg-progress__meta { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 12px; font-size: .9375rem; color: var(--qg-ink-muted); }
.qg-progress__meta strong { color: var(--qg-ink); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Recent supporters + donor wall */
.qg-supporters { display: grid; gap: 2px; }
.qg-supporter { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 0; font-size: .9375rem; line-height: 1.4; }
.qg-supporter + .qg-supporter { border-top: 1px solid var(--qg-ink-line); }
.qg-avatar {
  flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-content: center;
  background: var(--qg-ink-line); color: var(--qg-ink); font-size: .8125rem; font-weight: 700; text-transform: uppercase;
}
.qg-supporter__text { min-width: 0; flex: 1 1 auto; }
.qg-supporter__text strong { font-weight: 700; }
.qg-supporter__ago { color: var(--qg-ink-muted); white-space: nowrap; }
.qg-supporter .qg-skel { height: 14px; flex: 1 1 auto; background-color: var(--qg-ink-line); }
.qg-supporter .qg-skel--avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; }

.qg-wall { display: flex; flex-wrap: wrap; gap: 8px; }
.qg-wall__name {
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--qg-ink-line); font-size: .9375rem; font-weight: 600; line-height: 1.4;
}

/* ------------------------------------------------------------------ 8. The giving card */
.qg-givecard { padding: 20px 18px 22px; }
.qg-givecard__title { font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; margin-bottom: 4px; }
.qg-givecard__sub { color: var(--qg-muted); font-size: .9375rem; margin-bottom: 16px; }
.qg-form { display: grid; gap: 22px; }
.qg-sect { display: grid; gap: 12px; min-width: 0; }
.qg-sect__title { font-size: 1.0625rem; font-weight: 700; line-height: 1.3; }
legend.qg-sect__title { padding-bottom: 12px; }

.qg-program { display: flex; gap: 8px; align-items: flex-start; font-size: .9375rem; color: var(--qg-muted); line-height: 1.45; }
.qg-program .qg-icon { color: var(--qg-link); margin-top: .18em; fill: currentColor; stroke: none; }

.qg-impact {
  display: flex; gap: 8px; align-items: flex-start; min-height: 1.45em; font-size: .9375rem; line-height: 1.45; font-weight: 600; color: var(--qg-text);
}
.qg-impact .qg-icon { color: var(--qg-link); margin-top: .18em; fill: currentColor; stroke: none; }
.qg-impact.is-empty .qg-icon { visibility: hidden; }
.qg-error:not(:empty) + .qg-impact.is-empty { display: none; }

.qg-giving-as {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 10px 14px; border-radius: 10px;
  background: var(--qg-soft); border: 1px solid var(--qg-soft-strong); font-size: .9375rem; line-height: 1.4;
}
.qg-giving-as strong { font-weight: 700; }

/* Payment fields: demo inputs, Adyen secured fields and the Stripe element all look like .qg-input. */
.qg-pay { display: grid; gap: 12px; }
/* The card's billing address, under the card fields (pages/donate.php, the portal's Add a card). */
.qg-billing { margin-top: 8px; }
.qg-billing[hidden] { display: none; }
.qg-billing__title { margin: 0; font-size: 1rem; font-weight: 700; line-height: 1.35; color: var(--qg-text); }
.qg-cse { display: block; min-width: 0; }
.qg-cse > span:first-child { display: block; margin-bottom: 6px; font-size: .9375rem; font-weight: 600; line-height: 1.35; }
.qg-cse [data-cse], .qg-stripe {
  display: block; width: 100%; height: 48px; padding: 13px 14px; overflow: hidden;
  background: var(--qg-surface); border: 1px solid var(--qg-control); border-radius: 10px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.qg-stripe { height: auto; min-height: 48px; padding: 14px; }
.qg-cse [data-cse]:focus-within, .qg-cse [data-cse].is-focus, .qg-stripe.StripeElement--focus {
  border-color: var(--qg-link); box-shadow: 0 0 0 3px var(--qg-ring);
}
.qg-cse [data-cse].is-invalid, .qg-stripe.StripeElement--invalid { border-color: var(--qg-danger); box-shadow: 0 0 0 3px var(--qg-danger-soft); }
.qg-cse [data-cse] iframe, .qg-cse [data-cse] .js-iframe {
  display: block; width: 100% !important; height: 22px !important; border: 0 !important; margin: 0 !important; padding: 0 !important;
}
.qg-pay__skel { display: grid; gap: 12px; }
.qg-pay__skel .qg-skel { height: 48px; border-radius: 10px; }
.qg-pay__note { font-size: .875rem; color: var(--qg-muted); line-height: 1.45; }

/* Total + submit */
.qg-total {
  padding: 12px 14px; border-radius: 10px; background: var(--qg-wash); font-size: .9375rem; line-height: 1.45; color: var(--qg-text);
}
.qg-total strong { font-weight: 700; font-variant-numeric: tabular-nums; }
.qg-submitwrap { display: grid; gap: 12px; }
.qg-trust { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; font-size: .875rem; font-weight: 600; color: var(--qg-muted); }
.qg-trust__secure { display: inline-flex; align-items: center; gap: 6px; color: var(--qg-text); }
.qg-trust__cards { display: inline-flex; gap: 4px; }
.qg-fine { text-align: center; font-size: .875rem; line-height: 1.5; color: var(--qg-muted); }
.qg-fine + .qg-fine { margin-top: -6px; }
/* A link standing on its own line gets a finger-sized target without changing how it looks. */
.qg-fine > a:only-child, .qg-hint > a:only-child { display: inline-block; padding: 12px 8px; margin: -10px 0; font-weight: 600; }
.qg-wait { text-align: center; font-size: .9375rem; color: var(--qg-muted); }

/* Monthly suggestion / confirm-the-total panel (in the card, never a pop-up). */
.qg-panel {
  padding: 16px; border-radius: var(--qg-radius); border: 2px solid var(--qg-link); background: var(--qg-soft);
}
.qg-panel:focus { outline: none; }
.qg-panel__title { font-size: 1.125rem; font-weight: 700; line-height: 1.3; margin-bottom: 4px; }
.qg-panel__text { font-size: .9375rem; color: var(--qg-text); margin-bottom: 14px; }
.qg-panel__actions { display: grid; gap: 10px; }

/* Thank-you */
.qg-thanks { text-align: center; padding: 8px 0 4px; }
.qg-thanks:focus { outline: none; }
.qg-thanks__check { width: 72px; height: 72px; margin: 4px auto 16px; display: block; }
.qg-thanks__check circle { fill: var(--qg-fill); transform-origin: center; animation: qg-pop .45s cubic-bezier(.2, 1.3, .4, 1) both; }
.qg-thanks__check path {
  fill: none; stroke: var(--qg-on-fill); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 48; stroke-dashoffset: 48; animation: qg-draw .45s .3s ease-out forwards;
}
.qg-thanks__check--wait circle { fill: var(--qg-wash); stroke: var(--qg-control); stroke-width: 2; }
.qg-thanks__check--wait path { stroke: var(--qg-text); }
@keyframes qg-pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes qg-draw { to { stroke-dashoffset: 0; } }
.qg-thanks__title { font-size: 1.625rem; font-weight: 700; letter-spacing: -.015em; line-height: 1.2; }
.qg-thanks__text { margin-top: 8px; font-size: 1.0625rem; line-height: 1.55; color: var(--qg-text); }
.qg-thanks__note { margin-top: 14px; font-size: .9375rem; color: var(--qg-muted); line-height: 1.5; }
.qg-receipt {
  margin-top: 20px; text-align: left; border: 1px solid var(--qg-line); border-radius: var(--qg-radius); overflow: hidden;
}
.qg-receipt > div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 14px; font-size: .9375rem; line-height: 1.4; }
.qg-receipt > div + div { border-top: 1px solid var(--qg-line); }
.qg-receipt dt { color: var(--qg-muted); flex: none; }
.qg-receipt dd { font-weight: 650; text-align: right; min-width: 0; font-variant-numeric: tabular-nums; }
.qg-receipt dd small { display: block; font-weight: 400; font-size: .875rem; color: var(--qg-muted); }
.qg-thanks__actions { display: grid; gap: 10px; margin-top: 20px; }
.qg-share { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--qg-line); }
.qg-share__title { font-size: 1rem; font-weight: 700; margin-bottom: 12px; }
.qg-share__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

/* Honeypot: off-screen, never display:none (some bots skip hidden inputs). */
.qg-hp { position: absolute !important; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; opacity: 0; }

/* ------------------------------------------------------------------ 9. Wider screens */
@media (min-width: 480px) {
  .qg-givecard { padding: 28px 28px 28px; }
  .qg-give { padding-left: 24px; padding-right: 24px; }
  .qg-panel__actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qg-thanks__actions--pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 960px) {
  .qg-give {
    padding: 44px 32px 32px; column-gap: 64px; row-gap: 28px;
    grid-template-columns: minmax(0, 1fr) minmax(400px, 468px);
    grid-template-areas: "head card" "story card"; grid-template-rows: auto 1fr; align-items: start;
  }
  .qg-give--solo { max-width: 560px; padding-top: 44px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "card"; grid-template-rows: auto; }
  .qg-give--solo .qg-give__head { text-align: center; }
  .qg-give--solo .qg-brandrow { justify-content: center; }
  .qg-give__card { position: sticky; top: 24px; }
  .qg-give--solo .qg-give__card { position: static; }
  .qg-give__head { padding-top: 12px; }
  .qg-brandrow { margin-bottom: 22px; }
  .qg-logo { height: 60px; max-width: 260px; }
  .qg-give--solo .qg-logo { object-position: center; }
  .qg-give__story { padding-top: 0; }
  .qg-body { font-size: 1.125rem; }
}

/* Narrow phones (and 200% zoom on small screens): stack what was side by side. */
@media (max-width: 359px) {
  .qg-seg__item { flex-basis: 68px; }
  .qg-seg__face { padding: 6px 4px; font-size: .9375rem; }
  .qg-row--city { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .qg-row--city > :first-child { grid-column: 1 / -1; }
  .qg-choice { flex-basis: calc(50% - 10px) !important; }
  .qg-givecard { padding: 16px 14px 18px; }
  .qg-give { padding-left: 10px; padding-right: 10px; }
}
@media (max-width: 479px) {
  .qg-choices[data-count="4"] .qg-choice, .qg-choices[data-count="7"] .qg-choice, .qg-choices[data-count="8"] .qg-choice { flex-basis: calc(50% - 10px); }
  /* Four or five schedules do not fit on one line: two rows, evenly. */
  .qg-seg[data-count="4"] .qg-seg__item { flex-basis: 40%; }
  .qg-seg[data-count="5"] .qg-seg__item { flex-basis: 30%; }
}

/* ------------------------------------------------------------------ 10. Embedded (inside embed.js's iframe) */
html.qg-embedded, .qg-embedded body { background: transparent; }
.qg-embedded .qg-give { max-width: none; padding: 0; gap: 0; display: block; }
.qg-embedded .qg-givecard { box-shadow: none; }
.qg-embedded.qg-embedded--inline .qg-give { padding: 2px; }
.qg-embedded.qg-embedded--overlay .qg-givecard { border: 0; border-radius: 0; padding-top: 24px; }
.qg-embedded .qg-banner { border: 1px solid var(--qg-warn-line); border-radius: 10px; margin-bottom: 16px; }
.qg-embedded .qg-foot { padding: 14px 0 0; color: var(--qg-muted); }
.qg-embedded .qg-foot a { color: inherit; }

/* ------------------------------------------------------------------ 11. Motion + print */
/* Reduced motion: nothing slides, grows, draws or shimmers. State changes still happen, at once. (Each
   animation is switched off by name with its end state given, rather than shortening every transition on
   the page to a fraction of a millisecond, which makes every style change a transition.) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
  .qg-progress__fill, .qg-skel, .qg-toast, .qg-thanks__check circle { animation: none !important; }
  .qg-skel { background-image: none; opacity: .7; } /* a flat, quiet placeholder instead of a frozen shimmer */
  .qg-thanks__check path { animation: none !important; stroke-dashoffset: 0; }
  .qg-spinner { animation: qg-breathe 1s ease-in-out infinite alternate; }
}
@keyframes qg-breathe { from { opacity: .35; } to { opacity: 1; } }
@media print {
  body { background: #fff; color: #000; }
  .qg-banner, .qg-foot, .qg-skip { display: none !important; }
  .qg-card { box-shadow: none; }
}
