:root {
  --ink: #1b2420;
  --muted: #5c6863;
  --bg: #ffffff;
  --cream: #faf6ef;
  --line: #e9e4d9;
  --cta: #d9480f;
  --cta-dark: #b53a09;
  --green: #1f7a4d;
  --green-soft: #e7f3ec;
  --radius: 18px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 84px;
}
img { display: block; max-width: 100%; }
a { color: var(--green); text-underline-offset: 3px; }
button { font-family: inherit; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 18px; }

/* Aviso e barra do topo */
.notice { background: var(--cream); border-bottom: 1px solid var(--line); font-size: 12.5px; line-height: 1.45; color: var(--muted); padding: 8px 0; text-align: center; }
.topbar { background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15.5px; line-height: 1.2; min-width: 0; }
.brand svg { flex: none; color: var(--cta); }
.brand small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 54px; padding: 14px 22px;
  background: var(--cta); color: #fff; text-decoration: none;
  font-weight: 700; font-size: 17px; line-height: 1.2;
  border: 0; border-radius: 14px; cursor: pointer;
  box-shadow: 0 6px 18px rgba(217, 72, 15, .28);
  transition: background .15s, transform .15s;
}
.btn:hover { background: var(--cta-dark); }
.btn:active { transform: translateY(1px); }
.btn.block { width: 100%; }
.btn.small { min-height: 42px; padding: 9px 16px; font-size: 14.5px; border-radius: 11px; box-shadow: none; white-space: nowrap; }
.btn.ghost { min-height: 46px; background: #fff; color: var(--ink); border: 1px solid var(--line); box-shadow: none; font-weight: 600; font-size: 14.5px; padding: 10px 12px; }
.btn.ghost:hover { background: var(--cream); }

/* Estrutura principal */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "media" "donate" "content"; row-gap: 22px; padding-top: 26px; }
.intro { grid-area: intro; }
.media { grid-area: media; }
.donate { grid-area: donate; }
.content { grid-area: content; }

.tag { display: inline-flex; align-items: center; gap: 7px; background: var(--green-soft); color: var(--green); font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 999px; margin-bottom: 14px; }
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(30px, 7.4vw, 48px); line-height: 1.1; letter-spacing: -0.02em; text-wrap: balance; }
.sub { font-size: 18px; color: var(--muted); margin-top: 12px; max-width: 34em; }
.organizer { display: flex; align-items: center; gap: 12px; margin-top: 18px; font-size: 14.5px; line-height: 1.35; }
.organizer .avatar { flex: none; width: 42px; height: 42px; border-radius: 50%; background: var(--cream); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 700; color: var(--green); }
.organizer span { color: var(--muted); display: block; }

.photo { border-radius: var(--radius); overflow: hidden; background: var(--cream); aspect-ratio: 4 / 3; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 8px; }
.thumbs button { padding: 0; border: 2px solid transparent; border-radius: 12px; overflow: hidden; cursor: pointer; background: var(--cream); aspect-ratio: 1; opacity: .75; transition: opacity .15s; }
.thumbs button:hover, .thumbs button[aria-current="true"] { opacity: 1; }
.thumbs button[aria-current="true"] { border-color: var(--cta); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }

/* Cartão de doação */
.card { border: 1px solid var(--line); border-radius: 22px; padding: 22px; background: #fff; box-shadow: 0 14px 40px rgba(27, 36, 32, .09); }
.raised { font-family: var(--serif); font-size: 38px; font-weight: 600; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.goal { color: var(--muted); font-size: 15px; margin-top: 6px; }
.bar { height: 12px; background: #eeeae0; border-radius: 999px; overflow: hidden; margin: 14px 0 12px; }
.bar i { display: block; height: 100%; width: 0; min-width: 12px; background: var(--green); border-radius: 999px; transition: width 1.1s cubic-bezier(.2, .7, .2, 1); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.stats div { background: var(--cream); border-radius: 12px; padding: 10px 12px; font-size: 13px; color: var(--muted); line-height: 1.3; }
.stats strong { display: block; font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; }
.secure { display: flex; align-items: flex-start; justify-content: center; gap: 7px; font-size: 13px; color: var(--muted); line-height: 1.4; margin-top: 12px; text-align: left; }
.secure svg { flex: none; margin-top: 2px; color: var(--green); }
.share { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.share p { grid-column: 1 / -1; font-size: 14px; font-weight: 600; text-align: center; }
.asof { font-size: 12px; color: var(--muted); text-align: center; margin-top: 12px; }

/* Formulário de pagador */
.payer-form { display: grid; gap: 10px; margin-bottom: 14px; }
.form-row { display: flex; flex-direction: column; gap: 5px; }
.form-row label { font-size: 13px; font-weight: 600; color: var(--ink); }
.form-row .optional { font-weight: 400; color: var(--muted); }
.form-row input {
  height: 46px; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: 12px;
  font-family: inherit; font-size: 15.5px; color: var(--ink);
  background: #fff; outline: none;
  transition: border-color .15s;
}
.form-row input:focus { border-color: var(--cta); }
.form-row input::placeholder { color: #b0aba0; }

/* Estados do botão e erros */
.btn:disabled { opacity: .65; cursor: not-allowed; transform: none !important; }
.pay-error { background: #fff2f0; border: 1px solid #ffa39e; border-radius: 12px; padding: 12px 14px; font-size: 14px; color: #c0392b; line-height: 1.45; margin-bottom: 12px; }

/* Banner de resultado do pagamento */
.pay-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 100; padding: 18px 20px; text-align: center; font-weight: 600; font-size: 16px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.pay-banner.success { background: var(--green); color: #fff; }
.pay-banner.failed { background: #c0392b; color: #fff; }
.pay-banner button { background: transparent; border: 1.5px solid rgba(255,255,255,.6); color: #fff; border-radius: 8px; padding: 4px 12px; font-size: 13px; cursor: pointer; margin-left: 12px; }

/* Seletor de valores */
.amounts { margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.amounts-label { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 10px; text-align: center; text-transform: uppercase; letter-spacing: .04em; }
.amounts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.amount-btn {
  min-height: 46px; padding: 8px 4px;
  background: var(--cream); color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 12px;
  font-family: inherit; font-weight: 700; font-size: 15.5px;
  cursor: pointer; transition: border-color .15s, background .15s, color .15s;
  position: relative;
}
.amount-btn:hover { border-color: var(--cta); background: #fff5f1; color: var(--cta); }
.amount-btn.active { border-color: var(--cta); background: #fff5f1; color: var(--cta); }
.amount-btn.featured { border-color: var(--cta); }
.amount-btn.featured::after { content: "1%"; position: absolute; top: -8px; right: -6px; background: var(--cta); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 999px; line-height: 1.4; }
.amount-btn.other { grid-column: 1 / -1; font-size: 14px; font-weight: 600; }
.custom-amount-wrap { margin-top: 10px; }
.custom-amount-input { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; padding: 0 14px; transition: border-color .15s; }
.custom-amount-input:focus-within { border-color: var(--cta); }
.custom-amount-input span { font-weight: 700; color: var(--muted); font-size: 17px; margin-right: 6px; flex: none; }
.custom-amount-input input { flex: 1; border: 0; outline: none; font-family: inherit; font-size: 18px; font-weight: 600; padding: 11px 0; background: transparent; color: var(--ink); -moz-appearance: textfield; min-width: 0; }
.custom-amount-input input::-webkit-outer-spin-button,
.custom-amount-input input::-webkit-inner-spin-button { -webkit-appearance: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Conteúdo */
.content > * + * { margin-top: 34px; }
.lead { font-size: 19.5px; line-height: 1.55; }
.facts { display: grid; grid-template-columns: 1fr; gap: 10px; }
.facts div { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; font-size: 14.5px; color: var(--muted); line-height: 1.35; }
.facts strong { display: block; font-family: var(--serif); font-size: 24px; font-weight: 600; color: var(--ink); line-height: 1.15; margin-bottom: 3px; }
h2 { font-family: var(--serif); font-weight: 600; font-size: 26px; line-height: 1.2; letter-spacing: -0.01em; margin-bottom: 12px; text-wrap: balance; }
.prose p + p { margin-top: 14px; }
.highlight { background: var(--cream); border-left: 4px solid var(--cta); border-radius: 0 14px 14px 0; padding: 16px 18px; font-size: 18px; line-height: 1.5; }

.checks { list-style: none; padding: 0; display: grid; gap: 10px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; }
.checks li::before { content: ""; flex: none; width: 22px; height: 22px; margin-top: 3px; border-radius: 50%; background: var(--green-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f7a4d' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 14px no-repeat; }

.steps { list-style: none; padding: 0; display: grid; gap: 12px; counter-reset: s; }
.steps li { counter-increment: s; display: flex; gap: 14px; align-items: flex-start; background: var(--cream); border-radius: 14px; padding: 14px 16px; line-height: 1.45; }
.steps li::before { content: counter(s); flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.steps strong { display: block; }
.steps span { color: var(--muted); font-size: 15px; }

.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-of-type { border-top: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 0; font-weight: 600; min-height: 54px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font-size: 24px; font-weight: 400; color: var(--muted); line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 0 18px; color: var(--muted); font-size: 16px; }

/* Fechamento */
.closing { background: var(--cream); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 48px; padding: 44px 0; text-align: center; }
.closing h2 { font-size: clamp(26px, 6vw, 36px); max-width: 18em; margin: 0 auto 10px; }
.closing p { color: var(--muted); max-width: 32em; margin: 0 auto 22px; }
.closing .btn { width: 100%; max-width: 380px; }

.other { padding: 36px 0 8px; }
.other h2 { font-size: 20px; }
.other a.tile { display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; text-decoration: none; color: var(--ink); transition: background .15s; }
.other a.tile:hover { background: var(--cream); }
.other .tile img { flex: none; width: 84px; height: 84px; border-radius: 12px; object-fit: cover; }
.other .tile strong { display: block; line-height: 1.3; }
.other .tile span { color: var(--muted); font-size: 14.5px; line-height: 1.4; display: block; margin-top: 2px; }

footer { padding: 28px 0 24px; font-size: 13px; line-height: 1.5; color: var(--muted); text-align: center; }

/* Barra fixa no celular */
.sticky-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(27, 36, 32, .1); padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 12px; transform: translateY(110%); transition: transform .25s ease; }
.sticky-cta.show { transform: none; }
.sticky-cta .amount { font-size: 12.5px; color: var(--muted); line-height: 1.25; white-space: nowrap; }
.sticky-cta .amount strong { display: block; font-size: 17px; color: var(--ink); font-variant-numeric: tabular-nums; }
.sticky-cta .btn { flex: 1; min-height: 50px; padding: 12px 14px; }

@media (min-width: 560px) {
  .facts { grid-template-columns: repeat(3, 1fr); }
  .closing .btn { width: auto; }
}

@media (min-width: 960px) {
  body { padding-bottom: 0; font-size: 17.5px; }
  .wrap { padding: 0 28px; }
  .topbar .wrap { height: 68px; }
  .notice { font-size: 13px; }
  .layout { grid-template-columns: minmax(0, 1.5fr) minmax(340px, 1fr); grid-template-areas: "intro donate" "media donate" "content donate"; column-gap: 48px; row-gap: 26px; padding-top: 40px; }
  .donate .card { position: sticky; top: 92px; padding: 28px; }
  .photo { aspect-ratio: 16 / 10; }
  .thumbs button { aspect-ratio: 4 / 3; }
  .content > * + * { margin-top: 44px; }
  .closing { margin-top: 72px; padding: 64px 0; }
  .sticky-cta { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* Exit overlay */
.exit-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center;
  padding: 16px; opacity: 0; transition: opacity .3s;
}
.exit-overlay.show { opacity: 1; }
.exit-box {
  background: #fff; border-radius: 16px; max-width: 380px; width: 100%;
  padding: 32px 24px 24px; text-align: center; position: relative;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.exit-box h2 { font-family: 'Fraunces', serif; font-size: 1.5rem; margin: 0 0 12px; color: var(--ink); }
.exit-box p { font-size: .95rem; line-height: 1.5; color: var(--muted); margin: 0 0 20px; }
.exit-box p strong { color: var(--ink); }
.exit-box .btn { margin-bottom: 12px; }
.exit-close {
  position: absolute; top: 12px; right: 12px; background: none; border: none;
  font-size: 1.2rem; color: var(--muted); cursor: pointer; padding: 4px 8px;
}
.exit-skip {
  background: none; border: none; color: var(--muted); font-size: .85rem;
  cursor: pointer; text-decoration: underline; padding: 4px;
}
