/* Donate pages (askittv, askitspeed, tvcalibration). Builds on assets/css/site.css. */

.donate-hero [hidden], .donate-main [hidden], .donate-modal[hidden] { display: none !important; }

/* Hero */
.donate-hero { padding-top: var(--space-7); padding-bottom: var(--space-6); }
.donate-hero > * { max-width: 760px; }
.donate-back {
  display: flex; width: fit-content; align-items: center; gap: 6px; margin-bottom: var(--space-5);
  font-size: 0.9rem; font-weight: 500; color: var(--muted);
}
.donate-back:hover { color: var(--ink); }
.donate-back svg { width: 16px; height: 16px; }
.donate-hero h1 { font-size: clamp(2.1rem, 4.4vw, 3.1rem); margin-bottom: var(--space-4); }
.donate-hero h1 .accent { color: var(--brand); }
.donate-hero .lead { margin-bottom: var(--space-5); }
.donate-proof { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); color: var(--muted); font-size: 0.92rem; }
.donate-proof li { display: inline-flex; align-items: center; gap: 6px; }
.donate-proof svg { width: 16px; height: 16px; color: var(--success); }
.donate-proof a { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.donate-proof a svg { color: currentColor; width: 14px; height: 14px; }

/* Notices after returning from Stripe */
.donate-main { padding-bottom: var(--space-8); }
.donate-notice {
  display: flex; align-items: flex-start; gap: var(--space-3); margin-bottom: var(--space-5);
  padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--bg-soft); color: var(--ink-2); font-size: 0.95rem;
}
.donate-notice svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; color: var(--brand); }
.donate-notice.is-warning { background: var(--warning-soft); border-color: #f3dcb4; color: #7c3a06; }
.donate-notice.is-warning svg { color: var(--warning); }

/* Layout */
.donate-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: var(--space-6); align-items: start; }
.donate-form-card { padding: var(--space-6); box-shadow: var(--shadow); }
.donate-card-title { font-size: 1.2rem; margin-bottom: var(--space-5); }
.donate-aside { display: grid; gap: var(--space-5); position: sticky; top: calc(var(--nav-h) + var(--space-5)); }

/* Form steps */
.donate-step { border: 0; margin: 0 0 var(--space-5); padding: 0 0 var(--space-5); border-bottom: 1px solid var(--line); min-width: 0; }
.donate-step legend { float: left; width: 100%; padding: 0; margin-bottom: var(--space-3); font-size: 0.875rem; font-weight: 600; color: var(--ink); }
.donate-step legend + * { clear: both; }
.donate-step .hint { font-weight: 400; color: var(--faint); font-size: 0.8rem; margin-left: 4px; }
.donate-step-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); }
.donate-step-head legend { float: none; width: auto; margin: 0; }
.donate-step-head + * { clear: both; }

/* Segmented toggle (frequency, currency) */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; border-radius: var(--radius); background: var(--bg-sunken); }
.segmented-option {
  display: grid; gap: 2px; justify-items: center; text-align: center;
  padding: 10px 12px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; color: var(--muted); font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.segmented-option:hover { color: var(--ink); }
.segmented-option.is-active { background: var(--bg); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-sm); }
.segmented-title { font-size: 0.95rem; }
.segmented-sub { font-size: 0.78rem; font-weight: 400; color: var(--faint); }
.segmented-sm { display: inline-grid; padding: 3px; }
.segmented-sm .segmented-option { padding: 5px 10px; font-size: 0.8rem; }

/* Amounts */
.amount-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); margin-bottom: var(--space-3); }
.amount-option {
  height: 48px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--bg);
  color: var(--ink); font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), color 0.15s var(--ease);
}
.amount-option:hover { border-color: var(--ink); }
.amount-option.is-active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); box-shadow: inset 0 0 0 1px var(--brand); }
.amount-custom { position: relative; display: block; }
.amount-custom-prefix { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; }
.amount-custom .input { padding-left: 32px; }
.amount-custom.is-active .input { border-color: var(--brand); }
.donate-error { display: flex; align-items: center; gap: 6px; margin-top: var(--space-2); color: var(--danger); font-size: 0.85rem; font-weight: 500; }
.donate-error svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Shout-out */
.donate-check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 0.95rem; color: var(--ink-2); }
.donate-check input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--brand); flex-shrink: 0; cursor: pointer; }
.donate-shoutout-fields { display: grid; gap: var(--space-4); margin-top: var(--space-4); }
.donate-shoutout-fields textarea.input { min-height: 96px; }
.donate-fineprint { display: flex; gap: var(--space-2); font-size: 0.84rem; color: var(--muted); line-height: 1.5; }
.donate-fineprint svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; color: var(--faint); }
#anonymousNotice { margin-top: var(--space-3); }

/* Submit */
.donate-submit { width: 100%; height: 52px; font-size: 1rem; }
.donate-secure { margin-top: var(--space-3); text-align: center; font-size: 0.82rem; color: var(--faint); }
.donate-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.donate-spin { width: 16px; height: 16px; animation: donateSpin 1s linear infinite; }
@keyframes donateSpin { to { transform: rotate(360deg); } }

/* Aside */
.donate-uses .checklist { gap: var(--space-3); }
.donate-uses .checklist li { color: var(--muted); line-height: 1.5; }
.donate-uses .checklist strong { color: var(--ink); font-weight: 600; }
.donate-preview-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.donate-preview-head .tag { font-family: var(--font-sans); letter-spacing: 0; text-transform: none; }

/* Supporter tiles (wall and preview) */
.supporter {
  display: flex; flex-direction: column; gap: var(--space-3); min-width: 0;
  padding: var(--space-5); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.supporter-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.supporter-name { font-size: 1.05rem; min-height: 1.2em; overflow-wrap: anywhere; }
.supporter-name:empty::before { content: attr(data-placeholder); color: var(--faint); font-weight: 600; }
.supporter-quote { color: var(--ink-2); font-size: 0.95rem; line-height: 1.55; overflow-wrap: anywhere; }
.supporter-quote.is-muted { color: var(--muted); }
.supporter-foot { display: flex; justify-content: space-between; gap: var(--space-3); margin-top: auto; padding-top: var(--space-3); border-top: 1px solid var(--line); font-size: 0.85rem; color: var(--muted); }
.supporter-foot strong { font-family: var(--font-mono); font-weight: 500; color: var(--ink); }
.supporter-preview { border-style: dashed; border-color: var(--line-strong); box-shadow: none; }
.supporter.is-new { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }

.supporters-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-5); }
.supporters-empty { grid-column: 1 / -1; padding: var(--space-6); text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); background: var(--bg); }
.donate-wall { border-bottom: 0; }
.donate-legal { margin-top: var(--space-6); font-size: 0.8rem; color: var(--faint); }

/* Thank-you dialog */
.donate-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: var(--space-4); background: rgba(11, 18, 32, 0.55); }
.donate-modal-card { width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow-y: auto; padding: var(--space-6); text-align: center; box-shadow: var(--shadow-lg); }
.donate-modal-icon { margin: 0 auto var(--space-4); background: var(--success-soft); color: var(--success); }
.donate-modal-card h2 { font-size: 1.5rem; margin-bottom: var(--space-3); }
.donate-modal-card > p { color: var(--muted); margin-bottom: var(--space-5); }
.donate-receipt { margin: 0 0 var(--space-5); padding: var(--space-4); border-radius: var(--radius); background: var(--bg-soft); border: 1px solid var(--line); text-align: left; display: grid; gap: var(--space-2); font-size: 0.92rem; }
.donate-receipt:empty { display: none; }
.donate-receipt > div { display: flex; justify-content: space-between; gap: var(--space-4); }
.donate-receipt dt { color: var(--muted); }
.donate-receipt dd { margin: 0; font-weight: 600; color: var(--ink); text-align: right; overflow-wrap: anywhere; }
.donate-receipt .donate-receipt-msg { display: grid; gap: 4px; padding-top: var(--space-2); border-top: 1px solid var(--line); }
.donate-receipt .donate-receipt-msg dd { text-align: left; font-weight: 400; color: var(--ink-2); }
.donate-modal-close { width: 100%; }
body.has-modal { overflow: hidden; }

@media (max-width: 960px) {
  .donate-layout { grid-template-columns: 1fr; }
  .donate-aside { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .supporters-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .donate-hero { padding-top: var(--space-5); }
  .donate-hero .lead { font-size: 1.05rem; }
  .donate-form-card { padding: var(--space-5); }
  .donate-aside { grid-template-columns: 1fr; }
  .supporters-grid { grid-template-columns: 1fr; }
  .donate-step-head { flex-wrap: wrap; }
  .donate-modal-card { padding: var(--space-5); }
}
