:root {
  --paper: #fffdfa;
  --canvas: #f7efe3;
  --ink: #10243b;
  --muted: #637183;
  --navy: #10243b;
  --gold: #d3a85f;
  --gold-soft: rgba(211, 168, 95, 0.16);
  --line: rgba(16, 36, 59, 0.1);
  --red: #c2543f;
  --green: #24825b;
  --shadow: 0 22px 56px rgba(16, 36, 59, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Inter", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(211, 168, 95, 0.2), transparent 28%),
    radial-gradient(circle at bottom right, rgba(16, 36, 59, 0.08), transparent 35%),
    linear-gradient(160deg, #f7efe3 0%, #fcf8f2 52%, #eef2f5 100%);
}

.lead-gate {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(16, 36, 59, 0.58);
  backdrop-filter: blur(8px);
}

.lead-gate[hidden] {
  display: none;
}

.lead-gate-card {
  width: min(560px, 100%);
  padding: 28px;
  border-radius: 28px;
  background: var(--paper);
  box-shadow: 0 32px 60px rgba(16, 36, 59, 0.26);
}

.lead-gate-card h2 {
  margin-top: 10px;
  font-size: clamp(1.9rem, 3vw, 2.6rem);
}

.lead-gate-copy {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.lead-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.lead-submit {
  margin-top: 6px;
}

.page-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.hero,
.panel {
  background: rgba(255, 250, 243, 0.88);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero {
  margin-bottom: 24px;
  animation: rise-fade 420ms ease both;
}

.hero-copy {
  padding: 28px 38px;
}

.hero-brand-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: center;
}

.hero-brand-copy h1 {
  max-width: none;
}

.hero-logo {
  width: 100%;
  max-width: 312px;
  max-height: 264px;
  object-fit: contain;
  display: block;
  margin-left: auto;
}

.kicker,
.eyebrow,
.panel-title {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--gold);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Manrope", "Inter", sans-serif;
  line-height: 1.05;
}

h1 {
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  line-height: 1.08;
}

h1 span {
  display: block;
  color: var(--gold);
  font-size: 0.62em;
  margin-top: 6px;
}

.lead {
  margin: 10px 0 0;
  max-width: 62ch;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.98rem;
}

.layout {
  display: grid;
  grid-template-columns: 430px 1fr;
  gap: 24px;
}

.panel {
  padding: 28px;
  animation: rise-fade 420ms ease both;
}

.panel-heading {
  margin-bottom: 18px;
}

.panel-heading h2 {
  margin-top: 8px;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.field-group + .field-group {
  margin-top: 22px;
}

.group-heading {
  margin-bottom: 14px;
}

.group-heading h3 {
  margin-top: 8px;
  font-size: 1.16rem;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.top-grid {
  margin-bottom: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field span {
  display: flex;
  align-items: center;
  min-height: 2.8rem;
  font-size: 0.94rem;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 58px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fffefb;
  color: var(--ink);
  font: inherit;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: rgba(211, 168, 95, 0.82);
  box-shadow: 0 0 0 4px rgba(211, 168, 95, 0.12);
  transform: translateY(-1px);
}

.field select[data-cub-select="true"] {
  cursor: help;
}

.field textarea {
  resize: vertical;
  min-height: 120px;
}

.checkbox-field {
  width: 100%;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fffefb;
  min-height: 58px;
  align-self: end;
  overflow: visible;
}

.cub-label-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 2.8rem;
  font-size: 0.94rem;
  font-weight: 700;
}

.cub-info-btn {
  display: none; /* visível só em dispositivos touch — veja @media abaixo */
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 1.1rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

@media (pointer: coarse) {
  .cub-info-btn {
    display: flex;
  }
}

.cub-info-btn:hover {
  background: rgba(211, 168, 95, 0.28);
}

.cub-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 30;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(16, 36, 59, 0.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: white;
  font-size: 0.82rem;
  line-height: 1.5;
  animation: rise-fade 160ms ease both;
}

.cub-popover-item {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cub-popover-item:last-child {
  border-bottom: none;
}

.cub-popover-item.is-active {
  color: var(--gold);
}

.checkbox-field input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: auto;
  margin: 0;
  flex-shrink: 0;
  border: 2px solid rgba(16, 36, 59, 0.28);
  border-radius: 6px;
  background: white;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease;
}

.checkbox-field input[type="checkbox"]:checked {
  background: var(--navy);
  border-color: var(--navy);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpath d='M1.5 5l2.5 3L10.5 1' stroke='%23ffffff' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 12px 10px;
  background-repeat: no-repeat;
  background-position: center;
}

.checkbox-field span {
  min-height: auto;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  font-size: 0.94rem;
  font-weight: 700;
}

.action-row {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.primary-button,
.secondary-button,
.support-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 18px;
  border-radius: 18px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.primary-button {
  flex: 1;
  border: 0;
  background: linear-gradient(135deg, #d7b06d, #c89f59);
  color: var(--navy);
  box-shadow: 0 18px 34px rgba(122, 47, 21, 0.22);
}

.primary-button:hover,
.support-button:hover {
  transform: translateY(-2px);
}

.secondary-button {
  flex: 0.75;
  border: 1px solid rgba(16, 36, 59, 0.12);
  background: rgba(255, 255, 255, 0.84);
  color: var(--navy);
}

.summary-grid {
  display: block;
  margin-bottom: 18px;
}

.report-header,
.legal-basis {
  margin-bottom: 18px;
}

.report-card {
  padding: 20px 22px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(16, 36, 59, 0.08);
}

.report-card h3 {
  margin-top: 8px;
  font-size: 1.7rem;
}

.report-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.meta-item,
.commercial-note {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(211, 168, 95, 0.08);
}

.meta-item span,
.commercial-note span {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  font-weight: 800;
}

.meta-item strong,
.commercial-note p {
  display: block;
  margin-top: 8px;
  line-height: 1.55;
}

.summary-card {
  padding: 22px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(232, 239, 245, 0.7)),
    var(--paper);
  border: 1px solid rgba(16, 36, 59, 0.1);
  overflow: hidden;
}

.summary-note {
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(16, 36, 59, 0.04);
  border: 1px solid rgba(16, 36, 59, 0.08);
}

.summary-card h2 {
  margin-top: 10px;
  font-size: clamp(2rem, 3vw, 3.2rem);
}

.process-title {
  font-size: clamp(2rem, 3vw, 3rem) !important;
  line-height: 1;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.process-title-long {
  font-size: clamp(2rem, 3vw, 3rem) !important;
  line-height: 1;
}

.total,
.discount-hero {
  margin: 14px 0 0;
  font-family: "Manrope", "Inter", sans-serif;
  font-size: clamp(1.85rem, 3.2vw, 3.15rem);
  line-height: 1;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.total {
  color: var(--navy);
}

.discount-hero {
  color: var(--green);
}

.summary-caption,
.discount-copy,
.summary-note p,
.summary-note li {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 1rem;
}

.summary-note ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

.discount-law {
  display: inline-flex;
  margin-top: 12px;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.76rem;
  font-weight: 800;
}

.stat-list {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.65;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: #fffefb;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.results-caption {
  padding: 18px 18px 10px;
  text-align: left;
  caption-side: top;
  font-family: "Manrope", "Inter", sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--navy);
}

.results-table th,
.results-table td {
  padding: 15px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.results-table th:last-child,
.results-table td:last-child {
  width: 36%;
  text-align: right;
}

.results-table tfoot td {
  background: rgba(16, 36, 59, 0.04);
  border-bottom: 0;
  font-size: 1rem;
  font-weight: 800;
  padding-top: 18px;
  padding-bottom: 18px;
}

.results-table th {
  background: rgba(16, 36, 59, 0.05);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.value-cell {
  font-weight: 800;
  white-space: nowrap;
}

.value-cost {
  color: var(--red);
}

.value-saved {
  color: var(--green);
  font-size: 1.08rem;
}

.value-final {
  color: var(--navy);
  font-size: 1rem;
}

.legal-note {
  margin: 4px 0 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(16, 36, 59, 0.08);
  overflow: hidden;
}

.legal-note summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
}

.legal-note summary::-webkit-details-marker {
  display: none;
}

.legal-list,
.alerts-box ul {
  margin: 10px 0 0;
  padding: 0 18px 16px 34px;
  color: var(--muted);
  line-height: 1.55;
}

.stat-empty {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.faq-section {
  margin-top: 24px;
}

.faq-grid {
  display: grid;
  grid-template-columns: 1fr 460px;
  gap: 24px;
  align-items: stretch;
}

.faq-intro {
  margin-top: 12px;
}

.faq-intro h2 {
  font-size: clamp(1.8rem, 2.4vw, 2.6rem);
  max-width: none;
}

.faq-intro h2 span {
  display: inline;
  color: var(--gold);
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 22px;
}

.faq-item {
  border-radius: 20px;
  border: 1px solid rgba(16, 36, 59, 0.08);
  background: rgba(255, 255, 255, 0.96);
  overflow: hidden;
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 22px;
  color: var(--ink);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(211, 168, 95, 0.12);
  color: var(--gold);
  font-size: 1.25rem;
  font-weight: 700;
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item p {
  margin: 0;
  padding: 0 22px 20px;
  color: var(--muted);
  line-height: 1.65;
}

.faq-side {
  display: flex;
  align-items: stretch;
  height: 100%;
}

.faq-support {
  width: 100%;
  height: 100%;
  padding: 28px;
  border-radius: 28px;
  background: var(--navy);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.faq-support strong {
  display: block;
  margin-top: 8px;
  font-family: "Manrope", "Inter", sans-serif;
  font-size: clamp(1.7rem, 2.5vw, 2.2rem);
  line-height: 1.12;
  max-width: 12ch;
}

.faq-support p {
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.65;
}

.support-button {
  margin-top: 22px;
  background: linear-gradient(135deg, #d7b06d, #c89f59);
  color: var(--navy);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.18);
}

.cta-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(16, 36, 59, 0.52);
  z-index: 50;
}

.cta-modal[hidden] {
  display: none;
}

.cta-modal-card {
  position: relative;
  width: min(560px, 100%);
  padding: 28px;
  border-radius: 28px;
  background: var(--paper);
  box-shadow: 0 32px 60px rgba(16, 36, 59, 0.26);
}

.cta-modal-card h3 {
  margin-top: 10px;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  max-width: none;
}

.cta-modal-card p:not(.panel-title) {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.cta-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: rgba(16, 36, 59, 0.06);
  color: var(--navy);
  font-size: 1.6rem;
  cursor: pointer;
}

.cta-actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}

.cta-link,
.cta-print {
  flex: 1;
}

@keyframes rise-fade {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .faq-grid {
    grid-template-columns: 1fr;
  }

  .faq-support {
    width: 100%;
    max-width: 100%;
  }

  .report-meta {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-brand-layout {
    grid-template-columns: 1fr;
  }

  .hero-logo {
    margin: 0;
    max-width: 180px;
  }

  .hero-brand-visual {
    display: flex;
    justify-content: center;
  }

  .hero-brand-copy h1 {
    white-space: normal;
    font-size: clamp(1.6rem, 4vw, 2.4rem);
  }

  .faq-intro h2 {
    white-space: normal;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 16px, 1280px);
    padding-top: 16px;
    padding-bottom: max(56px, env(safe-area-inset-bottom, 56px));
  }

  .hero-copy {
    padding: 18px;
  }

  .panel {
    padding: 18px 18px 32px;
  }

  .field-grid,
  .action-row,
  .cta-actions {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .hero-brand-copy h1 {
    white-space: normal;
    font-size: clamp(1.4rem, 5vw, 2rem);
  }

  .faq-intro h2 {
    white-space: normal;
    font-size: clamp(1.4rem, 5vw, 2rem);
  }

  .report-meta {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .meta-item {
    padding: 10px 12px;
  }

  .process-title,
  .process-title-long {
    font-size: clamp(1.6rem, 6vw, 2.4rem) !important;
  }

  .total,
  .discount-hero {
    font-size: clamp(1.6rem, 7vw, 2.4rem) !important;
    white-space: normal;
  }

  .summary-card {
    padding: 18px;
  }

  .results-table th,
  .results-table td {
    padding: 12px 10px;
    font-size: 0.88rem;
  }

  .results-table th:last-child,
  .results-table td:last-child {
    width: 42%;
  }

  .cta-modal-card {
    padding: 22px 18px;
    border-radius: 20px;
  }

  .cta-modal-card h3 {
    font-size: clamp(1.4rem, 5vw, 2rem);
  }

  .lead-gate-card {
    padding: 22px 18px;
    border-radius: 20px;
  }

  .faq-support strong {
    font-size: clamp(1.4rem, 5vw, 1.8rem);
    max-width: none;
  }

  .support-button {
    text-align: center;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}

@media (max-width: 400px) {
  .report-meta {
    grid-template-columns: 1fr;
  }

  .page-shell {
    width: min(100% - 12px, 1280px);
  }

  .hero-copy {
    padding: 14px;
  }

  .panel {
    padding: 14px 14px 28px;
  }
}

@media print {
  body {
    background: white;
  }

  .page-shell {
    width: 100%;
    padding: 0;
  }

  .hero,
  .form-panel,
  .faq-section,
  .cta-modal,
  .legal-basis {
    display: none !important;
  }

  .layout {
    display: block;
  }

  .panel,
  .report-card,
  .summary-card,
  .table-wrap,
  .alerts-box,
  .legal-note {
    box-shadow: none;
    border: 1px solid #ddd;
    background: white;
  }

  .result-panel {
    padding: 0;
  }

  /* Cabeçalho do relatório compacto */
  .report-card {
    padding: 10px 14px;
  }

  .report-card h3 {
    font-size: 1.1rem;
    margin-top: 2px;
  }

  .report-header,
  .legal-basis {
    margin-bottom: 8px;
  }

  .summary-grid {
    margin-bottom: 8px;
  }

  /* Todos os 5 campos de metadados em uma única linha */
  .report-meta {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    margin-top: 8px;
  }

  .meta-item {
    padding: 6px 8px;
    border-radius: 8px;
  }

  .meta-item span {
    font-size: 0.62rem;
  }

  .meta-item strong {
    font-size: 0.78rem;
    margin-top: 2px;
  }

  /* Summary card mais enxuto */
  .summary-card {
    padding: 10px 14px;
  }

  .process-title,
  .process-title-long {
    font-size: 1.4rem !important;
    margin: 2px 0;
  }

  .total,
  .discount-hero {
    font-size: 1.8rem !important;
    margin: 4px 0 0;
  }

  .summary-caption {
    font-size: 0.75rem;
    margin-top: 2px;
  }

  /* Tabela de resultados mais compacta */
  .table-wrap {
    margin-top: 8px;
  }
}
