:root {
  --navy: #0b1f33;
  --navy-2: #12304d;
  --navy-3: #1a4166;
  --red: #c8102e;
  --gold: #c9a227;
  --gold-2: #e4c56a;
  --green: #1f6b3a;
  --pix: #32bcad;
  --blue: #0038a8;
  --paper: #f3efe6;
  --cream: #fffdf8;
  --ink: #1c1917;
  --muted: #5c6570;
  --line: #d9d2c4;
  --shadow: 0 18px 50px rgba(11, 31, 51, 0.12);
  --radius: 18px;
  --max: 1160px;
  --font: "Source Sans 3", "Segoe UI", sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  background: var(--paper);
  line-height: 1.5;
  min-height: 100vh;
}

body.contrast {
  --paper: #000;
  --cream: #111;
  --ink: #fff;
  --muted: #ddd;
  --navy: #000;
  --navy-2: #111;
  --line: #555;
}

img { max-width: 100%; display: block; }

a { color: var(--navy-2); }
a:hover { color: var(--red); }

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--gold);
  color: #111;
  padding: 8px 14px;
  z-index: 20;
}
.skip:focus { left: 8px; }

.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
}

.flag-bar {
  display: grid;
  grid-template-columns: 1fr;
  height: 9px;
  background: linear-gradient(to bottom, var(--red) 0 33%, #fff 33% 66%, var(--blue) 66% 100%);
}

.topbar {
  background: var(--navy);
  color: #e8eef5;
  font-size: 13px;
}
.topbar-inner,
.header-inner,
.nav-inner,
.wrap,
.footer-inner {
  width: min(var(--max), calc(100% - 32px));
  margin-inline: auto;
}
.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 38px;
}
.topbar a { color: #e8eef5; text-decoration: none; }
.topbar a:hover { color: var(--gold-2); }
.top-actions { display: flex; gap: 8px; }
.top-actions button {
  background: transparent;
  color: #e8eef5;
  border: 1px solid #33506c;
  border-radius: 999px;
  padding: 3px 10px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}
.top-actions button:hover { border-color: var(--gold); color: var(--gold-2); }

.site-header {
  background: var(--cream);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}
.brand img {
  width: 72px;
  height: 75px;
  object-fit: contain;
}
.brand-text strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.15;
  color: var(--navy);
}
.brand-text span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.3;
  max-width: 22rem;
}
.header-flag {
  width: 168px;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(11, 31, 51, 0.15);
  border: 1px solid var(--line);
}

.site-nav {
  background: var(--navy-2);
}
.nav-inner {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.nav-inner a {
  color: #eef3f8;
  text-decoration: none;
  padding: 12px 14px;
  font-size: 0.95rem;
  border-bottom: 3px solid transparent;
}
.nav-inner a:hover,
.nav-inner a[aria-current="page"] {
  color: #fff;
  border-bottom-color: var(--gold);
}

.hero {
  background:
    radial-gradient(800px 280px at 80% 0%, rgba(201, 162, 39, 0.18), transparent 60%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff;
  padding: 48px 0 56px;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  margin: 0 0 8px;
}
.hero p { margin: 0 0 24px; max-width: 640px; color: #d5deea; }
.search-card {
  background: var(--cream);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.search-card label {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}
.search-row input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  font: inherit;
  font-size: 1.05rem;
  background: #fff;
}
.search-row input:focus {
  outline: 2px solid var(--gold);
  border-color: var(--gold);
}
.search-row button,
.btn {
  border: 0;
  background: var(--red);
  color: #fff;
  font: inherit;
  font-weight: 700;
  padding: 14px 22px;
  min-height: 48px;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:focus-visible,
.search-row input:focus-visible,
.top-actions button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
.search-row button:hover,
.btn:hover { filter: brightness(1.05); }
.btn-ghost {
  background: transparent;
  color: var(--navy-2);
  border: 1px solid var(--line);
}
.hint { margin: 10px 0 0; color: var(--muted); font-size: 0.88rem; }

.section { padding: 36px 0; }
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 8px 24px rgba(11, 31, 51, 0.04);
}
.card h2, .card h3 {
  font-family: var(--serif);
  margin: 0 0 8px;
  font-size: 1.2rem;
}
.kicker {
  color: var(--red);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.notice {
  background: #fff7e0;
  border: 1px solid #ead7a0;
  color: #5b4710;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.92rem;
}

.result-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.contrib-meta { color: var(--muted); font-size: 0.92rem; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--cream); }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
th { background: #efe8d8; font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
.status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}
.status.pendente { background: #e8f4ec; color: var(--green); }
.status.vencida { background: #fde8ea; color: var(--red); }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
@media (min-width: 901px) {
  .detail-grid {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: start;
  }
}
.dl {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px 12px;
  margin: 0;
}
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 600; }
.boletim-cta {
  margin-top: 18px;
  padding: 14px;
  background: linear-gradient(180deg, #fff8e4 0%, #fffdf6 100%);
  border: 2px solid var(--gold);
  border-radius: 14px;
}
.btn-boletim {
  width: 100%;
  background: var(--navy);
  color: #fff;
  font-size: 1.02rem;
  letter-spacing: 0.01em;
}
.btn-boletim:hover { color: #fff; filter: brightness(1.08); }
.boletim-cta .hint { margin-top: 8px; }
.pix-part-badge {
  display: inline-block;
  margin: 0 0 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #0f766e;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.pix-part-badge.is-done {
  background: var(--green);
}
.pix-box {
  background: #f4fbfa;
  border: 1px solid #b7e6e0;
  border-radius: 16px;
  padding: 18px 16px 16px;
  text-align: center;
}
.pix-box .qr-img {
  width: 168px;
  height: 168px;
  margin: 8px auto 10px;
  background: #fff;
  border-radius: 10px;
  padding: 6px;
  border: 1px solid #d5ece9;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.pix-grid {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.pix-grid.is-split {
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .pix-grid.is-split { grid-template-columns: 1fr 1fr; }
}
.pix-tile {
  background: #fff;
  border: 1px solid #d5ece9;
  border-radius: 14px;
  padding: 12px 12px 14px;
}
.pix-tile-n {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #0f766e;
  margin-bottom: 2px;
}
.pix-tile-val {
  font-family: var(--serif);
  font-size: 1.35rem;
  margin: 0 0 4px;
  color: var(--navy);
}
.pix-split-line {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.pix-pdf {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--navy-2);
}
.pix-valor {
  font-family: var(--serif);
  font-size: 1.8rem;
  margin: 4px 0 2px;
  color: var(--navy);
}
.pix-copy-label {
  display: block;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pix);
  margin: 12px 0 6px;
}
.pix-payload {
  width: 100%;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.72rem;
  line-height: 1.4;
  border: 1px solid #9adcd4;
  border-radius: 10px;
  padding: 10px;
  resize: none;
  background: #fff;
  color: var(--ink);
}
.pix-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}
.pix-actions .btn {
  flex: 1 1 160px;
}
.pix-box h2 {
  font-size: 1.15rem;
  margin: 0 0 10px;
}
.pix-steps {
  text-align: left;
  font-size: 0.86rem;
  color: var(--muted);
  padding-left: 18px;
  margin: 14px 0 0;
}
.qr-placeholder {
  width: 180px;
  height: 180px;
  margin: 12px auto;
  border: 2px dashed #9adcd4;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #5b8f89;
  font-size: 0.85rem;
  background:
    repeating-linear-gradient(45deg, #f3fffd, #f3fffd 8px, #e7f8f5 8px, #e7f8f5 16px);
}

.empty {
  text-align: center;
  padding: 48px 16px;
  background: var(--cream);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.site-footer {
  background: var(--navy);
  color: #d7e0ea;
  margin-top: 28px;
  padding: 36px 0 18px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.4fr;
  gap: 24px;
}
.site-footer h2 {
  font-family: var(--serif);
  color: #fff;
  font-size: 1.05rem;
  margin: 0 0 10px;
}
.site-footer p, .site-footer li { font-size: 0.9rem; }
.site-footer ul { margin: 0; padding-left: 18px; }
.seals {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.seals img {
  width: 72px;
  height: 72px;
  background: #fff;
  border-radius: 50%;
  padding: 4px;
}
.legal {
  border-top: 1px solid #2a4663;
  margin-top: 22px;
  padding-top: 14px;
  font-size: 0.8rem;
  color: #9eb0c3;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.guia-cards { display: none; }
.desktop-table { display: block; }
.btn-pix {
  width: 100%;
  background: #0f766e;
  font-size: 0.95rem;
  margin: 0;
  min-height: 44px;
}
.btn-pix:hover { filter: brightness(1.08); }
.pix-ok {
  background: #e8f4ec;
  color: var(--green);
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 700;
  font-size: 0.92rem;
}
.pix-qr-details {
  text-align: left;
  margin-top: 14px;
  background: #fff;
  border: 1px solid #b7e6e0;
  border-radius: 12px;
  padding: 8px 12px 12px;
}
.pix-qr-details summary {
  cursor: pointer;
  font-weight: 700;
  padding: 10px 0;
  min-height: 44px;
}
.pix-sticky {
  display: none;
}
.pix-id { word-break: break-all; }

@media (max-width: 900px) {
  .hide-sm { display: none; }
  .header-flag { display: none; }
  .cards, .footer-grid { grid-template-columns: 1fr; }
  .search-row { grid-template-columns: 1fr; }
  .brand img { width: 48px; height: 50px; }
  .brand-text strong { font-size: 1.05rem; }
  .brand-text span { font-size: 0.64rem; letter-spacing: 0.02em; max-width: 16rem; }
  .dl { grid-template-columns: 1fr; }
  .topbar { font-size: 12px; }
  .topbar-inner, .header-inner { width: min(var(--max), calc(100% - 20px)); }
  .wrap, .footer-inner, .nav-inner { width: min(var(--max), calc(100% - 20px)); }
  .header-inner { padding: 8px 0; gap: 10px; }
  .top-actions a { display: none; }
  .top-actions button { min-height: 36px; padding: 6px 12px; }
  .nav-inner { gap: 0; }
  .nav-inner a {
    flex: 1;
    text-align: center;
    padding: 14px 6px;
    font-size: 0.82rem;
  }
  .hero { padding: 22px 0 28px; }
  .hero h1 { font-size: 1.55rem; }
  .hero p { margin-bottom: 16px; font-size: 0.95rem; }
  .search-card { padding: 16px; border-radius: 16px; }
  .search-row input {
    font-size: 16px;
    min-height: 52px;
    padding: 14px;
  }
  .search-row button { width: 100%; min-height: 52px; }
  .section { padding: 20px 0 32px; }
  .result-head { flex-direction: column; }
  .desktop-table { display: none; }
  .guia-cards {
    display: grid;
    gap: 12px;
    margin-top: 16px;
  }
  .guia-card {
    display: block;
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 8px 24px rgba(11, 31, 51, 0.06);
  }
  .guia-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
  }
  .guia-card-top strong {
    font-size: 1.35rem;
    color: var(--navy);
  }
  .guia-card-meta { margin: 0 0 4px; color: var(--muted); font-size: 0.9rem; }
  .guia-card .btn { width: 100%; margin-top: 12px; }
  .pix-box {
    padding: 18px 16px 20px;
    border-style: solid;
  }
  .pix-valor { font-size: 1.85rem; margin: 4px 0; }
  .pix-box .qr-img { width: 148px; height: 148px; }
  .pix-tile .btn-pix { width: 100%; margin: 0; }
  .seals img { width: 56px; height: 56px; }
  .site-footer { padding-bottom: 28px; }
  body.on-guia { padding-bottom: 84px; }
  body.on-guia .pix-sticky {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    background: #0b1f33;
    color: #fff;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.25);
  }
  body.on-guia .pix-sticky strong { display: block; font-size: 1.1rem; }
  body.on-guia .pix-sticky span { font-size: 0.75rem; color: #9adcd4; }
  body.on-guia .pix-sticky .btn {
    background: var(--pix);
    color: #042f2e;
    min-width: 132px;
    min-height: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
