/* ==========================================================================
   contaBolsa - estilos exclusivos da home
   Depende de site.css (tokens, tipografia, componentes).
   ========================================================================== */

/* --- Hero ---------------------------------------------------------------- */

.hero {
  position: relative;
  padding-block: clamp(3rem, 6vw, 5.5rem) clamp(3.5rem, 7vw, 6rem);
  overflow: hidden;
}

/* Malha discreta ao fundo: sugere papel quadriculado de apuracao. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.5;
  mask-image: radial-gradient(120% 90% at 70% 0%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(120% 90% at 70% 0%, #000 0%, transparent 72%);
  pointer-events: none;
}

.hero-grade {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero-texto h1 {
  margin-bottom: 1.1rem;
}

.hero-selo {
  margin-top: 1.75rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--slate-light);
}

@media (max-width: 900px) {
  .hero-grade {
    grid-template-columns: 1fr;
  }
}

/* --- Pipeline ------------------------------------------------------------ */

.pipeline {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--raio-g);
  box-shadow: var(--sombra-alta);
  padding: 1.5rem;
}

.pipeline-cabeca {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate-light);
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.1rem;
}

.pipeline-ponto {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-bright);
  box-shadow: 0 0 0 0 rgba(53, 210, 164, 0.55);
  animation: pulsar 2.1s ease-out infinite;
}

@keyframes pulsar {
  0% {
    box-shadow: 0 0 0 0 rgba(53, 210, 164, 0.55);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(53, 210, 164, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(53, 210, 164, 0);
  }
}

.pipeline-trilha {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.pipe-estagio {
  position: relative;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  background: var(--paper);
  opacity: 0.5;
  transition: opacity 420ms ease, border-color 420ms ease, background 420ms ease,
    transform 420ms ease;
}

.pipe-rotulo {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate-light);
  margin-bottom: 0.6rem;
}

/* Estagio aceso */
.pipeline[data-ativo="0"] .pipe-estagio[data-estagio="0"],
.pipeline[data-ativo="1"] .pipe-estagio[data-estagio="1"],
.pipeline[data-ativo="2"] .pipe-estagio[data-estagio="2"],
.pipeline[data-ativo="3"] .pipe-estagio[data-estagio="3"],
.pipeline[data-ativo="todos"] .pipe-estagio {
  opacity: 1;
  background: var(--white);
  border-color: var(--blue-soft);
  border-left-color: var(--blue);
  transform: translateX(2px);
}

.pipeline[data-ativo="0"] .pipe-estagio[data-estagio="0"] .pipe-rotulo,
.pipeline[data-ativo="1"] .pipe-estagio[data-estagio="1"] .pipe-rotulo,
.pipeline[data-ativo="2"] .pipe-estagio[data-estagio="2"] .pipe-rotulo,
.pipeline[data-ativo="3"] .pipe-estagio[data-estagio="3"] .pipe-rotulo,
.pipeline[data-ativo="todos"] .pipe-rotulo {
  color: var(--blue);
}

/* Estagio 01 - a nota em PDF */
.pipe-nota {
  display: grid;
  gap: 6px;
}

.pipe-linha {
  height: 7px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--line), #eef3fa);
}

.pipe-linha.curta {
  width: 58%;
}

.pipeline[data-ativo="0"] .pipe-linha,
.pipeline[data-ativo="todos"] .pipe-linha {
  background: linear-gradient(90deg, var(--blue-claro), var(--blue-soft));
}

/* Estagio 02 - operacoes extraidas */
.pipe-ops {
  display: grid;
  gap: 5px;
  font-size: 0.76rem;
  color: var(--slate);
}

.pipe-ops span {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 3px 8px;
  border-radius: 5px;
  background: rgba(47, 111, 237, 0.05);
  opacity: 0;
  transform: translateY(-4px);
}

.pipe-ops em {
  font-style: normal;
  font-weight: 600;
  color: var(--navy);
}

.pipe-ops b {
  font-weight: 600;
  color: var(--navy);
}

.pipeline[data-ativo="1"] .pipe-ops span {
  animation: entrar 380ms ease forwards;
}

.pipeline[data-ativo="1"] .pipe-ops span:nth-child(1) { animation-delay: 60ms; }
.pipeline[data-ativo="1"] .pipe-ops span:nth-child(2) { animation-delay: 200ms; }
.pipeline[data-ativo="1"] .pipe-ops span:nth-child(3) { animation-delay: 340ms; }
.pipeline[data-ativo="1"] .pipe-ops span:nth-child(4) { animation-delay: 480ms; }

.pipeline[data-ativo="todos"] .pipe-ops span {
  opacity: 1;
  transform: none;
}

@keyframes entrar {
  to {
    opacity: 1;
    transform: none;
  }
}

/* Estagio 03 - apuracao mes a mes */
.pipe-meses {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  font-size: 0.72rem;
}

.pipe-meses span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 5px 7px;
  border-radius: 5px;
  background: var(--green-soft);
  color: var(--slate);
  opacity: 0;
  transform: scale(0.94);
}

.pipe-meses b {
  font-weight: 600;
  color: var(--green);
}

.pipe-meses b.tributa {
  color: var(--amber-escuro);
}

.pipe-meses span:has(b.tributa) {
  background: var(--amber-soft);
}

.pipeline[data-ativo="2"] .pipe-meses span {
  animation: surgir 320ms ease forwards;
}

.pipeline[data-ativo="2"] .pipe-meses span:nth-child(1) { animation-delay: 40ms; }
.pipeline[data-ativo="2"] .pipe-meses span:nth-child(2) { animation-delay: 120ms; }
.pipeline[data-ativo="2"] .pipe-meses span:nth-child(3) { animation-delay: 200ms; }
.pipeline[data-ativo="2"] .pipe-meses span:nth-child(4) { animation-delay: 280ms; }
.pipeline[data-ativo="2"] .pipe-meses span:nth-child(5) { animation-delay: 360ms; }
.pipeline[data-ativo="2"] .pipe-meses span:nth-child(6) { animation-delay: 440ms; }

.pipeline[data-ativo="todos"] .pipe-meses span {
  opacity: 1;
  transform: none;
}

@keyframes surgir {
  to {
    opacity: 1;
    transform: none;
  }
}

/* Estagio 04 - a DARF */
.pipe-darf {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  border: 1px dashed var(--line);
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 400ms ease, transform 400ms ease, border-color 400ms ease,
    background 400ms ease;
}

.pipe-darf-codigo {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate-light);
}

.pipe-darf-valor {
  font-size: 1.32rem;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.01em;
}

.pipe-darf-venc {
  font-size: 0.72rem;
  color: var(--amber-escuro);
  margin-left: auto;
}

.pipeline[data-ativo="3"] .pipe-darf,
.pipeline[data-ativo="todos"] .pipe-darf {
  opacity: 1;
  transform: none;
  border-style: solid;
  border-color: var(--green);
  background: var(--green-soft);
}

/* Abaixo de 720px o pipeline vira estatico: menos ruido no celular. */
@media (max-width: 720px) {
  .pipeline {
    padding: 1.15rem;
  }

  .pipe-estagio,
  .pipe-ops span,
  .pipe-meses span,
  .pipe-darf {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .pipe-estagio {
    background: var(--white);
  }

  .pipeline-ponto {
    animation: none;
  }
}

/* --- Faixa de numeros ---------------------------------------------------- */

.faixa .numero-rotulo {
  max-width: 30ch;
}

/* --- Tabelas ------------------------------------------------------------- */

.tabela-nota {
  margin-top: 1rem;
}

.tabela-comparativa td {
  font-size: 0.93rem;
}

/* --- Movimento reduzido -------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .pipe-estagio,
  .pipe-ops span,
  .pipe-meses span,
  .pipe-darf {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }

  .pipeline-ponto {
    animation: none;
  }
}
