:root {
  --brand-blue: #20468f;
  --mid-blue: #028dcc;
  --deep-blue: #17377d;
  --soft-blue: #d5edf8;
  --page-gray: #ececec;
  --line-gray: #b9b9b9;
  --text-blue: #223a9b;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: #1f2f60;
  background: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
}

a {
  text-decoration: none;
}

.page-shell {
  width: min(100%, 1280px);
  margin: 0 auto;
  background: var(--page-gray);
}

.top-pattern {
  height: 78px;
  overflow: hidden;
  background: url("/img/faixa_topo.jpg") center / cover no-repeat;
}

.top-pattern span {
  display: none;
}

.site-header {
  padding: 18px 32px 12px;
  background: #fff;
}

.logo-placeholder,
.panel-logo-slot,
.footer-logo-slot {
  background: transparent;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--brand-blue);
}

.logo-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left center;
}

.logo-icon {
  position: relative;
  width: 52px;
  height: 46px;
  flex: 0 0 auto;
}

.logo-icon::before {
  position: absolute;
  left: 7px;
  bottom: 0;
  width: 38px;
  height: 30px;
  content: "";
  background: currentColor;
  clip-path: polygon(50% 0, 100% 38%, 100% 100%, 0 100%, 0 38%);
}

.logo-icon::after {
  position: absolute;
  left: 18px;
  bottom: 0;
  width: 16px;
  height: 18px;
  content: "";
  background: #fff;
  border-radius: 9px 9px 0 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.logo-text strong {
  color: currentColor;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 0;
}

.logo-text small {
  margin-top: 8px;
  color: currentColor;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 9px;
}

.logo-mark-light {
  color: #fff;
}

.logo-placeholder {
  width: min(100%, 250px);
  height: 82px;
}

.main-nav {
  display: flex;
  justify-content: flex-end;
  gap: 22px;
  margin-top: 0;
  white-space: nowrap;
}

.main-nav a {
  color: var(--brand-blue);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: uppercase;
}

.hero-banner {
  position: relative;
  height: 205px;
  overflow: hidden;
  background: #335f4e;
}

.hero-water {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.12)),
    url("/img/cabecalho.jpg") center / cover no-repeat;
}

.hero-banner h1 {
  position: absolute;
  left: 32px;
  bottom: 38px;
  margin: 0;
  color: #fff;
  font-size: clamp(1.55rem, 2.4vw, 2.1rem);
  font-weight: 900;
  text-transform: uppercase;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.55);
}

.content-area {
  min-height: 1180px;
  padding: 66px 32px 0;
}

.breadcrumb-line {
  display: flex;
  gap: 8px;
  margin-bottom: 48px;
  color: var(--brand-blue);
  font-size: 12px;
  font-weight: 700;
}

.breadcrumb-line a,
.breadcrumb-line strong {
  color: var(--brand-blue);
}

.section-kicker {
  margin: 0 0 24px;
  color: var(--brand-blue);
  font-size: 17px;
  font-weight: 900;
  text-transform: uppercase;
}

.debt-panel {
  border-top: 1px solid var(--line-gray);
  background: #efefef;
  color: var(--text-blue);
  font-size: 13px;
  font-weight: 700;
}

.panel-brand {
  height: 110px;
  padding: 22px 0 0;
  background: linear-gradient(90deg, #fff 0 44%, #f8f8f8 45% 100%);
}

.panel-logo-slot {
  width: min(330px, 80%);
  height: 74px;
  margin-left: 0;
}

.panel-bar {
  height: 40px;
  background: linear-gradient(90deg, #1c407f, #263f7a);
}

.panel-heading {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 8px;
  padding: 10px 2px 18px;
}

.panel-heading h3 {
  margin: 0;
  color: #008fca;
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  font-weight: 900;
}

.panel-heading p {
  margin: 0 26px 0 0;
  color: #008fca;
}

.info-badge,
.help-notes span {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 3px solid #c6dfe8;
  border-radius: 50%;
  color: #078fc2;
  background: #fff;
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 900;
}

.info-text {
  color: #2b308f;
  font-size: 16px;
}

.debt-form label {
  color: #222c91;
}

.debt-form small {
  color: #0a84bd;
  font-size: 10px;
}

.debt-form input {
  width: 100%;
  height: 18px;
  border: 1px solid #7b7b7b;
  background: #fff;
}

/* Espaçamento entre os campos do formulário (Código Consumidor e CPF/CNPJ) */
.debt-form .row + .row {
  margin-top: 18px;
}

.debt-form hr,
.debt-panel > hr {
  margin: 16px 0 8px;
  border: 0;
  border-top: 1px solid #999;
  opacity: 0.8;
}

.blue-dot {
  width: 9px;
  height: 9px;
  margin: 4px 0;
  border: 3px solid #0078b5;
  border-radius: 50%;
}

.button-row {
  display: flex;
  gap: 28px;
  margin: 10px 0 20px 10px;
}

.button-row button {
  min-width: 86px;
  height: 44px;
  border: 0;
  color: #fff;
  background: #0088c4;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25);
  font-size: 13px;
  font-weight: 800;
}

.data-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.5fr 1fr;
  min-height: 142px;
  gap: 18px;
}

.data-grid div {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.connection-info {
  justify-content: center;
  text-align: center;
}

.help-notes {
  margin-top: 18px;
  color: #2666d0;
  font-size: 15px;
}

.help-notes p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 5px 0;
}

.help-notes p:nth-child(2) {
  margin-left: 38px;
  color: #223a9b;
  font-size: 13px;
}

.help-notes span {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  font-size: 17px;
  line-height: 1;
}

.panel-copy {
  margin: 36px 0 0;
  color: #213aa2;
  font-size: 10px;
  text-align: center;
}

.site-footer {
  position: relative;
  overflow: hidden;
  padding: 50px 32px 78px;
  color: #fff;
  background: #21438b;
}

.site-footer::before,
.site-footer::after {
  position: absolute;
  content: "";
  border-radius: 50%;
  background: rgba(44, 83, 161, 0.32);
}

.site-footer::before {
  right: 110px;
  top: 8px;
  width: 330px;
  height: 330px;
}

.site-footer::after {
  left: -140px;
  bottom: -180px;
  width: 520px;
  height: 330px;
}

.footer-logo-slot,
.footer-rule,
.site-footer .row {
  position: relative;
  z-index: 1;
}

.footer-logo-slot {
  width: 245px;
  height: 68px;
}

.footer-rule {
  height: 2px;
  margin: 30px 0 58px;
  background: rgba(255, 255, 255, 0.88);
}

.site-footer h2 {
  margin: 0 0 18px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.25;
}

.site-footer ul {
  margin: 0;
  padding-left: 24px;
}

.site-footer li {
  margin-bottom: 9px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}

.accessibility-button,
.chat-button,
.back-top {
  position: fixed;
  z-index: 5;
  display: grid;
  place-items: center;
  border: 0;
  color: #fff;
}

.accessibility-button {
  left: 12px;
  bottom: 12px;
  width: 70px;
  height: 70px;
  border: 5px solid #4e62bd;
  border-radius: 50%;
  color: #244cba;
  background: #cfeaf2;
  font-size: 34px;
}

.chat-button {
  right: 18px;
  top: 50%;
  width: 44px;
  height: 44px;
  border-radius: 9px;
  background: #1676e8;
  font-size: 25px;
}

.back-top {
  right: 32px;
  bottom: 22px;
  width: 50px;
  height: 42px;
  border-radius: 8px;
  background: #6375b3;
  font-size: 26px;
}

@media (max-width: 991.98px) {
  .site-header {
    padding: 18px 20px;
  }

  .logo-placeholder {
    margin: 0 auto;
  }

  .main-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 18px;
    white-space: normal;
  }

  .content-area {
    min-height: 900px;
    padding: 42px 20px 0;
  }

  .panel-heading {
    grid-template-columns: 1fr auto auto;
  }

  .panel-heading p {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .data-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .site-footer {
    padding-inline: 20px;
  }
}

@media (max-width: 575.98px) {
  body {
    font-size: 13px;
  }

  .top-pattern {
    height: 54px;
  }

  .site-header {
    padding-inline: 14px;
  }

  .main-nav a {
    font-size: 11px;
  }

  .main-nav {
    display: none;
  }

  .hero-banner {
    height: 150px;
  }

  .hero-banner h1 {
    left: 18px;
    bottom: 28px;
  }

  .content-area {
    padding: 32px 14px 0;
  }

  .breadcrumb-line {
    margin-bottom: 28px;
  }

  .panel-brand {
    height: 86px;
  }

  .panel-heading {
    grid-template-columns: 1fr;
  }

  .info-badge,
  .info-text {
    display: none;
  }

  .button-row {
    margin-left: 0;
  }

  .data-grid {
    grid-template-columns: 1fr;
  }

  .help-notes {
    font-size: 13px;
  }

  .help-notes p {
    align-items: flex-start;
  }

  .panel-copy {
    margin-bottom: 24px;
  }

  .site-footer h2 {
    font-size: 15px;
  }

  .site-footer li {
    font-size: 13px;
  }

  .accessibility-button {
    width: 52px;
    height: 52px;
    font-size: 24px;
  }

  .chat-button {
    right: 10px;
  }

  .back-top {
    right: 16px;
  }
}

/* ===== Página de débitos (resultado) ===== */
.result-status,
.consulta-status {
  margin: 8px 0 18px;
  color: #008fca;
  font-size: 15px;
  font-weight: 700;
}

.result-status.is-error,
.consulta-status.is-error {
  color: #c0392b;
}

#consulta-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.consumer-info {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 24px;
  margin-bottom: 20px;
}

.consumer-field {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.consumer-label {
  color: var(--brand-blue);
  font-weight: 700;
}

.consumer-value {
  color: #c0392b;
  font-weight: 700;
}

.debts-table-scroll {
  width: 100%;
}

.debts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.debts-table thead th {
  padding: 8px 12px;
  color: #1f2f60;
  background: #cfe0ef;
  border: 1px solid #9bb3cf;
  text-align: right;
  white-space: nowrap;
}

.debts-table thead th:first-child {
  text-align: left;
}

.debts-table tbody td {
  padding: 8px 12px;
  border: 1px solid #d8d8d8;
  color: #c0392b;
  font-weight: 700;
}

.debts-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.debts-table .col-total {
  background: #fdeaea;
  color: #a01b1b;
}

.debts-table .total-row td {
  border-top: 2px solid #1c407f;
  font-weight: 800;
}

.debts-table .total-row .col-total {
  background: #f6d9d9;
}

@media (max-width: 991.98px) {
  .consumer-info {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .consumer-info {
    grid-template-columns: 1fr;
  }

  .debts-table thead {
    display: none;
  }

  .debts-table,
  .debts-table tbody,
  .debts-table tr,
  .debts-table td {
    display: block;
    width: 100%;
  }

  .debts-table tr {
    margin-bottom: 14px;
    border: 1px solid #c9c9c9;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
  }

  .debts-table tbody td {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border: 0;
    border-bottom: 1px solid #eee;
    text-align: right;
  }

  .debts-table tbody td::before {
    content: attr(data-label);
    color: var(--brand-blue);
    font-weight: 700;
    text-align: left;
  }

  .debts-table .total-row {
    border: 2px solid #1c407f;
  }

  .debts-table .total-row td:first-child {
    background: #eaf0fb;
    justify-content: flex-start;
  }
}

/* ===== Pagamento Pix ===== */
.pix-link {
  color: #0a84bd;
  font-weight: 700;
  text-decoration: underline;
}

.pix-link:hover {
  color: #20468f;
}

.pix-status {
  margin: 6px 0;
  color: #008fca;
  font-weight: 700;
}

.pix-status.is-error {
  color: #c0392b;
}

.pix-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin: 0 0 14px;
  color: #1f2f60;
}

.pix-qr-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.pix-code-label {
  display: block;
  margin-bottom: 4px;
  color: var(--brand-blue);
  font-weight: 700;
}

.pix-code {
  width: 100%;
  font-family: "Courier New", monospace;
  font-size: 12px;
  word-break: break-all;
  resize: vertical;
}

.pix-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
}

.pix-copy {
  border: 0;
  border-radius: 4px;
  padding: 8px 16px;
  color: #fff;
  background: #0088c4;
  font-weight: 800;
}

.pix-copy-feedback {
  color: #1c7c3a;
  font-weight: 700;
}

.pix-expira {
  margin: 6px 0 0;
  color: #6b6b6b;
  font-size: 12px;
}

/* ===== Modal de consulta (index) ===== */
.consulta-modal {
  border: 0;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(15, 58, 91, 0.25);
}

.consulta-modal .modal-body {
  padding: 36px 28px;
}

.consulta-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}

.consulta-modal-title {
  margin: 0;
  font-size: 18px;
  color: #0f3a5b;
  font-weight: 700;
}

.consulta-modal-sub {
  margin: 0;
  font-size: 14px;
  color: #4a5b6a;
  max-width: 320px;
}

.consulta-spinner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 5px solid #e3ebf0;
  border-top-color: #008fca;
  animation: consulta-spin 0.9s linear infinite;
}

@keyframes consulta-spin {
  to { transform: rotate(360deg); }
}

.consulta-error-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fdecea;
  color: #b3261e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
}

.consulta-close {
  margin-top: 6px;
  background: #008fca;
  color: #fff;
  border: 0;
  padding: 8px 22px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
}

.consulta-close:hover {
  background: #0079ad;
}

/* ===== Dashboard ===== */
.dashboard-page .content-area {
  padding-top: 24px;
}

.main-nav a.is-active {
  color: #008fca;
  font-weight: 700;
}

.dash-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.dash-title {
  margin: 0;
  font-size: 24px;
  color: #0f3a5b;
}

.dash-subtitle {
  margin: 4px 0 0;
  color: #4a5b6a;
  font-size: 14px;
}

.dash-last {
  margin-left: 8px;
  color: #6b8395;
}

.dash-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dash-auto {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #4a5b6a;
}

.dash-btn {
  background: #008fca;
  color: #fff;
  border: 0;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
}

.dash-btn:hover {
  background: #0079ad;
}

.dash-status {
  background: #fff3f1;
  border: 1px solid #f3c4bf;
  color: #c0392b;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 14px;
}

.dash-status.is-error {
  background: #fff3f1;
  color: #c0392b;
}

.dash-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.dash-card {
  background: #fff;
  border: 1px solid #e3ebf0;
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(15, 58, 91, 0.04);
}

.dash-card-kicker {
  display: block;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b8395;
  margin-bottom: 6px;
}

.dash-card-value {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: #0f3a5b;
  line-height: 1.1;
}

.dash-card-foot {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
}

.dash-muted {
  color: #6b8395;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #eef3f7;
  color: #4a5b6a;
}

.pill b {
  font-weight: 700;
}

.pill-ok {
  background: #e6f6ec;
  color: #1f7a3e;
}

.pill-erro {
  background: #fdecea;
  color: #b3261e;
}

.pill-tipo {
  background: #e6f1f9;
  color: #0f3a5b;
}

.dash-events {
  background: #fff;
  border: 1px solid #e3ebf0;
  border-radius: 10px;
  padding: 16px;
}

.dash-events-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.dash-events-head h2 {
  margin: 0;
  font-size: 16px;
  color: #0f3a5b;
}

.dash-filter {
  display: inline-flex;
  border: 1px solid #d4dee6;
  border-radius: 6px;
  overflow: hidden;
}

.dash-filter-btn {
  background: #fff;
  border: 0;
  padding: 6px 12px;
  font-size: 13px;
  color: #4a5b6a;
  cursor: pointer;
}

.dash-filter-btn + .dash-filter-btn {
  border-left: 1px solid #d4dee6;
}

.dash-filter-btn.is-active {
  background: #008fca;
  color: #fff;
  font-weight: 700;
}

.dash-table-scroll {
  overflow-x: auto;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.dash-table th,
.dash-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #eef2f5;
  text-align: left;
  vertical-align: top;
}

.dash-table th {
  font-size: 12px;
  color: #6b8395;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #f7fafc;
}

.dash-table td.num,
.dash-table th.num {
  text-align: right;
  white-space: nowrap;
}

.dash-table code {
  background: #f1f4f7;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 12px;
}

.dash-err {
  color: #b3261e;
}

.dash-empty td {
  color: #6b8395;
  text-align: center;
  padding: 18px 10px;
}

.dash-footer {
  margin-top: 24px;
}

@media (max-width: 640px) {
  .dash-header {
    align-items: flex-start;
  }
  .dash-controls {
    width: 100%;
    justify-content: space-between;
  }
}
