@font-face {
  font-family: "Montserrat";
  src: url("/static/fonts/montserrat.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Roboto";
  src: url("/static/fonts/roboto.woff2") format("woff2");
  font-display: swap;
}

:root {
  --text-primary: #1a1a1a;
  --bg-main: #f5f4f1;
  --primary: #283e50;
  --accent: #e67e22;
  --font-main: Montserrat, system-ui, sans-serif;
  --primary-dark: color-mix(in srgb, var(--primary) 76%, black);
  --bg-card: color-mix(in srgb, var(--bg-main) 10%, white);
  --highlight-bg: color-mix(in srgb, var(--bg-main) 82%, white);
  --text-secondary: color-mix(in srgb, var(--text-primary) 66%, var(--bg-main));
  --text-muted: color-mix(in srgb, var(--text-primary) 45%, var(--bg-main));
  --border-color: color-mix(in srgb, var(--text-primary) 12%, var(--bg-main));
  --success: #22c55e;
  --error: #b42318;
  --shadow-card: 0 4px 6px -1px rgb(0 0 0 / 10%), 0 2px 4px -2px rgb(0 0 0 / 10%);
  --shadow-sticky: 0 -4px 18px rgb(0 0 0 / 12%);
  color: var(--text-primary);
  background: var(--bg-main);
  font-family: var(--font-main);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  scroll-behavior: smooth;
  scroll-padding-bottom: 92px;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  padding-bottom: 92px;
  background: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 1rem;
  line-height: 1.625;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; }

.campaign-header {
  min-height: 76px;
  background: var(--header-bg);
  box-shadow: 0 1px 3px rgb(0 0 0 / 10%);
}

.campaign-header a {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.campaign-logo {
  width: auto;
  height: 60px;
  max-width: min(78vw, 240px);
  object-fit: contain;
}

.campaign-symbol {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 48%);
  border-radius: 50%;
  color: color-mix(in srgb, var(--accent) 68%, white);
  font-family: Georgia, serif;
  font-size: 1.05rem;
}

.page-shell {
  width: min(42rem, 100%);
  margin: 0 auto;
  padding: 16px;
}

.hero {
  margin-bottom: 24px;
  text-align: center;
}

h1,
h2,
p { overflow-wrap: anywhere; }

h1,
h2 {
  margin: 0;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-weight: 700;
  text-wrap: balance;
}

h1 {
  margin-bottom: 12px;
  font-size: 1.5rem;
  line-height: 1.3;
  white-space: pre-line;
}

h2 {
  margin-bottom: 12px;
  font-size: 1.125rem;
  line-height: 1.4;
}

.hero-image-shell {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
}

.hero-image-shell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(var(--media-zoom, 1));
  transform-origin: center;
}

.hero-subtitle {
  margin: 0 0 16px;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.55;
}

.button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 14px 24px;
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: .015em;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
  cursor: pointer;
}

.button-primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.button-primary:hover {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
}

.button-secondary {
  border-color: var(--primary);
  background: var(--bg-card);
  color: var(--primary);
}

.button-secondary:hover {
  background: var(--highlight-bg);
}

.button-wide,
.hero-cta {
  width: 100%;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 65%, white);
  outline-offset: 3px;
}

.card {
  margin-bottom: 16px;
  border-radius: 12px;
  padding: 24px;
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
}

.story-section + .story-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.story-section p,
.final-cta p,
.support-message p {
  margin: 0;
}

.story-section p + p {
  margin-top: 16px;
}

.story-image-shell {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  margin: 16px 0;
  border-radius: 12px;
  background: var(--highlight-bg);
}

.story-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(var(--media-zoom, 1));
  transform-origin: center;
}

.checkout-card {
  scroll-margin-top: 16px;
}

.checkout-card > h2 {
  margin-bottom: 6px;
  text-align: center;
}

.checkout-subtitle {
  margin: 0 0 20px;
  color: var(--text-secondary);
  font-size: .875rem;
  line-height: 1.5;
  text-align: center;
}

fieldset {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

legend {
  margin-bottom: 14px;
  font-size: .875rem;
  font-weight: 700;
}

.amount-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.amount {
  min-height: 56px;
  border: 2px solid var(--primary);
  border-radius: 8px;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  cursor: pointer;
}

.amount:hover {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
}

.amount.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--accent);
}

.custom-amount-label {
  display: block;
  margin-top: 16px;
  font-size: .875rem;
  font-weight: 700;
}

.custom-amount-field {
  display: flex;
  min-height: 50px;
  align-items: stretch;
  margin-top: 7px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #fff;
}

.custom-amount-field:focus-within {
  border-color: var(--primary);
}

.custom-amount-field span {
  display: flex;
  align-items: center;
  border-right: 1px solid var(--border-color);
  padding: 0 12px;
  background: var(--highlight-bg);
  color: var(--text-secondary);
  font-size: .875rem;
  font-weight: 700;
}

.custom-amount-field input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
}

label {
  display: grid;
  gap: 7px;
  margin-top: 16px;
  color: var(--text-secondary);
  font-size: .875rem;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff;
  color: var(--text-primary);
}

.product-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-block: 1px solid var(--border-color);
  padding: 18px 0;
}

.product-choice strong { color: var(--primary); }

.shipping-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
  margin-top: 24px;
}

.shipping-grid legend { grid-column: 1 / -1; }
.span-two { grid-column: span 2; }

.button-wide { margin-top: 18px; }

.payment-note {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: .75rem;
  text-align: center;
}

.form-error {
  margin: 14px 0 0;
  color: var(--error);
  font-size: .875rem;
}

.support-card h2 { margin-bottom: 18px; }

.support-message {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.support-message + .support-message {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
}

.support-avatar {
  position: relative;
  display: grid;
  width: 48px;
  height: 48px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 12%, var(--bg-card));
  color: var(--primary);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .04em;
}

.support-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.support-content { min-width: 0; }

.support-content header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
  font-size: .875rem;
}

.support-content header span,
.support-content footer {
  color: var(--text-muted);
  font-size: .75rem;
}

.support-content footer {
  margin-top: 7px;
  font-weight: 600;
}

.support-content footer span {
  color: color-mix(in srgb, var(--primary) 74%, var(--accent));
}

.final-cta p {
  color: var(--text-secondary);
  line-height: 1.55;
}

.final-cta p + p { margin-top: 12px; }

.site-footer {
  width: min(42rem, 100%);
  margin: 0 auto;
  padding: 8px 16px 24px;
  color: var(--text-muted);
  font-size: .75rem;
  text-align: center;
}

.site-footer p { margin: 2px 0; }

.sticky-action {
  position: fixed;
  z-index: 40;
  right: 0;
  bottom: 0;
  left: 0;
  border-top: 1px solid var(--border-color);
  padding: 10px 16px;
  background: var(--bg-card);
  box-shadow: var(--shadow-sticky);
}

.sticky-action .button {
  display: flex;
  width: min(40rem, 100%);
  min-height: 48px;
  margin: 0 auto;
  padding-block: 11px;
}

dialog {
  width: min(28rem, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  border: 0;
  border-radius: 16px;
  padding: 0;
  background: transparent;
  color: var(--text-primary);
}

dialog::backdrop {
  background: rgb(0 0 0 / 70%);
  backdrop-filter: blur(3px);
}

.modal-shell {
  position: relative;
  overflow: auto;
  max-height: calc(100dvh - 24px);
  border-radius: 16px;
  padding: 24px;
  background: var(--bg-card);
  box-shadow: 0 20px 50px rgb(0 0 0 / 24%);
}

.modal-shell h2 {
  margin: 0 36px 4px;
  font-size: 1.25rem;
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--border-color);
  color: var(--text-secondary);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.modal-label {
  margin: 0;
  color: var(--text-secondary);
  font-size: .875rem;
  text-align: center;
}

.pix-amount {
  display: block;
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 1.875rem;
  line-height: 1.2;
  text-align: center;
}

.pix-status {
  margin: 0 0 12px;
  color: var(--text-secondary);
  font-size: .875rem;
  text-align: center;
}

.qr-shell {
  display: grid;
  width: min(228px, 100%);
  min-height: 228px;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 12px;
  padding: 12px;
  background: var(--highlight-bg);
}

.qr-shell.is-loading::after {
  width: 34px;
  height: 34px;
  border: 4px solid color-mix(in srgb, var(--primary) 22%, transparent);
  border-top-color: var(--primary);
  border-radius: 50%;
  content: "";
  animation: pix-loading 700ms linear infinite;
}

@keyframes pix-loading {
  to { transform: rotate(360deg); }
}

#pix-qr {
  width: min(204px, 100%);
  height: auto;
  background: #fff;
}

.modal-shell textarea {
  min-height: 72px;
  resize: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .75rem;
}

.payment-steps {
  margin-top: 18px;
  border-left: 4px solid var(--primary);
  border-radius: 0 8px 8px 0;
  padding: 12px 14px;
  background: var(--highlight-bg);
  color: var(--text-secondary);
  font-size: .8125rem;
}

.payment-steps strong { color: var(--text-primary); }

.payment-steps ol {
  margin: 6px 0 0;
  padding-left: 20px;
}

.thanks-page {
  padding-bottom: 40px;
}

.thanks-header { box-shadow: none; }

.success-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 22px 16px;
  background: var(--success);
  color: #fff;
}

.success-banner strong {
  display: block;
  font-size: 1.125rem;
}

.success-banner p {
  margin: 1px 0 0;
  font-size: .875rem;
}

.success-mark {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid rgb(255 255 255 / 70%);
  border-radius: 50%;
  font-size: 1.25rem;
  font-weight: 700;
}

.thanks-shell {
  width: min(32rem, calc(100% - 32px));
  margin: 28px auto 0;
  text-align: center;
}

.thanks-shell h1 {
  margin-bottom: 12px;
  font-size: 1.5rem;
}

.thanks-shell > p {
  margin: 0;
  color: var(--text-secondary);
}

@media (max-width: 560px) {
  .page-shell { padding: 14px; }
  .card { padding: 20px; }
  .hero-image-shell img { max-height: none; }
  .shipping-grid { grid-template-columns: 1fr; }
  .span-two { grid-column: auto; }
  .modal-shell { padding: 20px 16px; }
  .qr-shell { width: min(212px, 100%); min-height: 212px; }
  #pix-qr { width: min(188px, 100%); }
}

@media (min-width: 760px) {
  .sticky-action { display: none; }
  body { padding-bottom: 0; }
  html { scroll-padding-bottom: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
