/* ============================================================
   AVB Saúde — Diagnóstico Empresarial
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-soft: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5fafd;
  --surface-3: #e8f4fb;
  --border: #dceaf4;
  --border-strong: #bcd9ea;
  --texto: #12212b;
  --texto-claro: #4d6472;
  --texto-mute: #7d94a1;

  --accent: #0369a1;
  --accent-2: #38bdf8;
  --accent-deep: #075985;
  --accent-soft: rgba(3, 105, 161, 0.08);
  --accent-glow: rgba(56, 189, 248, 0.22);
  --accent-contrast: #ffffff;

  /* Cabeçalho escuro — alinhado ao site avb-saude.netlify.app.
     O corpo segue claro; a inversão vive só na topbar. */
  --void: #03080f;
  --navy: #071628;
  --azure: #3d9bef;
  --azure-glow: #8fcbff;
  --nav-fg: #ffffff;
  --nav-fg-soft: rgba(255, 255, 255, 0.68);
  --nav-rule: rgba(255, 255, 255, 0.16);

  /* Altura da topbar — valor inicial; o app remede e sobrescreve em runtime
     (ver syncTopbarHeight em app.js) */
  --topbar-h: 83px;

  --sucesso: #15803d;
  --alerta: #b45309;
  --erro: #b91c1c;
  --info: #1d4ed8;

  --sombra: 0 1px 2px rgba(28,28,34,0.04), 0 6px 18px rgba(28,28,34,0.08);
  --sombra-lg: 0 4px 14px rgba(28,28,34,0.06), 0 24px 60px rgba(28,28,34,0.14);

  --radius: 12px;
  --radius-lg: 16px;

  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--texto);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(56,189,248,0.10), transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(3,105,161,0.05), transparent 70%),
    var(--bg);
  min-height: 100vh;
}

h1, h2, h3, h4 { margin: 0; color: var(--texto); font-weight: 600; }

/* ===== TOPBAR ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 40px;
  background: rgba(3, 8, 15, 0.94);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--nav-rule);
  color: var(--nav-fg);
}
/* Fio azure na base, como no site */
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--azure), transparent);
  opacity: 0.55;
  pointer-events: none;
}

.brand { display: flex; align-items: center; }

/* Marca: ícone + lockup vertical "AVB / SAÚDE", como no site.
   A cor vem por herança, então o mesmo markup serve no cabeçalho
   escuro e no relatório claro. */
.logo-mark {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  font-family: var(--sans);
  color: currentColor;
  line-height: 1;
  user-select: none;
}
.logo-icon {
  width: 46px;
  height: 46px;
  flex: none;
}
.logo-lock {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-start;
}
.logo-mark .logo-title {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.logo-mark .logo-sub {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.38em;
  /* o tracking sobra à direita da última letra; recolhe para alinhar com o "A" */
  margin-right: -0.38em;
}

/* No cabeçalho escuro a marca é branca — o azure fica na página, não na marca */
.topbar .logo-mark { color: var(--nav-fg); }

/* No relatório (fundo branco) a marca inverte para tinta escura */
.logo-mark--report { color: var(--texto); gap: 16px; }
.logo-mark--report .logo-icon { width: 54px; height: 54px; }
.logo-mark--report .logo-title { font-size: 32px; }
.logo-mark--report .logo-sub { font-size: 12px; color: var(--accent); }

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.topbar-nav .nav-label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.30em;
  color: var(--nav-fg-soft);
  text-transform: uppercase;
}
.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--nav-rule);
  color: var(--nav-fg-soft);
  padding: 9px 16px;
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
  text-transform: uppercase;
}
.nav-btn:hover {
  color: var(--nav-fg);
  border-color: var(--azure-glow);
  background: rgba(61, 155, 239, 0.14);
}
.nav-btn:focus-visible {
  outline: 2px solid var(--azure-glow);
  outline-offset: 3px;
}
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  background: var(--azure);
  color: #02121f;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  padding: 0 6px;
  letter-spacing: 0;
}

/* ===== HERO ===== */
.hero {
  min-height: calc(100vh - 73px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 32px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 1000px;
  height: 1000px;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 50%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  text-align: center;
  max-width: 820px;
  animation: fadeUp 0.8s ease;
}

.hero-eyebrow {
  display: inline-block;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.4em;
  color: var(--accent);
  text-transform: uppercase;
  padding: 6px 14px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  margin-bottom: 28px;
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(48px, 7vw, 84px);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  padding: 0.08em 0.04em 0.12em;
  background: linear-gradient(180deg, #1c1c22 0%, #5b5b67 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 17px;
  color: var(--texto-claro);
  max-width: 620px;
  margin: 0 auto 40px;
  line-height: 1.65;
}
.hero-subtitle strong {
  color: var(--accent);
  font-weight: 500;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}
.stat { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.stat-num {
  font-family: var(--sans);
  font-size: 46px;
  color: var(--accent-deep);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--texto-claro);
  text-transform: uppercase;
}

/* ===== BUTTONS ===== */
.btn-primary, .btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.04em;
  padding: 12px 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: var(--accent-contrast);
  box-shadow: 0 4px 16px var(--accent-glow);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px var(--accent-glow);
}
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.btn-ghost {
  background: transparent;
  color: var(--texto-claro);
  border-color: var(--border-strong);
}
.btn-ghost:hover {
  color: var(--texto);
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ===== CONTAINER ===== */
.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 48px 32px 80px;
  animation: fadeUp 0.5s ease;
}

/* ===== CARD ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  margin-bottom: 24px;
  box-shadow: var(--sombra);
}

.section-title {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.section-desc {
  color: var(--texto-claro);
  font-size: 14px;
  margin: 0 0 28px;
}

/* ===== IDENTIFICATION FORM ===== */
.id-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--texto-mute);
  text-transform: uppercase;
  font-weight: 500;
}
.field input {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--texto);
  padding: 12px 14px;
  font-family: var(--sans);
  font-size: 14px;
  transition: all 0.2s;
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-req {
  font-style: normal;
  color: #b91c1c;
  font-weight: 700;
}
.field-optional {
  font-style: normal;
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--texto-mute);
  opacity: 0.75;
}

/* ===== CONSENTIMENTO (LGPD) ===== */
.consent {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 24px;
  padding: 15px 17px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--texto-claro);
  cursor: pointer;
}
.consent input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 19px;
  height: 19px;
  margin: 1px 0 0;
  flex: none;
  border: 1.5px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface);
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: all 0.18s ease;
}
.consent input[type="checkbox"]:hover { border-color: var(--accent); }
.consent input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.consent input[type="checkbox"]::after {
  content: "";
  width: 10px;
  height: 5px;
  border-left: 2px solid var(--accent-contrast);
  border-bottom: 2px solid var(--accent-contrast);
  transform: rotate(-45deg) translateY(-1px) scale(0);
  transition: transform 0.18s ease;
}
.consent input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.consent input[type="checkbox"]:checked::after { transform: rotate(-45deg) translateY(-1px) scale(1); }
.consent a { color: var(--accent); text-decoration: underline; }

/* Origem do lead no histórico */
.history-meta-item--origem { color: var(--accent); font-weight: 500; }
.history-meta-item--conheceu { color: var(--accent-deep); font-weight: 500; }

/* Select dentro do formulário — mesmo desenho dos inputs */
.field-select {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--texto);
  padding: 12px 14px;
  font-family: var(--sans);
  font-size: 14px;
  transition: all 0.2s;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%230369a1' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 38px;
}
.field-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ===== ERRO DE ENVIO ===== */
.submit-error {
  margin: 0 0 20px;
  padding: 16px 20px;
  border: 1px solid #f0b4b4;
  border-left: 4px solid #b91c1c;
  border-radius: 8px;
  background: #fdf2f2;
  color: #8c1616;
  font-size: 14px;
  line-height: 1.6;
}

/* ===== EXCLUSÃO EM LOTE ===== */
.compare-bar--danger {
  border-color: #f0b4b4;
  background: #fdf2f2;
}
.btn-danger-solid {
  background: #b91c1c !important;
  border-color: #b91c1c !important;
  color: #fff !important;
}
.btn-danger-solid:hover:not(:disabled) {
  background: #991b1b !important;
  border-color: #991b1b !important;
}
.history-card.delete-selectable:hover {
  border-color: #d98a8a;
}
.history-card.delete-selected {
  border-color: #b91c1c;
  background: #fdf2f2;
}
.history-card.delete-selected .compare-check {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}

/* ===== THANK YOU (respondente) ===== */
.thanks-card {
  max-width: 620px;
  margin: 72px auto;
  padding: 56px 48px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--sombra-lg);
}
.thanks-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin-bottom: 24px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--accent);
}
.thanks-eyebrow {
  display: block;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
}
.thanks-title {
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 18px;
}
.thanks-text {
  font-size: 15px;
  line-height: 1.7;
  color: var(--texto-claro);
  margin: 0 auto 20px;
  max-width: 460px;
}
.thanks-note {
  font-size: 13px;
  color: var(--texto-mute);
  margin: 0 0 32px;
}

@media (max-width: 560px) {
  .thanks-card { margin: 40px 16px; padding: 40px 24px; }
  .thanks-title { font-size: 30px; }
}

/* ===== PROGRESS ===== */
.progress-wrap {
  position: sticky;
  top: var(--topbar-h);
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  padding: 16px 0;
  margin: 0 -32px 24px;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--texto-claro);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.progress-meta span:last-child { color: var(--accent); font-weight: 600; }
.progress-bar {
  height: 4px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* ===== AREA SECTION ===== */
.area-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  margin-bottom: 24px;
  box-shadow: var(--sombra);
}

.area-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}
.area-num {
  font-family: var(--serif);
  font-size: 36px;
  color: var(--accent);
  font-weight: 500;
  line-height: 1;
  min-width: 50px;
}
.area-title {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
  margin-bottom: 4px;
}
.area-subtitle {
  color: var(--texto-claro);
  font-size: 14px;
  margin: 0;
}

/* ===== QUESTION ===== */
.question {
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}
.question:last-child { border-bottom: none; padding-bottom: 0; }
.question-text {
  display: flex;
  gap: 14px;
  margin-bottom: 16px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--texto);
}
.q-index {
  flex-shrink: 0;
  color: var(--accent);
  font-family: var(--serif);
  font-weight: 600;
  min-width: 26px;
}

.scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-left: 40px;
}
@media (max-width: 600px) {
  .scale { margin-left: 0; }
}

.scale-option {
  position: relative;
  cursor: pointer;
}
.scale-option input { position: absolute; opacity: 0; pointer-events: none; }
.scale-option .pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 4px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: all 0.2s;
  text-align: center;
  min-height: 64px;
}
.scale-option .pill-num {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--texto);
  line-height: 1;
  margin-bottom: 4px;
}
.scale-option .pill-label {
  font-size: 10px;
  color: var(--texto-mute);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.scale-option:hover .pill {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.scale-option input:checked + .pill {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  border-color: var(--accent);
  box-shadow: 0 4px 12px var(--accent-glow);
}
.scale-option input:checked + .pill .pill-num,
.scale-option input:checked + .pill .pill-label {
  color: var(--accent-contrast);
  font-weight: 600;
}

/* ===== FORM ACTIONS ===== */
.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 32px;
}

/* ===== RESULTS / REPORT ===== */
.report-header {
  text-align: center;
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.report-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}
.report-meta {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.report-eyebrow {
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--accent);
  text-transform: uppercase;
}
.report-date {
  font-size: 12px;
  color: var(--texto-mute);
}

.report-title {
  font-family: var(--serif);
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 500;
  line-height: 1.2;
  padding: 0.05em 0;
  margin-bottom: 8px;
}
.report-company {
  color: var(--texto-claro);
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ===== OVERALL SCORE ===== */
.score-card { padding: 48px 36px; }
.overall-score {
  display: flex;
  align-items: center;
  gap: 48px;
  flex-wrap: wrap;
  justify-content: center;
}

.score-ring {
  position: relative;
  width: 200px;
  height: 200px;
}
.ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.ring-bg, .ring-fg {
  fill: none;
  stroke-width: 8;
}
.ring-bg { stroke: var(--surface-2); }
.ring-fg {
  stroke: url(#ringGrad);
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

.ring-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.ring-num {
  font-family: var(--serif);
  font-size: 56px;
  color: var(--accent);
  font-weight: 500;
  line-height: 1;
  display: block;
}
.ring-base {
  font-size: 14px;
  color: var(--texto-mute);
  letter-spacing: 0.06em;
}

.overall-info {
  flex: 1;
  min-width: 240px;
}
.overall-label {
  font-size: 11px;
  letter-spacing: 0.32em;
  color: var(--texto-mute);
  text-transform: uppercase;
  margin-bottom: 8px;
  display: block;
}
.overall-status {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 500;
  margin-bottom: 12px;
  color: var(--accent);
}
.overall-desc {
  font-size: 15px;
  color: var(--texto-claro);
  line-height: 1.65;
  margin: 0;
}

/* ===== AREA GRID ===== */
.area-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 640px) {
  .area-grid { grid-template-columns: 1fr; }
}
.area-tile {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s;
}
.area-tile:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.area-tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.area-tile-name {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
}
.area-tile-score {
  font-family: var(--serif);
  font-size: 24px;
  color: var(--accent);
  font-weight: 600;
}
.area-tile-bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}
.area-tile-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
  border-radius: 999px;
  transition: width 1s ease;
}
.area-tile-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--texto-claro);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.status-dot.critico   { background: #dc2626; }
.status-dot.fragil    { background: #ea580c; }
.status-dot.moderado  { background: #d97706; }
.status-dot.saudavel  { background: #16a34a; }
.status-dot.excelente { background: #0891b2; }

/* ===== INSIGHTS ===== */
.insights-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 6px;
}
.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
}

.insight-block {
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}
.insight-block:last-child { border-bottom: none; }
.insight-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.insight-area-name {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--texto);
}
.insight-badge {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
}
.insight-badge.critico   { background: rgba(220,38,38,0.10);  color: #b91c1c; }
.insight-badge.fragil    { background: rgba(234,88,12,0.10);  color: #c2410c; }
.insight-badge.moderado  { background: rgba(217,119,6,0.10);  color: #b45309; }
.insight-badge.saudavel  { background: rgba(22,163,74,0.10);  color: #15803d; }
.insight-badge.excelente { background: rgba(8,145,178,0.10);  color: #0e7490; }
.insight-text {
  color: var(--texto-claro);
  font-size: 15px;
  line-height: 1.7;
  margin: 0;
}

/* ===== EXECUTIVE SUMMARY ===== */
.exec-summary {
  background: linear-gradient(135deg, rgba(212,175,90,0.08) 0%, rgba(212,175,90,0.02) 100%);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 24px 28px;
  margin-bottom: 28px;
}
.exec-head { margin-bottom: 14px; }
.exec-eyebrow {
  display: block;
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 8px;
  font-weight: 500;
}
.exec-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--texto);
}
.cross-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cross-list li {
  position: relative;
  padding: 10px 0 10px 18px;
  color: var(--texto-claro);
  font-size: 14.5px;
  line-height: 1.65;
  border-left: 2px solid var(--accent);
}

/* ===== INSIGHT BLOCK RICH ===== */
.insight-block--rich { padding: 28px 0; }

.insight-section {
  margin-top: 18px;
}
.insight-section:first-of-type { margin-top: 14px; }

.insight-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--accent);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 8px;
}
.insight-label--alert { color: #fca5a5; }
.insight-label--good  { color: #6ee7b7; }

.obs-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.obs-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.obs-item.obs-weak   { border-left: 3px solid #f87171; }
.obs-item.obs-strong { border-left: 3px solid #34d399; }
.obs-value {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  min-width: 30px;
  text-align: center;
}
.obs-item.obs-weak   .obs-value { color: #f87171; }
.obs-item.obs-strong .obs-value { color: #34d399; }
.obs-text {
  font-size: 14px;
  color: var(--texto);
  line-height: 1.5;
  margin-bottom: 4px;
}
.obs-hint {
  font-size: 13px;
  color: var(--texto-claro);
  line-height: 1.55;
}

/* ===== PRIORITY LIST ===== */
.priority-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.priority-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.priority-item:last-child { border-bottom: none; }
.priority-rank {
  font-family: var(--serif);
  font-size: 28px;
  color: var(--accent);
  font-weight: 500;
  min-width: 36px;
}
.priority-content { flex: 1; }
.priority-area {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.priority-text {
  color: var(--texto);
  font-size: 14px;
  line-height: 1.5;
}
.priority-score {
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 6px 12px;
  font-family: var(--serif);
  font-size: 20px;
  color: var(--accent);
  font-weight: 600;
}

/* ===== FOOTER ===== */
.report-footer {
  text-align: center;
  padding: 40px 0 24px;
  margin-top: 24px;
}
.footer-line {
  width: 60px;
  height: 1px;
  background: var(--accent);
  margin: 0 auto 20px;
}
.report-footer p {
  color: var(--texto-claro);
  font-size: 14px;
  max-width: 560px;
  margin: 0 auto 16px;
  line-height: 1.65;
}
.report-footer strong { color: var(--accent); font-weight: 500; }
.footer-mark {
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--texto-mute);
  text-transform: uppercase;
}

/* ===== RESULT ACTIONS ===== */
.result-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 32px;
  flex-wrap: wrap;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  :root { --topbar-h: 63px; }
  .topbar { padding: 12px 20px; }
  .logo-mark { gap: 11px; }
  .logo-icon { width: 38px; height: 38px; }
  .logo-mark .logo-title { font-size: 22px; }
  .logo-mark .logo-sub { font-size: 9.5px; letter-spacing: 0.28em; margin-right: -0.28em; }
  .topbar-nav .nav-label { display: none; }
  .container { padding: 32px 16px 60px; }
  .card, .area-section { padding: 24px 20px; }
  .id-grid { grid-template-columns: 1fr; }
  .hero { padding: 60px 20px; }
  .hero-stats { gap: 28px; }
  .scale { gap: 6px; }
  .scale-option .pill { min-height: 56px; padding: 8px 2px; }
  .scale-option .pill-num { font-size: 18px; }
  .scale-option .pill-label { font-size: 9px; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions button { width: 100%; justify-content: center; }
  .overall-score { flex-direction: column; text-align: center; gap: 28px; }
  .report-brand { flex-direction: column; gap: 16px; }
  .report-meta { text-align: center; }
}

/* ===== HISTORY ===== */
.history-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  gap: 24px;
  flex-wrap: wrap;
}
.history-actions {
  display: flex;
  gap: 10px;
}
.btn-danger {
  color: #b91c1c;
  border-color: rgba(185,28,28,0.30);
}
.btn-danger:hover {
  color: #991b1b;
  border-color: #b91c1c;
  background: rgba(185,28,28,0.06);
}

.history-card {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 12px;
  transition: all 0.2s;
}
.history-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--sombra);
}

.history-score {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 2px solid var(--accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  position: relative;
}
.history-score-num {
  font-size: 22px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
}
.history-score-base {
  font-size: 9px;
  color: var(--texto-mute);
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.history-info { min-width: 0; }
.history-company {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  color: var(--texto);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-meta {
  display: flex;
  /* Com origem declarada + UTM, são até 6 chips numa coluna estreita.
     Espaçamento apertado mantém o card em 2 linhas em vez de 3. */
  gap: 7px 13px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--texto-claro);
}
.history-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.history-meta-item svg {
  flex-shrink: 0;
  color: var(--accent);
}

.history-status {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
}
.history-status.critico   { background: rgba(220,38,38,0.10); color: #b91c1c; }
.history-status.fragil    { background: rgba(234,88,12,0.10); color: #c2410c; }
.history-status.moderado  { background: rgba(217,119,6,0.10); color: #b45309; }
.history-status.saudavel  { background: rgba(22,163,74,0.10); color: #15803d; }
.history-status.excelente { background: rgba(8,145,178,0.10); color: #0e7490; }

.history-card-actions {
  display: flex;
  gap: 6px;
}
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--texto-claro);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.icon-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.icon-btn.icon-btn--danger:hover {
  color: #b91c1c;
  border-color: #b91c1c;
  background: rgba(185,28,28,0.06);
}

/* Chamar o lead no WhatsApp — é o botão de ação mais usada, então
   nasce já colorido em vez de esperar o hover. */
.icon-btn--wa {
  color: #0f7a52;
  border-color: #9dd4b9;
  background: #eefaf3;
  text-decoration: none;
}
.icon-btn--wa:hover {
  color: #fff;
  border-color: #0f7a52;
  background: #0f7a52;
}
.icon-btn--wa:focus-visible {
  outline: 2px solid #0f7a52;
  outline-offset: 2px;
}
/* Em modo de seleção o clique não navega — o cursor precisa dizer isso */
.history-card.compare-selectable .icon-btn--wa { cursor: default; opacity: 0.5; }

.history-empty {
  text-align: center;
  padding: 80px 24px;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: 16px;
}
.history-empty-icon {
  color: var(--texto-mute);
  margin-bottom: 20px;
}
.history-empty h3 {
  font-family: var(--serif);
  font-size: 24px;
  color: var(--texto);
  margin-bottom: 8px;
}
.history-empty p {
  color: var(--texto-claro);
  margin-bottom: 24px;
}

@media (max-width: 640px) {
  .history-card {
    grid-template-columns: auto 1fr;
    grid-template-areas: "score info" "status status" "actions actions";
    gap: 14px;
  }
  .history-score { grid-area: score; }
  .history-info { grid-area: info; }
  .history-status { grid-area: status; justify-self: start; }
  .history-card-actions { grid-area: actions; justify-self: end; }
}

/* ===== AUTH MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 28, 34, 0.45);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--sombra-lg);
  animation: modalUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
}
@keyframes modalUp {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.modal-title {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  margin-bottom: 8px;
}
.modal-desc {
  color: var(--texto-claro);
  font-size: 14px;
  margin: 0 0 24px;
  line-height: 1.6;
}
.modal-form {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-error {
  background: rgba(185, 28, 28, 0.08);
  border: 1px solid rgba(185, 28, 28, 0.25);
  color: #b91c1c;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  text-align: center;
}
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.modal-actions button { flex: 1; justify-content: center; }
.modal-hint {
  margin-top: 18px;
  font-size: 12px;
  color: var(--texto-mute);
  line-height: 1.5;
}

/* ===== LOGOUT BUTTON ===== */
.nav-btn--ghost {
  border-color: transparent;
  color: var(--texto-mute);
}
.nav-btn--ghost:hover {
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.30);
  background: rgba(185, 28, 28, 0.05);
}

/* ===== FILTERS ===== */
/* Flex, não grid: o filtro de campanha só aparece quando existe lead com
   origem, e numa grade de colunas fixas o item oculto desalinhava todo o
   resto — a busca encolhia e os botões caíam em colunas rígidas. */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
/* Base pequena e crescimento livre: a busca ocupa a sobra, e o conjunto
   cabe numa linha até ~1200px. Abaixo disso, os botões descem juntos
   alinhados à direita, o que continua parecendo intencional. */
.filters .filter-search { flex: 1 1 120px; min-width: 140px; }
.filters .filter-select { flex: 0 1 150px; min-width: 126px; }
/* Empurra o par de botões para a direita, sem depender de coluna fixa */
.filters #btnCompareMode { margin-left: auto; }
.filters .btn-compare { flex: 0 0 auto; }
.filter-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--texto-mute);
}
.filter-search input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--texto);
  font-family: var(--sans);
  font-size: 14px;
  padding: 10px 0;
  outline: none;
}
.filter-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.filter-select {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--texto);
  font-family: var(--sans);
  font-size: 13px;
  padding: 10px 12px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
}
.filter-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.btn-compare {
  white-space: nowrap;
}
@media (max-width: 768px) {
  .filters { flex-direction: column; align-items: stretch; }
  .filters #btnCompareMode { margin-left: 0; }
  .filters .btn-compare { justify-content: center; }
}

/* ===== COMPARE BAR ===== */
.compare-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(212,175,90,0.08) 0%, rgba(212,175,90,0.02) 100%);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 14px 20px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.compare-msg {
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.compare-actions { display: flex; gap: 10px; }

/* History card in compare mode */
.history-card.compare-selectable { cursor: pointer; }
.history-card.compare-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.compare-check {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: all 0.2s;
}
.history-card.compare-selected .compare-check {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}
.history-card { position: relative; }

/* ===== COMPARE VIEW ===== */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
.compare-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}
.compare-col-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.compare-col-date {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--accent);
  text-transform: uppercase;
}
.compare-col-company {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  color: var(--texto);
}
.compare-overall {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.compare-overall-num {
  font-family: var(--serif);
  font-size: 48px;
  color: var(--accent);
  font-weight: 500;
  line-height: 1;
}
.compare-overall-label {
  font-size: 12px;
  color: var(--texto-claro);
  letter-spacing: 0.06em;
}
.compare-area-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.compare-area-row:last-child { border-bottom: none; }
.compare-area-name {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--texto);
}
.compare-area-score {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
  min-width: 36px;
  text-align: right;
}
.compare-area-delta {
  font-size: 12px;
  font-weight: 600;
  min-width: 52px;
  text-align: right;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  justify-content: center;
}
.compare-area-delta.up   { background: rgba(22,163,74,0.10);  color: #15803d; }
.compare-area-delta.down { background: rgba(185,28,28,0.10);  color: #b91c1c; }
.compare-area-delta.eq   { background: var(--surface-2);      color: var(--texto-mute); }

.compare-summary-card {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 28px;
  margin-bottom: 20px;
}
.compare-summary-num {
  font-family: var(--serif);
  font-size: 56px;
  font-weight: 500;
  line-height: 1;
  margin-bottom: 6px;
}
.compare-summary-num.up   { color: #15803d; }
.compare-summary-num.down { color: #b91c1c; }
.compare-summary-num.eq   { color: var(--texto-mute); }
.compare-summary-label {
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--texto-claro);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.compare-summary-text {
  color: var(--texto-claro);
  font-size: 14.5px;
  line-height: 1.65;
}

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

/* ===== PRINT / PDF ===== */
@media print {
  body { background: white; color: black; }
  .topbar, .form-actions, .result-actions, .progress-wrap { display: none !important; }
  .card, .area-section, .report-header { box-shadow: none; border-color: #e0e0e0; }
}
