/* AdotaPet — CSS próprio, leve (sem framework) */
:root {
  --brand: #ea580c;
  --brand-soft: color-mix(in srgb, var(--brand) 12%, transparent);
  --bg: #fafaf9; --surface: #fff; --surface-2: #f5f5f4;
  --text: #1c1917; --muted: #57534e; --faint: #a8a29e;
  --line: #e7e5e4; --ok: #059669; --gold: #b7791f; --silver: #64748b; --bronze: #a0522d;
  --radius: 18px; --shadow: 0 1px 2px rgb(0 0 0 / .05), 0 8px 24px -12px rgb(0 0 0 / .15);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12100e; --surface: #1c1917; --surface-2: #292524; --text: #f5f5f4; --muted: #c4bdb7;
    --faint: #78716c; --line: #3a3532; --shadow: 0 1px 2px rgb(0 0 0 / .4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12100e; --surface: #1c1917; --surface-2: #292524; --text: #f5f5f4; --muted: #c4bdb7;
  --faint: #78716c; --line: #3a3532; --shadow: 0 1px 2px rgb(0 0 0 / .4); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0; letter-spacing: -.02em; }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .hidden { display: none !important; }
.ico { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 12px; border: 1px solid transparent; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; transition: transform .1s, background .2s, border-color .2s; white-space: nowrap; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { filter: brightness(.93); }
.btn-ghost { background: var(--surface); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-wa { background: #16a34a; color: #fff; } .btn-wa:hover { background: #15803d; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; pointer-events: none; }

/* Header */
.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { height: 64px; display: flex; align-items: center; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 20px; margin-right: auto; min-width: 0; }
.logo-mark { width: 38px; height: 38px; border-radius: 12px; background: var(--brand); color: #fff; display: grid; place-items: center; flex-shrink: 0; overflow: hidden; }
.logo-mark img { width: 100%; height: 100%; object-fit: cover; }
.logo span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 8px 12px; border-radius: 10px; text-decoration: none; font-weight: 500; font-size: 14px; color: var(--muted); }
.nav a:hover { background: var(--surface-2); color: var(--text); }
@media (max-width: 860px) { .nav { display: none; } }

/* Barra de navegação inferior (mobile) */
.tabbar { display: none; }
@media (max-width: 860px) {
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; text-decoration: none; color: var(--muted); padding: 4px; }
  .tabbar .ico { width: 22px; height: 22px; }
  body { padding-bottom: 68px; }
  .top .btn-primary span { display: none; }
}

/* Anúncio (banner do dono da plataforma) */
.ad { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: var(--radius); background: var(--surface); border: 1px dashed var(--line); text-decoration: none; position: relative; overflow: hidden; }
.ad img { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; }
.ad.has-wide img { width: 100%; height: auto; max-height: 140px; border-radius: 12px; }
.ad strong { display: block; }
.ad .tag { position: absolute; top: 6px; right: 10px; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.ad-top { margin: 12px auto 0; }
.ad-card { flex-direction: column; justify-content: center; text-align: center; min-height: 220px; background: var(--brand-soft); border-style: solid; border-color: transparent; }
.ad-card img { width: 100%; height: auto; aspect-ratio: 4/3; }

/* Hero */
.hero { padding: 40px 0 24px; background: linear-gradient(180deg, var(--brand-soft), transparent); }
.hero h1 { font-size: clamp(28px, 5vw, 46px); font-weight: 800; max-width: 760px; }
.hero p { font-size: 17px; color: var(--muted); max-width: 640px; margin: 12px 0 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 12px; margin-bottom: 14px; }
.stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 16px; }
.stat b { font-size: 22px; display: block; line-height: 1.1; }
.stat span { font-size: 12px; color: var(--muted); }

/* Faixa de patrocinadores */
.sponsor-strip { display: flex; align-items: center; gap: 16px; margin-top: 22px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.sponsor-strip > .strip-label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); font-weight: 700; flex-shrink: 0; }
.sponsor-chip { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; font-weight: 600; font-size: 13px; flex-shrink: 0; }

/* Avatar / logo genérico */
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: 13px; flex-shrink: 0; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; border-radius: 16px; }

/* Filtros */
.filters { margin-top: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; display: flex; flex-wrap: wrap; gap: 8px; box-shadow: var(--shadow); }
.chips { min-width: 0; max-width: 100%; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chip { padding: 8px 14px; border-radius: 10px; border: 0; background: var(--surface-2); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.filters .grow { flex: 1 1 220px; }
.field, .filters select, .filters input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); font-size: 14px; }
.field:focus, .filters select:focus, .filters input:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.filters select { width: auto; flex: 0 1 170px; }

/* Seções */
section.block { padding: 40px 0; }
.sec-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.sec-head h2 { font-size: clamp(22px, 3.4vw, 30px); font-weight: 800; }
.sec-head p { margin: 4px 0 0; color: var(--muted); }

/* Grid de pets */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card .ph { position: relative; display: block; aspect-ratio: 4/3; background: var(--surface-2); cursor: pointer; border: 0; padding: 0; width: 100%; overflow: hidden; }
.card .ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card.adopted .ph img { filter: grayscale(1); opacity: .75; }
.badge { position: absolute; top: 10px; left: 10px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--ok); color: #fff; }
.badge.dark { background: #1c1917; } .badge.star { left: auto; right: 10px; background: #f59e0b; }
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { font-size: 19px; font-weight: 800; }
.meta { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag-s { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.card .btn { margin-top: auto; }
.empty { text-align: center; padding: 40px 0; color: var(--muted); }

/* Campanhas */
.camp { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.camp h3 { font-size: 17px; }
.bar { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin: 12px 0 6px; }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.camp .nums { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }

/* Apoiadores */
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 18px; }
.sup-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.sup { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; gap: 14px; align-items: flex-start; }
.sup h4 { font-size: 16px; }
.sup .lvl { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.sup.ouro { border-color: color-mix(in srgb, var(--gold) 50%, var(--line)); background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 9%, var(--surface)), var(--surface)); }
.lvl.ouro { color: var(--gold); } .lvl.prata { color: var(--silver); } .lvl.bronze { color: var(--bronze); }
.sup .benefit { margin-top: 8px; font-size: 13px; padding: 6px 10px; border-radius: 10px; background: var(--brand-soft); color: var(--text); }
.sup .links { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.thanks { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.thank { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; gap: 10px; align-items: center; }
.thank .emo { font-size: 24px; }

/* Como ajudar */
.help { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.help-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.help-card .emo { font-size: 30px; }
.help-card .btn { margin-top: auto; }
.pix { display: flex; gap: 6px; align-items: center; background: var(--surface-2); border-radius: 10px; padding: 8px 10px; font-family: ui-monospace, monospace; font-size: 13px; word-break: break-all; }

/* Rodapé */
footer { border-top: 1px solid var(--line); background: var(--surface); padding: 28px 0; margin-top: 20px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }
.credit { font-size: 13px; color: var(--muted); }
.credit a { color: var(--brand); font-weight: 700; text-decoration: none; }

/* Diálogos */
dialog { border: 0; padding: 0; border-radius: 22px; background: var(--surface); color: var(--text); width: min(640px, calc(100% - 24px)); max-height: calc(100dvh - 24px); box-shadow: 0 30px 80px -20px rgb(0 0 0 / .5); }
dialog::backdrop { background: rgb(12 10 9 / .6); backdrop-filter: blur(3px); }
dialog[open] { animation: pop .2s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.dlg-head h2 { font-size: 19px; }
.x { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--surface-2); display: grid; place-items: center; cursor: pointer; }
.dlg-body { padding: 20px; display: grid; gap: 14px; }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
label.l { display: grid; gap: 5px; font-size: 13px; font-weight: 600; }
label.l .req { color: #dc2626; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; cursor: pointer; background: var(--surface-2); }
.drop { border: 2px dashed var(--line); border-radius: 16px; padding: 22px; text-align: center; cursor: pointer; background: var(--surface-2); }
.drop:hover, .drop.over { border-color: var(--brand); }
.drop img { max-height: 220px; margin: 0 auto; border-radius: 12px; }
.hp { position: absolute; left: -9999px; }

.pet-hero { position: relative; aspect-ratio: 16/10; background: var(--surface-2); }
.pet-hero img { width: 100%; height: 100%; object-fit: cover; border-radius: 22px 22px 0 0; }
.pet-hero .x { position: absolute; top: 12px; right: 12px; background: rgb(255 255 255 / .9); color: #1c1917; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; }
.fact { background: var(--surface-2); border-radius: 12px; padding: 8px 10px; text-align: center; }
.fact small { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; font-weight: 700; }
.fact b { font-size: 14px; }
.owner { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--brand-soft); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions .btn-wa { flex: 1 1 220px; }

/* Toast */
#toasts { position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; width: min(420px, calc(100% - 32px)); }
.toast { background: #1c1917; color: #fff; padding: 12px 16px; border-radius: 14px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow); animation: pop .2s; }
.toast.err { background: #dc2626; }

.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); min-height: 320px; }
@keyframes sk { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
