/* BDO (Base de Dados Operacional): componentes próprios da página.
   Usa os componentes sp-* de softphone.css (seções, títulos, pipeline,
   cartões, números) e os tokens de flux-ds.css, então segue o tema escuro
   (padrão) e o claro (data-theme="light"). */

.bd-mono {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}

@media (max-width: 640px) {
  .bd-page .sp-sec {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

.bd-head {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: 2.5rem;
}

/* Animações em CSS ficam paradas enquanto a seção está fora da tela */
.js .bd-anim:not(.bd-on) *,
.js .bd-anim:not(.bd-on) *::before,
.js .bd-anim:not(.bd-on) *::after {
  animation-play-state: paused !important;
}

/* ---------- Hero: emblema da base ---------- */
.bd-emblem {
  align-items: center;
  display: flex;
  height: 250px;
  justify-content: center;
  margin: 2rem auto 0;
  overflow: hidden;
  position: relative;
  width: min(1000px, 100%);
}

.bd-emblem .sp-wave {
  height: 170px;
  width: 170px;
}

.bd-cyl {
  filter: drop-shadow(0 18px 40px hsl(var(--primary) / 0.4));
  height: auto;
  position: relative;
  width: 190px;
  z-index: 2;
}

.bd-cyl-t1 {
  fill: #fff;
  font-family: Outfit, ui-sans-serif, system-ui, sans-serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 3px;
}

.bd-cyl-t2 {
  fill: rgba(255, 255, 255, 0.85);
  font-family: Outfit, ui-sans-serif, system-ui, sans-serif;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 1.6px;
}

/* ---------- O desafio: cartão do número ---------- */
.bd-visual {
  display: flex;
  justify-content: center;
}

.bd-num {
  align-items: center;
  border-radius: 28px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 2rem 1.5rem;
  text-align: center;
  width: min(460px, 100%);
}

.bd-num-lb {
  color: hsl(var(--ink-muted));
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.bd-num-n {
  color: hsl(var(--ink-strong));
  font-size: clamp(1.6rem, 2.8vw, 2.6rem);
  font-weight: 300;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.bd-ops {
  height: 56px;
  position: relative;
  width: 100%;
}

.bd-op {
  align-items: center;
  border-radius: 16px;
  display: inline-flex;
  font-size: 1rem;
  font-weight: 600;
  left: 50%;
  padding: 0.85rem 1.4rem;
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}

.bd-op.a {
  animation: bd-opA 7s infinite;
  background: hsl(var(--surface-soft));
  border: 1px solid hsl(var(--ink-strong) / 0.12);
  color: hsl(var(--ink-secondary));
}

.bd-op.a s {
  animation: bd-strk 7s infinite;
  background: linear-gradient(#e11d48, #e11d48) left center / 0 2px no-repeat;
  text-decoration: none;
}

.bd-op.b {
  animation: bd-opB 7s infinite;
  background: linear-gradient(135deg, hsl(var(--primary)), #7c6cf0);
  box-shadow: 0 14px 30px hsl(var(--primary) / 0.35);
  color: #fff;
  opacity: 0;
}

@keyframes bd-opA {
  0%, 38% { opacity: 1; transform: translateX(-50%); }
  46%, 100% { opacity: 0; transform: translateX(-120%); }
}

@keyframes bd-opB {
  0%, 44% { opacity: 0; transform: translateX(20%); }
  52%, 96% { opacity: 1; transform: translateX(-50%); }
  100% { opacity: 0; transform: translateX(-50%); }
}

@keyframes bd-strk {
  0%, 22% { background-size: 0 2px; }
  34%, 100% { background-size: 100% 2px; }
}

.bd-same {
  align-items: center;
  color: hsl(var(--ink-muted));
  display: flex;
  font-size: 0.85rem;
  gap: 0.6rem;
}

.bd-same svg {
  color: #10b981;
  height: 18px;
  width: 18px;
}

/* ---------- O que é: pilha base nacional > BDO > resultado ---------- */
.bd-stack {
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  max-width: 560px;
  width: 100%;
}

.bd-bb {
  border-radius: 18px;
  padding: 1rem 1.25rem;
  text-align: center;
}

.bd-bb small {
  color: hsl(var(--primary));
  display: block;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.bd-bb b {
  color: hsl(var(--ink-strong));
  display: block;
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  font-weight: 500;
  margin-top: 0.3rem;
}

.bd-bb span {
  color: hsl(var(--ink-muted));
  display: block;
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.bd-bb--core {
  background: linear-gradient(135deg, hsl(var(--primary)), #7c6cf0);
  box-shadow: 0 20px 48px hsl(var(--primary) / 0.32);
}

.bd-bb--core small,
.bd-bb--core b,
.bd-bb--core span {
  color: #fff;
}

.bd-bb--core span {
  opacity: 0.85;
}

.bd-fv {
  background: repeating-linear-gradient(hsl(var(--primary) / 0.6) 0 6px, transparent 6px 12px);
  height: 48px;
  margin: 0 auto;
  position: relative;
  width: 2px;
}

.bd-fv i {
  animation: bd-vdrop 1.6s linear infinite;
  background: hsl(var(--primary));
  border-radius: 50%;
  box-shadow: 0 0 0 5px hsl(var(--primary) / 0.18);
  height: 12px;
  left: -5px;
  position: absolute;
  top: 0;
  width: 12px;
}

.bd-fv i:nth-child(2) {
  animation-delay: 0.8s;
}

@keyframes bd-vdrop {
  from { opacity: 0; top: -6px; }
  20% { opacity: 1; }
  to { opacity: 0; top: 100%; }
}

/* ---------- Na prática: passos sincronizados com o diagrama ---------- */
.bd-ex .bd-head {
  margin-bottom: 2rem;
}

.bd-sts {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: 1fr;
  margin-top: 1.25rem;
}

@media (min-width: 640px) {
  .bd-sts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1000px) {
  .bd-sts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.bd-st {
  align-items: flex-start;
  border: 1px solid transparent;
  border-radius: 18px;
  display: flex;
  gap: 0.9rem;
  padding: 0.75rem 1rem;
  transition: background 0.35s, border-color 0.35s, box-shadow 0.35s;
}

.bd-st b {
  color: hsl(var(--ink-strong));
  display: block;
  font-weight: 600;
}

.bd-st p {
  color: hsl(var(--ink-muted));
  font-size: 0.88rem;
  line-height: 1.45;
  margin: 0.2rem 0 0;
}

.bd-n {
  align-items: center;
  background: hsl(var(--primary) / 0.14);
  border-radius: 50%;
  color: hsl(var(--primary));
  display: grid;
  flex: none;
  font-size: 0.85rem;
  font-weight: 600;
  height: 2rem;
  place-items: center;
  transition: background 0.35s, color 0.35s;
  width: 2rem;
}

.bd-st.is-on {
  background: hsl(var(--surface-muted));
  border-color: hsl(var(--primary) / 0.45);
  box-shadow: 0 14px 34px hsl(var(--primary) / 0.14);
}

.bd-st.is-on .bd-n {
  background: hsl(var(--primary));
  color: #fff;
}

.bd-panel {
  background: hsl(var(--surface));
  border: 1px solid hsl(var(--ink-strong) / 0.08);
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(2, 6, 23, 0.25);
  min-width: 0;
  padding: 1rem 1.1rem 0.6rem;
}

.bd-panel-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.bd-dg {
  display: block;
  height: auto;
  overflow: visible;
  width: 100%;
}

@media (max-width: 640px) {
  .bd-dg {
    min-width: 600px;
  }
}

.bd-lm {
  color: hsl(var(--ink-muted));
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  margin: 0.5rem 0 0;
  text-transform: uppercase;
}

/* Diagrama (SVG) com os tokens do tema */
.bd-dg text {
  font-family: Outfit, ui-sans-serif, system-ui, sans-serif;
}

.bd-dg .nd {
  fill: hsl(var(--surface-muted));
  stroke: hsl(var(--ink-strong) / 0.14);
  stroke-width: 1.2;
}

.bd-dg .nd.on {
  stroke: hsl(var(--primary));
  stroke-width: 2;
}

.bd-dg .nd.dim {
  fill: hsl(var(--surface-soft));
  stroke: hsl(var(--ink-strong) / 0.08);
}

.bd-dg .t1 {
  fill: hsl(var(--ink-strong));
  font-size: 16px;
  font-weight: 600;
}

.bd-dg .t1.w {
  fill: #fff;
}

.bd-dg .t1.dim {
  fill: hsl(var(--ink-muted) / 0.75);
}

.bd-dg .t2 {
  fill: hsl(var(--ink-muted));
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.6px;
}

.bd-dg .t2.w {
  fill: rgba(255, 255, 255, 0.85);
}

.bd-dg .t2.a {
  fill: hsl(var(--primary));
}

.bd-dg .t2.dim {
  fill: hsl(var(--ink-muted) / 0.5);
}

.bd-dg .t2.bad {
  fill: #f43f5e;
}

.bd-dg .t3 {
  fill: hsl(var(--ink-secondary));
  font-size: 13px;
}

.bd-dg .ln {
  animation: bd-dash 3s linear infinite;
  fill: none;
  stroke: hsl(var(--primary) / 0.5);
  stroke-dasharray: 6 6;
  stroke-width: 2;
}

.bd-dg .ln.bad {
  stroke: rgba(244, 63, 94, 0.4);
}

@keyframes bd-dash {
  to { stroke-dashoffset: -200; }
}

.bd-dg .pk {
  fill: hsl(var(--primary));
}

.bd-dg .pk.v {
  fill: #7c6cf0;
}

.bd-dg .pk.g {
  fill: #10b981;
}

.bd-dg .ring {
  fill: none;
  stroke: hsl(var(--primary));
  stroke-width: 2;
}

.bd-dg .xbg {
  fill: rgba(244, 63, 94, 0.12);
  stroke: rgba(244, 63, 94, 0.4);
}

.bd-dg .xm {
  stroke: #e11d48;
  stroke-linecap: round;
  stroke-width: 3;
}

.bd-dg .chipbg.g {
  fill: rgba(16, 185, 129, 0.12);
  stroke: rgba(16, 185, 129, 0.5);
}

.bd-dg .ct {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
}

.bd-dg .ct.g {
  fill: #34d399;
}

html[data-theme="light"] .bd-dg .ct.g {
  fill: #047857;
}

html[data-theme="light"] .bd-dg .chipbg.g {
  fill: #ecfdf5;
}

html[data-theme="light"] .bd-panel {
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.1);
}

/* ---------- Com e sem consulta ---------- */
.bd-vs {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 760px) {
  .bd-vs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.bd-vcard {
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.4rem;
}

.bd-vcard--good {
  border-color: hsl(var(--primary) / 0.45);
  box-shadow: 0 22px 50px hsl(var(--primary) / 0.16);
}

.bd-vhd {
  align-items: center;
  color: hsl(var(--ink-muted));
  display: flex;
  font-size: 0.7rem;
  font-weight: 600;
  gap: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.bd-vcard--good .bd-vhd {
  color: hsl(var(--primary));
}

.bd-vhd i {
  background: rgba(244, 63, 94, 0.14);
  border-radius: 50%;
  color: #f43f5e;
  display: grid;
  font-size: 0.8rem;
  font-style: normal;
  height: 26px;
  place-items: center;
  width: 26px;
}

.bd-vcard--good .bd-vhd i {
  background: rgba(16, 185, 129, 0.14);
  color: #10b981;
}

.bd-vcard ul {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.bd-vcard li {
  color: hsl(var(--ink-secondary));
  font-size: 0.92rem;
  line-height: 1.45;
  padding-left: 1.1rem;
  position: relative;
}

.bd-vcard li::before {
  background: hsl(var(--ink-muted) / 0.5);
  border-radius: 50%;
  content: "";
  height: 7px;
  left: 0;
  position: absolute;
  top: 0.55em;
  width: 7px;
}

.bd-vcard--good li::before {
  background: hsl(var(--primary));
}

.bd-flowbar {
  background: hsl(var(--primary) / 0.12);
  border-radius: 99px;
  height: 6px;
  overflow: hidden;
  position: relative;
}

.bd-flowbar i {
  animation: bd-fb 2.4s ease-in-out infinite;
  background: linear-gradient(90deg, transparent, hsl(var(--primary)), transparent);
  border-radius: 99px;
  bottom: 0;
  left: -30%;
  position: absolute;
  top: 0;
  width: 30%;
}

.bd-flowbar.bad {
  background: rgba(244, 63, 94, 0.1);
}

.bd-flowbar.bad i {
  animation-duration: 3.6s;
  background: linear-gradient(90deg, transparent, #f43f5e, transparent);
}

@keyframes bd-fb {
  to { left: 100%; }
}

/* ---------- Ecossistema: órbita ---------- */
.bd-sys {
  height: 470px;
  margin: 0 auto;
  max-width: 600px;
  position: relative;
  width: 100%;
}

.bd-sys-glow {
  background: radial-gradient(ellipse, hsl(var(--primary) / 0.22), transparent 70%);
  border-radius: 50%;
  filter: blur(18px);
  height: 52%;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 55%;
}

.bd-trk {
  border: 1px solid hsl(var(--primary) / 0.28);
  border-radius: 50%;
  left: 50%;
  position: absolute;
  top: 50%;
}

.bd-trk.t1 {
  border-color: hsl(var(--primary) / 0.38);
  height: 52%;
  transform: translate(-50%, -50%) rotate(21deg);
  width: 62%;
}

.bd-trk.t2 {
  height: 78%;
  transform: translate(-50%, -50%) rotate(-19deg);
  width: 92%;
}

.bd-trk.t2::after {
  background: hsl(var(--primary));
  border-radius: 50%;
  box-shadow: 0 0 0 5px hsl(var(--primary) / 0.18);
  content: "";
  height: 9px;
  left: 50%;
  position: absolute;
  top: -4px;
  width: 9px;
}

.bd-core {
  align-items: center;
  background: radial-gradient(circle at 32% 24%, #8fa6fa, #5e81f4 55%, #3f5fd6);
  border-radius: 50%;
  box-shadow: 0 20px 50px hsl(var(--primary) / 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.35);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  height: 140px;
  justify-content: center;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 140px;
  z-index: 4;
}

.bd-core svg {
  height: 48px;
  width: 48px;
}

.bd-core span {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
}

.bd-sat {
  align-items: center;
  animation: bd-satFloat 6s ease-in-out infinite;
  background: hsl(var(--surface-muted));
  border: 1px solid hsl(var(--ink-strong) / 0.1);
  border-radius: 19px;
  box-shadow: 0 14px 34px rgba(2, 6, 23, 0.18);
  color: hsl(var(--ink-strong));
  display: flex;
  flex-direction: column;
  font-size: 0.78rem;
  font-weight: 600;
  gap: 0.35rem;
  justify-content: center;
  letter-spacing: 0.06em;
  min-height: 84px;
  padding: 0.75rem 0.6rem;
  position: absolute;
  text-align: center;
  text-transform: uppercase;
  transition: border-color 0.25s;
  width: 158px;
  z-index: 5;
}

a.bd-sat:hover,
a.bd-sat:focus-visible {
  border-color: hsl(var(--primary) / 0.6);
}

.bd-sat small {
  color: hsl(var(--ink-muted));
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.3;
  text-transform: none;
}

.bd-sat svg {
  color: hsl(var(--primary));
  height: 24px;
  width: 24px;
}

.bd-sat.s-top { animation: none; left: 50%; top: -2%; transform: translateX(-50%); }
.bd-sat.s-tl { left: 0; top: 14%; }
.bd-sat.s-tr { animation-delay: -1.5s; right: 0; top: 12%; }
.bd-sat.s-bl { animation-delay: -3s; bottom: 6%; left: 0; }
.bd-sat.s-br { animation-delay: -4.5s; bottom: 4%; right: 0; }

@keyframes bd-satFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -8px; }
}

html[data-theme="light"] .bd-sat {
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

/* No celular a órbita vira uma grade: base no topo, integrações abaixo */
@media (max-width: 640px) {
  .bd-sys {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    height: auto;
  }
  .bd-sys-glow,
  .bd-trk {
    display: none;
  }
  .bd-core {
    grid-column: 1 / -1;
    justify-self: center;
    margin-bottom: 0.5rem;
    position: relative;
    left: auto;
    top: auto;
    transform: none;
  }
  .bd-sat,
  .bd-sat.s-top,
  .bd-sat.s-tl,
  .bd-sat.s-tr,
  .bd-sat.s-bl,
  .bd-sat.s-br {
    animation: none;
    bottom: auto;
    left: auto;
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    width: auto;
  }
  .bd-sat.s-top {
    grid-column: 1 / -1;
  }
}

/* ---------- Para quem ---------- */
.bd-grid3 {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 760px) {
  .bd-grid3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------- Respeitar "reduzir movimento": estado final visível ---------- */
@media (prefers-reduced-motion: reduce) {
  .bd-op.a {
    opacity: 0;
  }
  .bd-op.b {
    opacity: 1;
  }
  .bd-fv i,
  .bd-flowbar i {
    display: none;
  }
}
