/* Fundação — Doações Pix. Segue o tema: Fredoka (títulos), Nunito (texto), Patrick Hand (detalhes), verde/oliva/creme/coral. */
.fd-doacao {
	--fd-text: #3D3D3D;
	--fd-muted: #6b6b63;
	--fd-green: #2f3d26;
	--fd-green-2: #3f5232;
	--fd-olive: #7D8C3A;
	--fd-olive-soft: #eef1e0;
	--fd-sand: #E8D5A3;
	--fd-line: #ece3cc;
	--fd-cream: #FFFBF2;
	--fd-coral: #E07B54;
	--fd-coral-2: #cf6a43;
	--fd-yellow: #F2C94C;
	--fd-error: #b3261e;
	--fd-radius: 14px;
	color: var(--fd-text);
	font-family: Nunito, system-ui, sans-serif;
	text-align: left;
}
.fd-doacao *, .fd-doacao *::before, .fd-doacao *::after { box-sizing: border-box; }
.fd-doacao [hidden] { display: none !important; }
.fd-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fd-ico { width: 1.15em; height: 1.15em; flex: none; }

/* Painel */
.fd-panel { max-width: 520px; margin: 0 auto; background: #fff; border-radius: 26px; overflow: hidden; }
.fd-doacao:not(.fd-doacao--modal) .fd-panel { border: 2px solid var(--fd-sand); box-shadow: 0 18px 40px rgba(47, 61, 38, .12); }

/* Cabeçalho */
.fd-head {
	position: relative; display: flex; align-items: center; gap: .9rem;
	padding: 1.25rem 3.5rem 1.25rem 1.5rem; color: #fff;
	background: radial-gradient(120% 140% at 0% 0%, var(--fd-green-2) 0%, var(--fd-green) 60%);
}
.fd-head::after {
	content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 14px;
	background: #fff; border-radius: 14px 14px 0 0;
}
.fd-head-badge {
	display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 50%;
	background: var(--fd-coral); color: #fff; box-shadow: 0 0 0 5px rgba(255, 255, 255, .12);
}
.fd-head-badge .fd-ico { width: 22px; height: 22px; fill: currentColor; }
.fd-head-eyebrow { margin: 0; font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--fd-yellow); }
.fd-head-title { margin: .1rem 0 0; font-family: Fredoka, Nunito, sans-serif; font-weight: 600; font-size: 1.45rem; line-height: 1.15; color: #fff; }
.fd-close {
	position: absolute; top: 50%; right: 1rem; transform: translateY(-60%);
	display: grid; place-items: center; width: 38px; height: 38px; padding: 0;
	border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer;
}
.fd-close:hover, .fd-close:focus-visible { background: rgba(255, 255, 255, .25); }

.fd-body { padding: .6rem 1.5rem 1.5rem; }

/* Grupos */
.fd-group { border: 0; margin: 0 0 1.1rem; padding: 0; min-width: 0; }
.fd-group-title {
	display: block; width: 100%; padding: 0; margin: 0 0 .65rem;
	font-family: Fredoka, Nunito, sans-serif; font-weight: 600; font-size: 1.05rem; color: var(--fd-green);
}

/* Valores */
.fd-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-bottom: .6rem; }
.fd-presets button {
	font: inherit; font-weight: 800; font-size: 1rem; cursor: pointer; color: var(--fd-green);
	background: var(--fd-cream); border: 2px solid var(--fd-line); border-radius: 12px; padding: .7rem .25rem; min-height: 48px;
	transition: background .15s, border-color .15s, color .15s, transform .15s;
}
.fd-presets button:hover { border-color: var(--fd-olive); }
.fd-presets button.is-active { background: var(--fd-olive); border-color: var(--fd-olive); color: #fff; transform: translateY(-1px); box-shadow: 0 6px 14px rgba(125, 140, 58, .3); }
.fd-money { position: relative; }
.fd-money-prefix { position: absolute; left: .95rem; top: 50%; transform: translateY(-50%); font-weight: 800; color: var(--fd-muted); pointer-events: none; }
.fd-doacao .fd-money input[type=text] { padding-left: 2.7rem; font-weight: 700; }
.fd-hint { font-size: .85rem; min-height: 0; }
.fd-hint:empty { display: none; }
.fd-hint.is-warn { color: var(--fd-error); }
.fd-hint.is-info { color: #8a5a00; }
.fd-hint.is-ok { color: var(--fd-olive); font-weight: 800; }
.fd-rules {
	display: flex; gap: .6rem; align-items: flex-start; margin: .2rem 0 0; padding: .7rem .85rem;
	font-size: .86rem; line-height: 1.45; background: var(--fd-olive-soft); border-radius: 12px; color: #4a5326;
}
.fd-rules .fd-ico { color: var(--fd-olive); margin-top: .05rem; }

/* Campos */
.fd-field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .8rem; }
.fd-field label { font-weight: 700; font-size: .88rem; color: var(--fd-text); text-align: left; }
.fd-field label small { font-weight: 400; color: var(--fd-muted); margin-left: .25rem; }
.fd-doacao input[type=text], .fd-doacao input[type=email], .fd-doacao select, .fd-copy-code {
	width: 100%; font: inherit; font-size: 1rem; color: var(--fd-text); background: #fff;
	border: 2px solid var(--fd-line); border-radius: 12px; padding: .7rem .9rem; min-height: 48px; margin: 0;
	transition: border-color .15s, box-shadow .15s;
}
.fd-doacao select { appearance: none; -webkit-appearance: none; padding-right: 2rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%233D3D3D' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .8rem center; }
.fd-doacao input::placeholder { color: #a5a298; font-weight: 400; }
.fd-doacao input:focus, .fd-doacao select:focus, .fd-copy-code:focus { outline: none; border-color: var(--fd-olive); box-shadow: 0 0 0 4px rgba(125, 140, 58, .18); }
/* Preenchimento automático do navegador sem o fundo azul. */
.fd-doacao input:-webkit-autofill, .fd-doacao input:-webkit-autofill:hover, .fd-doacao input:-webkit-autofill:focus {
	-webkit-text-fill-color: var(--fd-text); -webkit-box-shadow: 0 0 0 40px var(--fd-cream) inset; caret-color: var(--fd-text);
}
.fd-doacao [aria-invalid=true] { border-color: var(--fd-error); }
.fd-row { display: flex; gap: .7rem; }
.fd-field--grow { flex: 1; min-width: 0; }
.fd-field--uf { width: 92px; flex: none; }

/* Consentimento */
.fd-consent { margin: .2rem 0 1rem; }
.fd-consent label {
	display: flex; gap: .7rem; align-items: flex-start; font-weight: 400; font-size: .8rem; line-height: 1.5;
	color: var(--fd-muted); cursor: pointer; padding: .75rem .85rem; border: 1px dashed var(--fd-line); border-radius: 12px;
}
.fd-consent input { margin: .1rem 0 0; width: 18px; height: 18px; flex: none; accent-color: var(--fd-olive); }

.fd-err { color: var(--fd-error); font-size: .8rem; font-weight: 700; }
.fd-err:empty { display: none; }
.fd-err--form { margin: 0 0 .75rem; }
.fd-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* Botões */
.fd-submit, .fd-restart, .fd-btn, .fd-open {
	display: inline-flex; align-items: center; justify-content: center; gap: .55rem; width: 100%;
	font-family: Fredoka, Nunito, sans-serif; font-weight: 600; font-size: 1.1rem; letter-spacing: .01em; text-decoration: none; cursor: pointer;
	color: #fff; background: var(--fd-coral); border: 0; border-radius: 999px; padding: .9rem 1.5rem; min-height: 54px;
	box-shadow: 0 10px 22px rgba(224, 123, 84, .32); transition: transform .15s, background .15s, box-shadow .15s;
}
.fd-submit:hover, .fd-restart:hover, .fd-btn:hover, .fd-open:hover { background: var(--fd-coral-2); transform: translateY(-1px); color: #fff; box-shadow: 0 12px 26px rgba(224, 123, 84, .38); }
.fd-submit:focus-visible, .fd-btn:focus-visible, .fd-open:focus-visible, .fd-restart:focus-visible { outline: 3px solid var(--fd-yellow); outline-offset: 3px; }
.fd-submit:disabled { opacity: .65; cursor: wait; transform: none; }
.fd-secure { display: flex; align-items: center; justify-content: center; gap: .4rem; margin: .7rem 0 0; font-size: .78rem; color: var(--fd-muted); }
.fd-secure .fd-ico { width: 14px; height: 14px; }
.fd-open { width: auto; max-width: 100%; margin: 1.5rem auto 0; padding: .95rem 2rem; }
.fd-open .fd-ico { fill: currentColor; }
.fd-doacao--modal { text-align: center; }
.fd-doacao .fd-panel { text-align: left; }

/* Mensagens de teste */
.fd-test-banner {
	display: flex; gap: .55rem; align-items: flex-start; font-size: .84rem; line-height: 1.4; color: var(--fd-error);
	background: #fdeceb; border: 1px dashed var(--fd-error); border-radius: 12px; padding: .65rem .85rem; margin: .4rem 0 1rem; text-align: left;
}

/* Etapa: pagamento */
.fd-doacao .fd-step--pay, .fd-doacao .fd-step--done, .fd-doacao .fd-step--closed { text-align: center; }
.fd-amount { margin: .5rem 0 .9rem; font-family: Fredoka, Nunito, sans-serif; font-weight: 600; font-size: 1.6rem; color: var(--fd-green); }
.fd-howto { list-style: none; counter-reset: fd; margin: 0 0 1rem; padding: 0; text-align: left; font-size: .88rem; }
.fd-howto li { counter-increment: fd; position: relative; padding-left: 2rem; margin-bottom: .45rem; line-height: 1.45; }
.fd-howto li::before {
	content: counter(fd); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
	background: var(--fd-olive-soft); color: var(--fd-olive); font-weight: 800; font-size: .75rem;
}
.fd-qr { display: block; width: 100%; max-width: 240px; height: auto; margin: 0 auto 1rem; padding: 10px; background: #fff; border: 2px solid var(--fd-line); border-radius: 18px; box-shadow: 0 8px 20px rgba(47, 61, 38, .08); }
.fd-copy-box { display: flex; gap: .5rem; align-items: stretch; }
.fd-copy-code { flex: 1; min-height: 52px; font-family: ui-monospace, Menlo, monospace; font-size: .75rem; line-height: 1.35; resize: none; word-break: break-all; background: var(--fd-cream); }
.fd-copy {
	display: inline-flex; align-items: center; gap: .4rem; flex: none; padding: 0 1rem; border: 0; border-radius: 12px; cursor: pointer;
	font: inherit; font-weight: 800; font-size: .9rem; color: #fff; background: var(--fd-olive); transition: background .15s;
}
.fd-copy:hover { background: #6b7930; }
.fd-copy.is-done { background: var(--fd-green); }
.fd-expiry { display: flex; align-items: center; justify-content: center; gap: .4rem; font-size: .86rem; color: var(--fd-muted); margin: 1rem 0 .4rem; }
.fd-status { display: inline-flex; align-items: center; gap: .5rem; font-weight: 800; margin: 0; padding: .45rem 1rem; border-radius: 999px; background: #fff4ee; color: var(--fd-coral-2); }
.fd-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--fd-coral); animation: fd-pulse 1.2s infinite ease-in-out; }
@keyframes fd-pulse { 50% { opacity: .25; transform: scale(.8); } }

/* Etapas: concluída / encerrada */
.fd-done-icon { display: grid; place-items: center; width: 68px; height: 68px; margin: .8rem auto .9rem; border-radius: 50%; background: var(--fd-olive); color: #fff; box-shadow: 0 0 0 8px var(--fd-olive-soft); }
.fd-done-icon .fd-ico { width: 34px; height: 34px; stroke-width: 3; }
.fd-done-icon--warn { background: var(--fd-coral); box-shadow: 0 0 0 8px #fdeee8; }
.fd-done-msg, .fd-closed-msg { line-height: 1.6; margin: 0 0 1rem; }
.fd-downloads { margin-top: .5rem; }
.fd-alt { margin: .75rem 0 0; font-size: .86rem; color: var(--fd-muted); }
.fd-link { color: var(--fd-green); font-weight: 800; }
.fd-note { font-size: .8rem; color: var(--fd-muted); margin: .5rem 0 0; }
.fd-sign { font-family: 'Patrick Hand', cursive; font-size: 1.25rem; color: var(--fd-olive); margin: 1.2rem 0 0; }

/* Modal */
html.fd-lock { overflow: hidden; }
.fd-dialog {
	width: min(540px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: hidden;
	padding: 0; border: 0; border-radius: 26px; background: #fff; color: var(--fd-text);
	box-shadow: 0 30px 80px rgba(20, 28, 15, .45);
}
/* Cabeçalho fixo; só o conteúdo rola, com barra fina dentro do cartão. */
.fd-dialog .fd-panel { display: flex; flex-direction: column; max-width: none; max-height: calc(100dvh - 32px); border-radius: 0; }
.fd-dialog .fd-head { flex: none; }
.fd-dialog .fd-body {
	flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
	scrollbar-width: thin; scrollbar-color: rgba(125, 140, 58, .45) transparent; scrollbar-gutter: stable;
	padding-right: calc(1.5rem - 6px);
}
.fd-dialog .fd-body::-webkit-scrollbar { width: 6px; }
.fd-dialog .fd-body::-webkit-scrollbar-track { background: transparent; margin: 12px 0 18px; }
.fd-dialog .fd-body::-webkit-scrollbar-thumb { background: rgba(125, 140, 58, .4); border-radius: 99px; }
.fd-dialog .fd-body::-webkit-scrollbar-thumb:hover { background: rgba(125, 140, 58, .7); }
/* Rodapé com o botão de envio sempre visível. */
.fd-dialog .fd-body { padding-bottom: 0; }
.fd-dialog .fd-step:not(.fd-step--form) { padding-bottom: 1.5rem; }
.fd-dialog .fd-actions {
	position: sticky; bottom: 0; z-index: 2; background: #fff;
	margin: 0 calc(-1.5rem + 6px) 0 -1.5rem; padding: .9rem 1.5rem 1.1rem;
	box-shadow: 0 -10px 18px -12px rgba(47, 61, 38, .25);
}
@media (max-height: 820px) and (min-width: 481px) {
	.fd-dialog .fd-head { padding-top: 1rem; padding-bottom: 1rem; }
	.fd-dialog .fd-group { margin-bottom: .8rem; }
	.fd-dialog .fd-field { margin-bottom: .6rem; }
	.fd-dialog .fd-doacao input[type=text], .fd-dialog input[type=email], .fd-dialog select { min-height: 44px; padding-top: .55rem; padding-bottom: .55rem; }
	.fd-dialog .fd-presets button { min-height: 44px; padding: .55rem .25rem; }
	.fd-dialog .fd-consent label { padding: .55rem .75rem; }
}
.fd-dialog[open] { animation: fd-in .22s ease-out; }
.fd-dialog::backdrop { background: rgba(28, 38, 22, .62); backdrop-filter: blur(3px); }
.fd-dialog[open]:not(:modal) { position: fixed; inset: 16px; margin: auto; z-index: 99999; }
@keyframes fd-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@media (prefers-reduced-motion: reduce) {
	.fd-dialog[open], .fd-dot { animation: none; }
}

@media (max-width: 480px) {
	.fd-dialog { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; }
	.fd-dialog .fd-panel { height: 100dvh; max-height: 100dvh; }
	.fd-dialog .fd-body { padding-right: calc(1rem - 6px); }
	.fd-dialog .fd-actions { margin: 0 calc(-1rem + 6px) 0 -1rem; padding: .8rem 1rem calc(.9rem + env(safe-area-inset-bottom)); }
	.fd-head { padding: 1rem 3.25rem 1rem 1rem; }
	.fd-head-title { font-size: 1.25rem; }
	.fd-head-eyebrow { font-size: .62rem; letter-spacing: .06em; }
	.fd-head-badge { width: 40px; height: 40px; }
	.fd-body { padding: .5rem 1rem 1.25rem; }
	.fd-presets { grid-template-columns: repeat(2, 1fr); }
	.fd-copy-box { flex-direction: column; }
	.fd-copy { justify-content: center; min-height: 46px; }
}
