/* ============================================================
   A&7 · Reforma Tributária — HERO + FERRAMENTA (o protagonista)
   Inclui: hero com orbes animados · card do simulador · steps ·
   veredito · comparativo hoje × 2033 · linha do tempo interativa
   ============================================================ */

.hero {
  min-height: calc(100vh - var(--header-h));
  display: grid;
  align-items: center;
  overflow: hidden;
  padding: calc(var(--header-h) + 16px) 0 24px;
  background:
    radial-gradient(circle at 88% 10%, rgba(47,107,255,.18), transparent 34%),
    radial-gradient(circle at 10% 30%, rgba(21,195,160,.13), transparent 32%),
    linear-gradient(180deg, var(--hero-bg-1) 0%, var(--hero-bg-2) 100%);
}
/* Grade de fundo */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .35;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
}
/* Orbes flutuantes animados */
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .5;
  pointer-events: none;
  will-change: transform;
}
.hero-orb.orb-1 {
  width: 340px; height: 340px;
  top: -80px; right: -60px;
  background: radial-gradient(circle, rgba(47,107,255,.5), transparent 70%);
  animation: floatY 13s ease-in-out infinite;
}
.hero-orb.orb-2 {
  width: 280px; height: 280px;
  bottom: -60px; left: -80px;
  background: radial-gradient(circle, rgba(21,195,160,.42), transparent 70%);
  animation: floatY 17s ease-in-out infinite reverse;
}
.hero-orb.orb-3 {
  width: 200px; height: 200px;
  top: 30%; left: 44%;
  background: radial-gradient(circle, rgba(107,50,255,.32), transparent 70%);
  animation: drift 21s ease-in-out infinite alternate;
}
.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 44px;
  align-items: center;
}
.hero-copy { max-width: 620px; }
.hero-copy .display { max-width: 640px; }
.hero-copy .section-lead { max-width: 560px; margin-top: 14px; }

/* KPIs da hero */
.hero-kpis {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 16px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.hero-kpi-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hero-kpi-item .kpi-num {
  font-size: 1.15rem;
  font-weight: 850;
  letter-spacing: -.02em;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-kpi-item .kpi-label {
  font-size: .74rem;
  font-weight: 650;
  color: var(--muted);
  line-height: 1.3;
}

/* Selo de urgência (cronograma) */
.hero-urgency {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-size: .74rem;
  font-weight: 750;
  color: var(--badge-warn-ink);
  background: var(--badge-warn-bg);
  border: 1px solid rgba(255,176,46,.3);
  padding: 7px 13px;
  border-radius: 999px;
  animation: tickerIn .6s ease;
}
.hero-urgency .dot-warn {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 0 rgba(255,176,46,.55);
  animation: pulse 1.8s infinite;
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 18px;
}
.hero-trust span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  font-weight: 650;
  color: var(--muted);
}
.hero-trust span::before {
  content: "✓";
  display: grid; place-items: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  font-size: .55rem;
  color: #fff;
  background: linear-gradient(135deg, var(--teal), #0fa37f);
}

/* ---------- Card da ferramenta ---------- */
.tool-wrap { max-width: 540px; width: 100%; justify-self: center; }
.tool-card {
  position: relative;
  background: var(--tool-bg);
  border: 1px solid var(--tool-border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}
.tool-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--blue), var(--violet));
  background-size: 200% 100%;
  animation: shimmer 4s linear infinite;
}

.tool-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.tool-title { display: flex; align-items: center; gap: 9px; }
.tool-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 850;
  font-size: .96rem;
}
.tool-live .dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--teal);
  animation: pulse 1.8s infinite;
}
.tool-sub {
  font-size: .72rem;
  color: var(--muted);
  font-weight: 650;
}
.tool-badge {
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--blue);
  border: 1px solid var(--line-strong);
  padding: 4px 9px;
  border-radius: 999px;
}

/* ---- Formulário ---- */
.tool-form { display: grid; gap: 12px; width: 100%; box-sizing: border-box; }
.tool-field { display: grid; gap: 6px; min-width: 0; width: 100%; }
.tool-field-half { grid-column: 1 / -1; min-width: 0; }
.tool-label {
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.tool-input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: .95rem;
  letter-spacing: .02em;
  transition: border-color .25s ease, box-shadow .25s ease, transform .2s ease;
}
.tool-input::placeholder { color: var(--muted); }
.tool-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px var(--glow);
  transform: translateY(-1px);
}
.tool-input.error { border-color: var(--red); box-shadow: 0 0 0 4px rgba(255,84,112,.16); }

.tool-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
  padding-right: 42px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.tool-go { min-width: 100%; }

.tool-extra {
  display: grid;
  gap: 8px;
}
@media (min-width: 460px) {
  .tool-extra { grid-template-columns: 1fr 1fr; }
  .tool-field-half { grid-column: auto; }
  .tool-go { min-width: 100%; }
}

.tool-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.chip-label { font-size: .68rem; color: var(--muted); font-weight: 650; }
.chip {
  font-size: .68rem;
  font-weight: 700;
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 4px 9px;
  border-radius: 999px;
  transition: .22s ease;
}
.chip:hover { border-color: var(--blue); color: var(--blue); transform: translateY(-1px); }

/* ---- Status / steps animados ---- */
.tool-status {
  margin-top: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: grid;
  gap: 10px;
  overflow: hidden;
  position: relative;
}
.step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .88rem;
  font-weight: 650;
  color: var(--muted);
  opacity: .45;
  transition: .3s ease;
}
.step::before {
  content: "";
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  flex: none;
  transition: .3s ease;
}
.step.active { color: var(--ink); opacity: 1; }
.step.active::before {
  border-color: var(--blue);
  background: radial-gradient(circle, var(--blue) 0 45%, transparent 50%);
  animation: stepPop .4s ease;
}
.step.done { color: var(--teal); opacity: 1; }
.step.done::before {
  border-color: var(--teal);
  background: var(--teal);
  box-shadow: inset 0 0 0 3px var(--tool-bg);
}
.tool-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(47,107,255,.08) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
  pointer-events: none;
}

/* ---- Veredito ---- */
.rf-verdict {
  margin-top: 16px;
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: .92rem;
  line-height: 1.55;
  animation: rise .45s ease;
}
.rf-verdict .verdict-ico { font-size: 1.35rem; line-height: 1; }
.rf-verdict strong { display: block; margin-bottom: 2px; }
.rf-verdict.up { background: var(--badge-danger-bg); color: var(--badge-danger-ink); border: 1px solid rgba(255,84,112,.35); }
.rf-verdict.down { background: var(--badge-ok-bg); color: var(--badge-ok-ink); border: 1px solid rgba(21,195,160,.35); }
.rf-verdict.flat { background: var(--badge-info-bg); color: var(--badge-info-ink); border: 1px solid rgba(47,107,255,.35); }
html[data-theme="dark"] .rf-verdict.up { color: #ff7d92; }
html[data-theme="dark"] .rf-verdict.down { color: #4fe0ae; }
html[data-theme="dark"] .rf-verdict.flat { color: #7fa6ff; }
.rf-verdict .verdict-delta {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -.03em;
  margin-right: 6px;
}

/* ---- Comparativo hoje × 2033 ---- */
.rf-compare {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
.rf-compare .cmp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.rf-compare .cmp-head .cmp-title {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.rf-compare .cmp-head .cmp-vs {
  font-size: .7rem;
  font-weight: 850;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
}
.cmp-cards {
  display: grid;
  gap: 12px;
}
.cmp-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  padding: 16px;
  background: var(--surface-2);
  overflow: hidden;
}
.cmp-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
}
.cmp-card.today::after { background: linear-gradient(90deg, var(--blue), var(--violet)); }
.cmp-card.future::after { background: linear-gradient(90deg, var(--amber), var(--red)); }
.cmp-card.future.good::after { background: linear-gradient(90deg, var(--teal), var(--green)); }
.cmp-tag {
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.cmp-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -.03em;
  margin: 6px 0 2px;
}
.cmp-pct { font-size: .78rem; font-weight: 700; color: var(--muted); }
.cmp-bar {
  height: 8px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
  margin-top: 12px;
}
.cmp-bar span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--blue), var(--violet));
  transition: width 1s cubic-bezier(.2,.7,.3,1);
}
.cmp-card.future .cmp-bar span { background: linear-gradient(90deg, var(--amber), var(--red)); }
.cmp-card.future.good .cmp-bar span { background: linear-gradient(90deg, var(--teal), var(--green)); }

/* ---- Linha do tempo 2026→2033 ---- */
.rf-timeline {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 16px;
  animation: rise .45s ease;
}
.tl-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.tl-title { font-size: 1.02rem; font-weight: 850; letter-spacing: -.01em; }
.tl-sub { font-size: .72rem; color: var(--muted); font-weight: 650; }

.tl-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 190px;
}
.tl-col {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 0 2px 0;
  border-radius: 12px;
  transition: .25s ease;
}
.tl-col:hover .tl-fill { filter: brightness(1.15); }
.tl-alq {
  font-size: .62rem;
  font-weight: 800;
  color: var(--muted);
  white-space: nowrap;
}
.tl-col.active .tl-alq { color: var(--blue); }
.tl-bar {
  width: 100%;
  max-width: 38px;
  height: 120px;
  display: flex;
  align-items: flex-end;
  border-radius: 99px 99px 8px 8px;
  background: var(--surface-2);
  overflow: hidden;
}
.tl-fill {
  display: block;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(180deg, var(--blue), var(--violet));
  transform-origin: bottom;
  animation: barGrow .9s cubic-bezier(.2,.7,.3,1) both;
  transition: filter .2s ease, background .3s ease;
  min-height: 2px;
}
.tl-col.active .tl-fill {
  background: linear-gradient(180deg, var(--amber), var(--red));
}
.tl-col.final .tl-fill {
  background: linear-gradient(180deg, var(--teal), var(--green));
}
.tl-year {
  font-size: .72rem;
  font-weight: 850;
  color: var(--ink);
}
.tl-col.active .tl-year { color: var(--blue); }
.tl-fase {
  font-size: .58rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .02em;
  text-align: center;
  line-height: 1.15;
}

/* ---- Detalhe do ano selecionado ---- */
.tl-detail {
  margin-top: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-xs);
  padding: 14px 16px;
  background: var(--surface-2);
  animation: rise .3s ease;
}
.tl-detail .td-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.td-year { font-size: 1.15rem; font-weight: 900; letter-spacing: -.02em; }
.td-fase {
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--badge-info-ink);
  background: var(--badge-info-bg);
  padding: 4px 10px;
  border-radius: 999px;
}
.td-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 14px;
  font-size: .8rem;
}
.td-grid dt { color: var(--muted); font-weight: 650; }
.td-grid dd { margin: 0; font-weight: 800; }
.td-grid dd.hl { color: var(--blue); }
html[data-theme="dark"] .td-grid dd.hl { color: #7fa6ff; }
.td-note {
  margin-top: 10px;
  font-size: .74rem;
  color: var(--muted);
  font-weight: 650;
  line-height: 1.5;
  border-top: 1px solid var(--line);
  padding-top: 9px;
}

/* ---- Resultado container ---- */
.tool-result {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 18px;
  animation: rise .45s ease;
}
.result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.result-status {
  display: inline-block;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.result-status.ok { background: var(--badge-ok-bg); color: var(--badge-ok-ink); }
.result-status.warn { background: var(--badge-warn-bg); color: var(--badge-warn-ink); }
.result-status.danger { background: var(--badge-danger-bg); color: var(--badge-danger-ink); }
.result-name { font-size: 1.18rem; letter-spacing: -.02em; line-height: 1.2; }
.result-meta { font-size: .8rem; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.code-link {
  flex: none;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: .78rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: .2s ease;
}
.code-link:hover { color: var(--violet); }

.result-source {
  margin-top: 12px;
  font-size: .74rem;
  color: var(--teal);
  font-weight: 700;
}
html[data-theme="dark"] .result-source { color: #4fe0ae; }

/* ---- Erro ---- */
.tool-error {
  margin-top: 14px;
  border: 1px solid var(--badge-danger-bg);
  background: var(--badge-danger-bg);
  color: var(--badge-danger-ink);
  border-radius: var(--radius-xs);
  padding: 13px 15px;
  font-size: .86rem;
  font-weight: 650;
  animation: rise .4s ease;
}

/* ---- Nota de honestidade ---- */
.tool-limit {
  margin-top: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .74rem;
  color: var(--muted);
  font-weight: 650;
  line-height: 1.5;
}
.tool-limit .limited { color: var(--amber); font-weight: 800; }

/* ---------- Responsivo hero ---------- */
@media (max-width: 400px) {
  .tool-card { padding: 18px; }
  .td-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .tl-chart { height: 170px; }
  .tl-bar { height: 100px; }
}

@media (min-width: 980px) {
  .hero {
    min-height: 100vh;
    height: 100vh;
    padding: calc(var(--header-h) + 12px) 0 20px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }
  .hero-grid {
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    gap: 36px;
    align-items: center;
    justify-items: center;
    max-width: 1080px;
    width: 100%;
    margin-inline: auto;
  }
  .hero-copy {
    max-width: 480px;
    text-align: left;
    position: relative;
    top: 0;
  }
  .hero-copy .display {
    font-size: clamp(1.7rem, 2.3vw, 2.25rem);
    line-height: 1.12;
    max-width: 480px;
  }
  .hero-copy .section-lead {
    font-size: clamp(.85rem, 1vw, .95rem);
    margin-top: 10px;
    max-width: 460px;
  }
  .hero-kpis {
    margin-top: 18px;
    padding-top: 16px;
    gap: 10px 14px;
  }
  .hero-kpi-item .kpi-num {
    font-size: 1.08rem;
  }
  .hero-kpi-item .kpi-label {
    font-size: .7rem;
  }
  .tool-wrap {
    justify-self: center;
    max-width: 520px;
    width: 100%;
  }
  .tool-card {
    padding: 18px 20px;
    max-height: calc(100vh - var(--header-h) - 36px);
    overflow-y: auto;
  }
  .tool-card::-webkit-scrollbar {
    width: 6px;
  }
  .tool-card::-webkit-scrollbar-track {
    background: transparent;
  }
  .tool-card::-webkit-scrollbar-thumb {
    background: var(--line-strong);
    border-radius: 999px;
  }
  .tool-extra-reforma {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .tool-field { gap: 6px; }
  .tool-label {
    font-size: .68rem;
    white-space: normal;
  }
  .tool-input {
    min-height: 42px;
    padding: 0 14px;
    font-size: .9rem;
  }
  .tool-go {
    min-height: 46px;
    font-size: .95rem;
  }
  .cmp-cards { grid-template-columns: 1fr 1fr; }
}
