/* =====================================================================
   Estilo do site — mobile-first. As cores --cor e --cor2 vêm do painel.
   ===================================================================== */
:root {
  --cor: #e4572e;
  --cor2: #29335c;
  --cor-suave: color-mix(in srgb, var(--cor) 12%, #fff);
  --fundo: #fffaf5;
  --card: #ffffff;
  --texto: #2b2622;
  --texto2: #6b625b;
  --borda: #ece4dc;
  --ok: #2a9d5c;
  --alerta: #d98e04;
  --erro: #c0392b;
  --raio: 16px;
  --sombra: 0 2px 10px rgba(60, 40, 20, .07);
  --sombra2: 0 10px 30px rgba(60, 40, 20, .12);
  --fonte-titulo: 'Nunito', system-ui, sans-serif;
  --fonte: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --max: 1180px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--fonte); font-size: 16px; line-height: 1.6; color: var(--texto); background: var(--fundo); overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--cor2); }
h1, h2, h3, h4 { font-family: var(--fonte-titulo); line-height: 1.2; margin: 0 0 .5em; color: var(--cor2); }
h1 { font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 900; }
h2 { font-size: clamp(1.4rem, 3.5vw, 2rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 800; }
p { margin: 0 0 1em; }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.secao { padding: 40px 0; }
.secao-titulo { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.secao-titulo h2 { margin: 0; }
.muted { color: var(--texto2); }
.pequeno { font-size: .875rem; }
.centro { text-align: center; }
.oculto { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- cabeçalho ---------- */
.topo { position: sticky; top: 0; z-index: 50; background: rgba(255, 250, 245, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--borda); }
.topo .container { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 12px; }
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--cor2); font-family: var(--fonte-titulo); font-weight: 900; font-size: 1.05rem; min-width: 0; }
.marca img { width: 42px; height: 42px; object-fit: contain; border-radius: 10px; }
.marca span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-btn { display: inline-flex; background: none; border: 0; padding: 8px; cursor: pointer; color: var(--cor2); }
.menu-btn svg { width: 28px; height: 28px; }
.nav { position: fixed; inset: 64px 0 0 0; background: var(--fundo); padding: 16px; display: none; flex-direction: column; gap: 4px; overflow-y: auto; }
.nav.aberto { display: flex; }
.nav a { padding: 12px 14px; border-radius: 12px; text-decoration: none; color: var(--texto); font-weight: 600; }
.nav a.ativo, .nav a:hover { background: var(--cor-suave); color: var(--cor); }
.nav a.btn { color: #fff; margin-top: 8px; }
@media (min-width: 980px) {
  .menu-btn { display: none; }
  .nav { position: static; display: flex; flex-direction: row; background: none; padding: 0; overflow: visible; align-items: center; }
  .nav a { padding: 8px 12px; font-size: .95rem; }
  .nav a.btn { margin: 0 0 0 6px; }
}

/* ---------- botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 999px; border: 2px solid var(--cor); background: var(--cor); color: #fff; font-weight: 700; font-size: 1rem; text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s; min-height: 46px; font-family: inherit; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--sombra2); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-sec { background: transparent; color: var(--cor); }
.btn-escuro { background: var(--cor2); border-color: var(--cor2); }
.btn-branco { background: #fff; border-color: #fff; color: var(--cor2); }
.btn-wpp { background: #25d366; border-color: #25d366; }
.btn-peq { padding: 6px 14px; min-height: 36px; font-size: .9rem; }
.btn-bloco { width: 100%; }
.botoes { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- hero ---------- */
.hero { position: relative; color: #fff; background: var(--cor2); overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; background: var(--hero-img, none) center/cover no-repeat; opacity: .35; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(120deg, var(--cor2) 10%, transparent 90%); }
.hero .container { position: relative; z-index: 1; padding-top: 56px; padding-bottom: 64px; }
.hero h1 { color: #fff; max-width: 14ch; }
.hero p { font-size: 1.15rem; max-width: 46ch; opacity: .95; }

/* ---------- números ---------- */
.numeros { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: -36px; position: relative; z-index: 2; }
.numero { background: var(--card); border-radius: var(--raio); padding: 16px; box-shadow: var(--sombra2); text-align: center; }
.numero b { display: block; font-family: var(--fonte-titulo); font-size: clamp(1.5rem, 5vw, 2.2rem); font-weight: 900; color: var(--cor); line-height: 1.1; }
.numero span { font-size: .85rem; color: var(--texto2); }
@media (min-width: 720px) { .numeros { grid-template-columns: repeat(4, 1fr); } }

/* ---------- grades e cards ---------- */
.grade { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.grade-2 { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .grade-2 { grid-template-columns: 1fr 1fr; } }
.card { background: var(--card); border-radius: var(--raio); box-shadow: var(--sombra); overflow: hidden; border: 1px solid var(--borda); }
.card-corpo { padding: 16px; }
.card-animal { text-decoration: none; color: inherit; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.card-animal:hover { transform: translateY(-3px); box-shadow: var(--sombra2); }
.card-animal .foto { position: relative; aspect-ratio: 1; background: var(--cor-suave); }
.card-animal .foto img { width: 100%; height: 100%; object-fit: cover; }
.card-animal .foto .selo { position: absolute; top: 10px; left: 10px; }
.card-animal h3 { margin: 0 0 4px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: .78rem; padding: 3px 10px; border-radius: 999px; background: var(--cor-suave); color: var(--cor2); font-weight: 600; }
.selo { font-size: .75rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; color: #fff; background: var(--cor); text-transform: uppercase; letter-spacing: .03em; }
.selo.disponivel { background: var(--ok); }
.selo.adotado { background: var(--cor2); }
.selo.tratamento, .selo.lar_temporario { background: var(--alerta); }
.selo.reservado { background: #7a5af8; }
.sem-foto { width: 100%; height: 100%; display: grid; place-items: center; font-size: 3rem; color: var(--cor); opacity: .5; }

/* ---------- progresso ---------- */
.progresso { height: 12px; background: var(--borda); border-radius: 999px; overflow: hidden; }
.progresso > div { height: 100%; background: linear-gradient(90deg, var(--cor), color-mix(in srgb, var(--cor) 70%, #ffd166)); border-radius: 999px; transition: width 1s ease; }
.progresso-info { display: flex; justify-content: space-between; font-size: .9rem; margin-top: 6px; gap: 8px; flex-wrap: wrap; }

/* ---------- filtros ---------- */
.filtros { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.filtros input { grid-column: 1 / -1; }
@media (min-width: 860px) { .filtros { grid-template-columns: 2fr repeat(4, 1fr); } .filtros input { grid-column: auto; } }

/* ---------- formulários ---------- */
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 4px; }
input, select, textarea { width: 100%; padding: 12px 14px; border: 1.5px solid var(--borda); border-radius: 12px; font: inherit; background: #fff; color: var(--texto); min-height: 46px; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--cor); box-shadow: 0 0 0 3px var(--cor-suave); }
textarea { min-height: 110px; resize: vertical; }
.campo { margin-bottom: 14px; }
.campos-2 { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .campos-2 { grid-template-columns: 1fr 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: 20px; height: 20px; min-height: 0; margin-top: 3px; flex: none; accent-color: var(--cor); }
.hp { position: absolute; left: -9999px; }

/* ---------- página do animal ---------- */
.animal-topo { display: grid; gap: 24px; grid-template-columns: 1fr; padding-top: 24px; }
@media (min-width: 900px) { .animal-topo { grid-template-columns: 1.1fr 1fr; align-items: start; } }
.galeria-principal { aspect-ratio: 1; border-radius: var(--raio); overflow: hidden; background: var(--cor-suave); }
.galeria-principal img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.miniaturas { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0; scroll-snap-type: x mandatory; }
.miniaturas button { flex: none; width: 72px; height: 72px; border-radius: 12px; overflow: hidden; border: 3px solid transparent; padding: 0; cursor: pointer; scroll-snap-align: start; background: none; }
.miniaturas button.ativa { border-color: var(--cor); }
.miniaturas img { width: 100%; height: 100%; object-fit: cover; }
.ficha { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.ficha div { background: var(--card); border: 1px solid var(--borda); border-radius: 12px; padding: 10px 12px; }
.ficha small { display: block; color: var(--texto2); font-size: .78rem; }
.ficha b { font-weight: 700; }
.historia { white-space: pre-line; }

/* linha do tempo */
.timeline { position: relative; margin: 0; padding: 0 0 0 28px; list-style: none; }
.timeline::before { content: ''; position: absolute; left: 10px; top: 6px; bottom: 6px; width: 3px; background: var(--borda); border-radius: 3px; }
.timeline li { position: relative; padding: 0 0 22px; }
.timeline li::before { content: attr(data-icone); position: absolute; left: -30px; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--card); border: 2px solid var(--cor); display: grid; place-items: center; font-size: .8rem; }
.timeline .quando { font-size: .8rem; color: var(--texto2); font-weight: 600; }
.timeline h4 { margin: 2px 0 4px; font-size: 1rem; }
.timeline img { margin-top: 8px; border-radius: 12px; max-height: 240px; width: auto; cursor: zoom-in; }

/* antes e depois */
.antes-depois { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.antes-depois figure { margin: 0; position: relative; aspect-ratio: 1; }
.antes-depois img { width: 100%; height: 100%; object-fit: cover; }
.antes-depois figcaption { position: absolute; bottom: 6px; left: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: .72rem; padding: 2px 8px; border-radius: 999px; font-weight: 700; }

/* ---------- Pix ---------- */
.pix { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 640px) { .pix { grid-template-columns: auto 1fr; } }
.pix-qr { background: #fff; padding: 12px; border-radius: 12px; border: 1px solid var(--borda); width: max-content; margin: 0 auto; }
.pix-qr img, .pix-qr canvas { width: 200px !important; height: 200px !important; }
.copia-cola { display: flex; gap: 8px; }
.copia-cola input { font-family: ui-monospace, monospace; font-size: .8rem; }
.valores { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.valores button { flex: 1 1 70px; }

/* ---------- tabelas ---------- */
.tabela-wrap { overflow-x: auto; border-radius: var(--raio); border: 1px solid var(--borda); background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--borda); white-space: nowrap; }
td.quebra { white-space: normal; min-width: 200px; }
th { background: var(--cor-suave); color: var(--cor2); font-weight: 700; position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- parceiros ---------- */
.parceiros-faixa { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.parceiro-logo { background: #fff; border: 1px solid var(--borda); border-radius: 14px; aspect-ratio: 3 / 2; display: grid; place-items: center; padding: 14px; text-decoration: none; color: var(--cor2); font-weight: 700; text-align: center; font-size: .85rem; }
.parceiro-logo img { max-height: 100%; max-width: 100%; object-fit: contain; filter: grayscale(.2); transition: filter .2s; }
.parceiro-logo:hover img { filter: none; }
.card-parceiro .logo { aspect-ratio: 16 / 9; background: #fff; display: grid; place-items: center; padding: 20px; border-bottom: 1px solid var(--borda); }
.card-parceiro .logo img { max-height: 100%; object-fit: contain; }
.beneficio { background: color-mix(in srgb, var(--ok) 12%, #fff); color: #1e6b41; border-radius: 10px; padding: 8px 12px; font-weight: 600; font-size: .9rem; margin-top: 10px; }

/* ---------- desejos ---------- */
.desejo { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--borda); }
.desejo:last-child { border-bottom: 0; }
.desejo .progresso { grid-column: 1 / -1; height: 8px; }
.prio-alta { color: var(--erro); font-weight: 700; font-size: .78rem; }

/* ---------- caixas ---------- */
.caixa { background: var(--card); border-radius: var(--raio); padding: 20px; border: 1px solid var(--borda); box-shadow: var(--sombra); }
.caixa-cor { background: var(--cor-suave); border-color: transparent; box-shadow: none; }
.destaque-faixa { background: var(--cor); color: #fff; border-radius: var(--raio); padding: 28px 20px; display: grid; gap: 16px; align-items: center; }
.destaque-faixa h2, .destaque-faixa h3 { color: #fff; }
@media (min-width: 760px) { .destaque-faixa { grid-template-columns: 1fr auto; padding: 32px; } }
.evento { display: flex; gap: 14px; align-items: flex-start; }
.evento .dia { flex: none; width: 60px; text-align: center; background: var(--cor); color: #fff; border-radius: 12px; padding: 6px 0; font-family: var(--fonte-titulo); font-weight: 900; line-height: 1.1; }
.evento .dia b { display: block; font-size: 1.5rem; }
.evento .dia small { font-size: .72rem; text-transform: uppercase; }

/* ---------- abas ---------- */
.abas { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 16px; padding-bottom: 4px; }
.abas button { flex: none; border: 1.5px solid var(--borda); background: var(--card); padding: 8px 16px; border-radius: 999px; font: inherit; font-weight: 600; cursor: pointer; color: var(--texto); }
.abas button.ativa { background: var(--cor2); border-color: var(--cor2); color: #fff; }

/* ---------- modal / lightbox / toast ---------- */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(20, 15, 10, .55); display: none; align-items: flex-end; justify-content: center; }
.modal.aberto { display: flex; }
.modal-caixa { background: var(--fundo); width: 100%; max-height: 92vh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); animation: sobe .25s ease; }
@media (min-width: 700px) { .modal { align-items: center; } .modal-caixa { max-width: 640px; border-radius: 22px; padding: 28px; } }
@keyframes sobe { from { transform: translateY(40px); opacity: 0; } }
.modal-topo { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-topo h3 { margin: 0; }
.fechar { background: none; border: 0; font-size: 1.8rem; line-height: 1; cursor: pointer; color: var(--texto2); padding: 4px 8px; }
.lightbox { position: fixed; inset: 0; z-index: 120; background: rgba(0,0,0,.92); display: none; align-items: center; justify-content: center; padding: 16px; }
.lightbox.aberto { display: flex; }
.lightbox img { max-height: 90vh; max-width: 100%; border-radius: 8px; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--cor2); color: #fff; padding: 12px 20px; border-radius: 999px; z-index: 200; box-shadow: var(--sombra2); font-weight: 600; max-width: calc(100% - 32px); text-align: center; }
.toast.erro { background: var(--erro); }

/* ---------- banner instalar app / offline ---------- */
.instalar { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 90; background: var(--card); border-radius: var(--raio); box-shadow: var(--sombra2); padding: 14px; display: flex; gap: 12px; align-items: center; border: 1px solid var(--borda); }
.instalar img { width: 44px; height: 44px; border-radius: 10px; }
.instalar div { flex: 1; font-size: .9rem; line-height: 1.3; }
@media (min-width: 700px) { .instalar { left: auto; width: 380px; } }
.offline-aviso { background: var(--alerta); color: #fff; text-align: center; font-size: .85rem; padding: 6px; font-weight: 600; }

/* ---------- rodapé ---------- */
.rodape { background: var(--cor2); color: rgba(255,255,255,.85); padding: 40px 0 calc(24px + env(safe-area-inset-bottom)); margin-top: 40px; }
.rodape a { color: #fff; }
.rodape h3 { color: #fff; }
.rodape-grade { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .rodape-grade { grid-template-columns: 2fr 1fr 1fr; } }
.rodape ul { list-style: none; padding: 0; margin: 0; }
.rodape li { margin-bottom: 6px; }
.rodape-fim { border-top: 1px solid rgba(255,255,255,.15); margin-top: 24px; padding-top: 16px; font-size: .82rem; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.redes { display: flex; gap: 10px; margin-top: 10px; }
.redes a { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.12); display: grid; place-items: center; }
.redes svg { width: 20px; height: 20px; fill: #fff; }

/* botão flutuante WhatsApp */
.wpp-flutuante { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 80; width: 56px; height: 56px; border-radius: 50%; background: #25d366; display: grid; place-items: center; box-shadow: var(--sombra2); }
.wpp-flutuante svg { width: 30px; height: 30px; fill: #fff; }

/* esqueleto de carregamento */
.carregando { background: linear-gradient(90deg, var(--borda) 25%, #f7f1ea 50%, var(--borda) 75%); background-size: 200% 100%; animation: brilho 1.2s infinite; border-radius: var(--raio); min-height: 260px; }
@keyframes brilho { to { background-position: -200% 0; } }
.vazio { text-align: center; padding: 40px 16px; color: var(--texto2); }
.vazio b { display: block; font-size: 2.4rem; }

/* gráficos */
.grafico { position: relative; height: 280px; }

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

/* impressão (relatórios e prestação de contas) */
@media print {
  .topo, .rodape, .nao-imprimir, .wpp-flutuante, .instalar, .botoes { display: none !important; }
  body { background: #fff; }
  .caixa, .card { box-shadow: none; break-inside: avoid; }
  th { position: static; }
}

/* ajustes: filhos de grid não estouram a largura (tabelas roláveis) */
.grade-2 > *, .animal-topo > *, .rodape-grade > *, .pix > * { min-width: 0; }
.btn-sec.btn-escuro { color: #fff; }
/* celular: animais em 2 colunas */
@media (max-width: 599px) {
  .grade.grade-animais { grid-template-columns: 1fr 1fr; gap: 10px; }
  .grade-animais .card-corpo { padding: 10px; }
  .grade-animais h3 { font-size: 1rem; }
  .grade-animais .tag { font-size: .7rem; padding: 2px 7px; }
  .grade-animais .selo { font-size: .62rem; padding: 3px 7px; top: 6px; left: 6px; }
}
.qr-falhou { width: 200px; padding: 20px; text-align: center; font-size: .85rem; color: var(--texto2); }
