/* ==========================================================================
   aczh.dev — SUPPORT / CONTRIBUTION PAGE
   Layered on top of the global tokens in /responsive.css so the page inherits
   the exact same typography, spacing, radius and colour scale as every other
   mini-app.
   ========================================================================== */

body {
  background-image:
    radial-gradient(at 15% 0%, rgba(245, 158, 11, 0.10) 0px, transparent 45%),
    radial-gradient(at 85% 10%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(14, 165, 233, 0.06) 0px, transparent 50%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
}

.support-shell {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  /* Horizontal + bottom only. That leading `0` block-start value is exactly what
     left the back button flush against the top of the screen; the offset now
     comes from --aczh-header-pad-top in /responsive.css. */
  padding-inline: clamp(1rem, 3.5vw, 2.5rem);
  padding-bottom: clamp(2rem, 5vh, 4rem);
}

/* ── Hero ────────────────────────────────────────────────────────────────── */

.support-hero {
  text-align: center;
  padding: clamp(1.5rem, 4vh, 2.5rem) 0 clamp(1.25rem, 3vh, 2rem);
}

.support-hero-icon {
  width: clamp(64px, 9vw, 84px);
  height: clamp(64px, 9vw, 84px);
  margin: 0 auto clamp(0.9rem, 2vh, 1.25rem);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #ffffff 0%, #fffbeb 100%);
  border: 1px solid #fde68a;
  box-shadow: 0 10px 28px -10px rgba(180, 83, 9, 0.35);
}

.support-hero-icon svg {
  width: 52%;
  height: 52%;
  color: #b45309;
}

.support-hero h1 {
  font-weight: 800;
  font-size: clamp(1.85rem, 3.8vw, 2.75rem);
  letter-spacing: -0.03em;
  color: #0f172a;
  line-height: 1.15;
  margin-bottom: 0.6rem;
}

.support-hero p {
  font-size: clamp(0.95rem, 1.4vw, 1.05rem);
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 34rem;
  margin: 0 auto;
}

/* ── Contribution card ───────────────────────────────────────────────────── */

.support-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 2.5vw, 1.85rem);
  box-shadow: 0 12px 32px -12px rgba(15, 23, 42, 0.12), 0 2px 8px -4px rgba(15, 23, 42, 0.06);
}

.support-section + .support-section {
  margin-top: clamp(1.1rem, 2.2vw, 1.5rem);
}

.support-label {
  display: block;
  font-size: clamp(0.78rem, 1.1vw, 0.83rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

/* Frequency segmented control */
.freq-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
  padding: 0.3rem;
  background: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
}

.freq-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: clamp(0.85rem, 1.2vw, 0.93rem);
  font-weight: 700;
  padding: 0.55rem 0.75rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.freq-btn:hover {
  color: var(--text-primary);
}

.freq-btn.active {
  background: var(--surface-card);
  color: var(--color-primary);
  border-color: var(--border-subtle);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.freq-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.freq-hint {
  margin-top: 0.6rem;
  font-size: clamp(0.76rem, 1.1vw, 0.82rem);
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

/* Preset amount grid */
.amount-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.amount-btn {
  appearance: none;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  padding: clamp(0.6rem, 1.4vw, 0.85rem) 0.3rem;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.amount-btn:hover {
  border-color: #fcd34d;
  background: #fffbeb;
  transform: translateY(-2px);
}

.amount-btn.active {
  border-color: #f59e0b;
  background: #fffbeb;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.16);
}

.amount-btn .amt {
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.amount-btn.active .amt {
  color: #b45309;
}

.amount-btn .tag {
  font-size: clamp(0.62rem, 0.85vw, 0.7rem);
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.2;
  min-height: 1em;
}

/* Custom amount input */
.custom-amount {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.9rem;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  background: #fcfcfd;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-amount:focus-within {
  border-style: solid;
  border-color: #f59e0b;
  background: #fffbeb;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

.custom-amount .cur {
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 0.95rem;
  flex-shrink: 0;
}

.custom-amount input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: clamp(0.95rem, 1.4vw, 1.05rem);
  font-weight: 700;
  color: var(--text-primary);
  padding: 0.25rem 0;
  font-variant-numeric: tabular-nums;
}

.custom-amount input:focus {
  outline: none;
}

.custom-amount input::-webkit-outer-spin-button,
.custom-amount input::-webkit-inner-spin-button {
  appearance: none;
  margin: 0;
}

/* Text fields */
.support-input {
  width: 100%;
  font-family: inherit;
  font-size: clamp(0.9rem, 1.3vw, 0.97rem);
  color: var(--text-primary);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.support-input::placeholder {
  color: var(--text-muted);
}

.support-input:focus {
  outline: none;
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.14);
}

.support-field-note {
  margin-top: 0.45rem;
  font-size: clamp(0.75rem, 1.05vw, 0.8rem);
  color: var(--text-muted);
  line-height: 1.5;
}

/* Currency selector */
.currency-picker {
  position: relative;
  display: flex;
  align-items: center;
}

.support-select {
  width: 100%;
  font-family: inherit;
  font-size: clamp(0.9rem, 1.3vw, 0.97rem);
  font-weight: 700;
  color: var(--text-primary);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.7rem 2.6rem 0.7rem 0.9rem;
  cursor: pointer;
  /* Native select: kill the OS arrow so the custom chevron is the only one. */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  text-overflow: ellipsis;
  transition: border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.support-select:hover {
  border-color: #cbd5e1;
}

.support-select:focus {
  outline: none;
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.14);
}

.currency-chevron {
  position: absolute;
  right: 0.95rem;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

/* "(optional)" suffix inside an uppercase label */
.opt-note {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  color: var(--text-muted);
}

/* Honeypot — hidden from humans, reachable by naive bots. */
.hp-field {
  position: absolute !important;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* Primary action */
.donate-btn {
  width: 100%;
  appearance: none;
  border: none;
  font-family: inherit;
  font-size: clamp(0.95rem, 1.4vw, 1.05rem);
  font-weight: 800;
  color: #ffffff;
  cursor: pointer;
  padding: clamp(0.85rem, 1.8vw, 1.05rem) 1.5rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, var(--color-primary) 0%, #7c3aed 100%);
  box-shadow: 0 10px 24px -10px rgba(79, 70, 229, 0.7);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}

.donate-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -12px rgba(79, 70, 229, 0.8);
}

.donate-btn:active:not(:disabled) {
  transform: translateY(0);
}

.donate-btn:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  box-shadow: none;
}

.donate-btn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.donate-btn .spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: support-spin 0.7s linear infinite;
}

.donate-btn.is-loading .spinner {
  display: block;
}

@keyframes support-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .donate-btn .spinner {
    animation-duration: 2s;
  }
}

/* Inline alert */
.support-alert {
  display: none;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 0.9rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: clamp(0.82rem, 1.15vw, 0.88rem);
  line-height: 1.5;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.support-alert.show {
  display: flex;
}

.support-alert svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* Trust row */
.trust-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem clamp(0.9rem, 2.2vw, 1.4rem);
  margin-top: clamp(1.1rem, 2.2vw, 1.5rem);
}

.trust-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: clamp(0.74rem, 1.05vw, 0.8rem);
  font-weight: 600;
  color: var(--text-secondary);
}

.trust-item svg {
  width: 14px;
  height: 14px;
  color: #10b981;
  flex-shrink: 0;
}

/* ── Where the money goes ────────────────────────────────────────────────── */

.uses-block {
  margin-top: clamp(1.5rem, 3vh, 2.25rem);
}

.uses-heading {
  font-size: clamp(0.78rem, 1.1vw, 0.83rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 0.9rem;
}

.uses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 0.65rem;
}

.use-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.use-item:hover {
  border-color: #fcd34d;
  transform: translateY(-2px);
}

.use-icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.use-icon svg {
  width: 15px;
  height: 15px;
  color: #b45309;
}

.use-item span {
  font-size: clamp(0.78rem, 1.1vw, 0.85rem);
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.35;
}

/* ── Thank-you page ──────────────────────────────────────────────────────── */

.thanks-mark {
  width: clamp(68px, 10vw, 88px);
  height: clamp(68px, 10vw, 88px);
  margin: 0 auto clamp(1rem, 2.5vh, 1.4rem);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #ecfdf5 0%, #ffffff 100%);
  border: 1px solid #a7f3d0;
  box-shadow: 0 10px 28px -10px rgba(16, 185, 129, 0.4);
}

.thanks-mark svg {
  width: 48%;
  height: 48%;
  color: #059669;
}

.thanks-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 2.5vw, 1.85rem);
  box-shadow: 0 12px 32px -12px rgba(15, 23, 42, 0.12), 0 2px 8px -4px rgba(15, 23, 42, 0.06);
}

.thanks-amount {
  font-size: clamp(2rem, 5vw, 2.9rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  text-align: center;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.thanks-cadence {
  text-align: center;
  font-size: clamp(0.85rem, 1.2vw, 0.93rem);
  color: var(--text-secondary);
  margin-top: 0.35rem;
  margin-bottom: clamp(1.1rem, 2.2vw, 1.5rem);
}

.thanks-rows {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: clamp(0.9rem, 1.8vw, 1.15rem);
}

.thanks-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  font-size: clamp(0.83rem, 1.2vw, 0.9rem);
}

.thanks-row dt {
  color: var(--text-muted);
  font-weight: 600;
  flex-shrink: 0;
}

.thanks-row dd {
  color: var(--text-primary);
  font-weight: 600;
  text-align: right;
  word-break: break-word;
  min-width: 0;
}

.recurring-note {
  display: flex;
  gap: 0.6rem;
  margin-top: clamp(1rem, 2vw, 1.35rem);
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius-sm);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-size: clamp(0.78rem, 1.1vw, 0.85rem);
  line-height: 1.55;
}

.recurring-note svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: clamp(1.1rem, 2.2vw, 1.5rem);
  text-decoration: none;
  font-weight: 700;
  font-size: clamp(0.88rem, 1.25vw, 0.95rem);
  color: var(--text-secondary);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  padding: clamp(0.65rem, 1.4vw, 0.8rem) 1.4rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.back-btn:hover {
  color: var(--color-primary);
  border-color: #cbd5e1;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.back-btn svg {
  width: 15px;
  height: 15px;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 520px) {
  .amount-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .amount-btn,
  .use-item,
  .donate-btn,
  .back-btn {
    transition: none;
  }
}