:root {
  /* Katxor CV: azul da marca sobre fundo claro; coral reservado a alertas de desaparecimento.
     Layout: faixa azul com pesquisa no topo, grelha de atalhos, cartões de cães. */
  --brand: #176dde;
  --brand-dark: #0b4fae;
  --navy: #0b2a5c;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --ink: #16202e;
  --muted: #5b6878;
  --line: #dfe5ee;
  --tint: #eaf2fd;
  --alert: #c8402c;
  --alert-tint: #fdeeeb;
  --ok: #1d7a46;
  --warn-tint: #fff5e0;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #4f95f0; --brand-dark: #8fbaf6; --navy: #0d1f3d; --bg: #0f141b; --surface: #171e28;
    --ink: #e7edf5; --muted: #9eabbb; --line: #283242; --tint: #17263b; --alert: #f07c69;
    --alert-tint: #3a1f1b; --ok: #6ccf97; --warn-tint: #3a311c; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #4f95f0; --brand-dark: #8fbaf6; --navy: #0d1f3d; --bg: #0f141b; --surface: #171e28;
  --ink: #e7edf5; --muted: #9eabbb; --line: #283242; --tint: #17263b; --alert: #f07c69;
  --alert-tint: #3a1f1b; --ok: #6ccf97; --warn-tint: #3a311c; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); }
img { max-width: 100%; display: block; }
a { color: var(--brand-dark); }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); letter-spacing: -.01em; }
h2 { font-size: 1.3rem; }
p { margin: 0 0 1em; max-width: 68ch; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 18px; }
.muted { color: var(--muted); }
.error { color: var(--alert); font-weight: 600; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; color: var(--brand-dark); margin: 0 0 .4em; }

.demo-banner { background: var(--warn-tint); color: var(--ink); text-align: center; font-size: .88rem; padding: 6px 12px; border-bottom: 1px solid var(--line); }

/* ---------- topo ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-row { display: flex; align-items: center; gap: 18px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { border-radius: 9px; }
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand small { color: var(--muted); font-size: .74rem; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { text-decoration: none; color: var(--ink); padding: 8px 12px; border-radius: 8px; font-weight: 500; }
.nav a:hover, .nav a.active { background: var(--tint); color: var(--brand-dark); }
.account { display: flex; gap: 8px; align-items: center; }
@media (max-width: 760px) {
  .topbar-row { padding-top: 8px; padding-bottom: 8px; gap: 8px; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .account { margin-left: auto; }
}

/* ---------- botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600;
  border-radius: 10px; padding: 11px 18px; border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-outline { border-color: var(--brand); color: var(--brand-dark); background: transparent; }
.btn-ghost { background: transparent; color: var(--ink); padding: 8px 12px; }
.btn-ghost:hover { background: var(--tint); }
.btn-sm { padding: 8px 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: wait; }
.btn-google { width: 100%; background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-google svg { stroke: none; width: 20px; height: 20px; }

/* ---------- topo da página inicial ---------- */
.hero { background: var(--navy); color: #fff; padding: 46px 0 54px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px; align-items: center; }
.hero .eyebrow { color: #9cc4fb; }
.hero .lead { color: #d6e4f7; font-size: 1.08rem; }
.search-card { background: var(--surface); color: var(--ink); border-radius: var(--radius); padding: 22px; box-shadow: 0 12px 30px rgba(5, 20, 50, .3); }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; gap: 20px; } .hero { padding: 30px 0 36px; } }

.search label { font-weight: 700; display: block; margin-bottom: 8px; }
.search-row { display: flex; gap: 8px; }
.search-row input { flex: 1; min-width: 0; }
.hint { color: var(--muted); font-size: .86rem; margin: 8px 0 0; }
@media (max-width: 480px) { .search-row { flex-direction: column; } }

input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 12px; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: 2px solid color-mix(in srgb, var(--brand) 25%, transparent); }

/* ---------- atalhos ---------- */
.actions { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-top: -26px; position: relative; }
.action { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 10px; text-align: center;
  text-decoration: none; color: var(--ink); font-weight: 600; font-size: .9rem; display: flex; flex-direction: column; align-items: center; gap: 8px;
  box-shadow: 0 2px 6px rgba(10, 30, 60, .06); }
.action svg { width: 28px; height: 28px; fill: none; stroke: var(--brand); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.action:hover { border-color: var(--brand); }
.action-alert svg { stroke: var(--alert); }
.action-alert { border-color: color-mix(in srgb, var(--alert) 35%, var(--line)); }
@media (max-width: 960px) { .actions { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 520px) { .actions { grid-template-columns: repeat(2, 1fr); margin-top: 16px; } }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 22px; }
.stat { background: var(--tint); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; }
.stat b { font-size: 1.6rem; font-variant-numeric: tabular-nums; color: var(--brand-dark); }
.stat span { color: var(--muted); font-size: .9rem; }
.stats:empty { display: none; }

/* ---------- secções ---------- */
.section { margin-top: 38px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h2, .section-head h1 { margin: 0; }
.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: start; margin-bottom: 40px; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.note-card { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius); padding: 20px; }

.faq { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.faq summary { cursor: pointer; padding: 13px 16px; font-weight: 600; }
.faq p { padding: 0 16px 14px; margin: 0; color: var(--muted); }

/* ---------- cartões de cães ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.dog-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; }
.dog-card:hover { border-color: var(--brand); }
.dog-card.is-missing { border-top: 4px solid var(--alert); }
.dog-photo { aspect-ratio: 4 / 3; background: var(--tint); position: relative; display: grid; place-items: center; }
.dog-photo img { width: 100%; height: 100%; object-fit: cover; }
.no-photo { color: var(--muted); font-size: .9rem; }
.dog-body { padding: 12px 14px 14px; display: grid; gap: 2px; font-size: .92rem; }
.dog-name { font-weight: 700; font-size: 1.08rem; }
.kcv { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-weight: 600; color: var(--brand-dark); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.kcv-lg { font-size: 1.15rem; }
.since { color: var(--alert); font-weight: 600; margin-top: 4px; }
.tag { position: absolute; top: 10px; left: 10px; font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.tag-missing { background: var(--alert); color: #fff; }
.tag-pending { position: static; display: inline-block; justify-self: start; background: var(--warn-tint); color: var(--ink); margin-top: 6px; }

/* ---------- páginas ---------- */
.page { padding-top: 28px; padding-bottom: 48px; }
.narrow { max-width: 760px; }
.lead-sm { color: var(--muted); }
.filter { display: inline-flex; flex-direction: column; gap: 4px; font-weight: 600; margin-bottom: 16px; min-width: 220px; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 22px; margin-top: 18px; }
.result { margin-top: 10px; }
.steps { padding-left: 1.2em; } .steps li { margin-bottom: 10px; }

.banner-missing, .banner-pending, .banner-info { border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; display: flex; gap: 12px; }
.banner-missing { background: var(--alert-tint); border: 1px solid color-mix(in srgb, var(--alert) 40%, transparent); }
.banner-missing svg { width: 26px; height: 26px; flex: none; fill: none; stroke: var(--alert); stroke-width: 2; }
.banner-pending { background: var(--warn-tint); }
.banner-info { background: var(--tint); }

.dog-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; align-items: start; }
.dog-hero-photo { border-radius: var(--radius); overflow: hidden; background: var(--tint); aspect-ratio: 4 / 3; display: grid; place-items: center; }
.dog-hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.dog-title { margin-bottom: 2px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; margin: 16px 0; }
.facts div { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.facts dt { color: var(--muted); font-size: .82rem; }
.facts dd { margin: 0; font-weight: 600; }
.privacy-note { font-size: .88rem; color: var(--muted); }
.dog-bottom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; margin-top: 26px; align-items: start; }
@media (max-width: 820px) { .dog-layout, .dog-bottom { grid-template-columns: 1fr; } .facts { grid-template-columns: 1fr 1fr; } }

.id-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: 0 6px 18px rgba(10, 30, 60, .08); }
.id-card-head { background: var(--brand); color: #fff; display: flex; align-items: center; gap: 10px; padding: 10px 16px; font-weight: 700; font-size: .92rem; }
.id-card-head img { border-radius: 6px; background: #fff; }
.id-card-body { display: flex; gap: 16px; padding: 16px; align-items: center; flex-wrap: wrap; }
.qr { background: #fff; border-radius: 8px; padding: 4px; border: 1px solid var(--line); line-height: 0; }

.found-form, .auth form { display: grid; gap: 12px; }
.found-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.found-form h2 { margin: 0; }
label { display: grid; gap: 5px; font-weight: 600; font-size: .94rem; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
label.check input { width: auto; margin-top: 4px; }
.form-status { margin: 0; min-height: 1.4em; }
.form-status.ok { color: var(--ok); font-weight: 600; }
.form-status.error { color: var(--alert); font-weight: 600; }

.auth { max-width: 440px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .88rem; margin: 18px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- rodapé ---------- */
.footer { background: var(--navy); color: #d6e4f7; margin-top: 30px; padding: 36px 0 18px; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; }
.footer h3 { color: #fff; font-size: .95rem; }
.footer a { display: block; color: #d6e4f7; text-decoration: none; margin-bottom: 6px; }
.footer a:hover { text-decoration: underline; }
.brand-footer { color: #fff; margin-bottom: 10px; }
.muted-inv { color: #9fb4d1; }
.footer-base { border-top: 1px solid rgba(255, 255, 255, .15); margin-top: 22px; padding-top: 14px; font-size: .8rem; color: #9fb4d1; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
.page > h2 { margin-top: 30px; }
