/* ==========================================================================
   Droyds — demonstrações interativas (parte genérica)
   Barra de progresso/missões, tela inicial, balão do tour e tela final.
   O visual da réplica de cada produto fica no CSS dele (ex.: gc/gc.css).
   ========================================================================== */
:root {
  --demo-header: 70px;                 /* altura do cabeçalho do site */
  --demo-hud: 54px;
  --demo-topo: calc(var(--demo-header) + var(--demo-hud));
}
/* no site quem rola é o <body> */
html, body.demo-pagina { scroll-padding-top: calc(var(--demo-topo) + 12px); }

.demo-main [hidden], .demo-hud[hidden] { display: none !important; }

.demo-main {
  min-height: 100vh;
  padding: calc(var(--demo-topo) + 16px) 16px 40px;
  background: var(--black);
}
body.demo-encerrada .demo-main { padding-top: calc(var(--demo-header) + 16px); }
.demo-palco { position: relative; max-width: 1600px; margin: 0 auto; }

/* Nesta página os botões flutuantes do site cobririam o tour */
body.demo-pagina .whats-float,
body.demo-pagina .crow-float,
body.demo-pagina .back-to-top { display: none !important; }

/* ---------- barra fixa: missões + progresso + pular ---------- */
.demo-hud {
  position: fixed; top: var(--demo-header); left: 0; right: 0;
  height: var(--demo-hud);
  z-index: 999;                        /* abaixo do cabeçalho do site (1000): o menu abre por cima */
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "mascote missoes pular" "progresso progresso progresso";
  grid-template-rows: 1fr 4px;
  align-items: center;
  column-gap: 12px;
  padding: 0 16px;
  background: rgba(12, 14, 26, 0.97);
  border-bottom: 1px solid var(--black-border);
}
/* com o tour ativo sobe acima do escurecido (10000), pra missões e "Pular" ficarem sempre à mão */
body.driver-active .demo-hud { z-index: 10001; }
.driver-active .demo-hud, .driver-active .demo-hud * { pointer-events: auto; }
.demo-hud-linha { display: contents; }
.demo-hud-mascote { grid-area: mascote; width: 34px; height: 34px; object-fit: contain; }

.demo-missoes { grid-area: missoes; display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; min-width: 0; }
.demo-missoes li {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 4px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--gray); font-size: 0.8rem; font-weight: 500; white-space: nowrap;
  transition: var(--transition);
}
.demo-missao-num {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.1); font-size: 0.7rem; font-weight: 700;
}
.demo-missao-curto { display: none; }
.demo-missoes li.atual { border-color: var(--blue); color: var(--white); }
.demo-missoes li.atual .demo-missao-num { background: var(--blue); color: var(--black); }
.demo-missoes li.feita { border-color: rgba(74, 222, 128, 0.5); color: #4ade80; }
.demo-missoes li.feita .demo-missao-num { background: #4ade80; color: var(--black); animation: demoPulo 0.5s ease; }
@keyframes demoPulo { 0% { transform: scale(0.4); } 60% { transform: scale(1.35); } 100% { transform: scale(1); } }

.demo-pular {
  grid-area: pular;
  background: none; border: 0; padding: 8px 4px; cursor: pointer;
  color: var(--gray); font: inherit; font-size: 0.8rem; text-decoration: underline; white-space: nowrap;
}
.demo-pular:hover, .demo-pular:focus-visible { color: var(--white); }

.demo-progresso { grid-area: progresso; height: 4px; margin: 0 -16px; background: rgba(255, 255, 255, 0.08); align-self: end; }
.demo-progresso-barra { height: 100%; width: 0; background: var(--blue); box-shadow: 0 0 10px var(--blue-glow); transition: width 0.4s ease; }

.demo-hud-aviso { grid-area: missoes; color: var(--gray); font-size: 0.85rem; }

/* ---------- seletor de simulações (tela inicial com várias simulações) ---------- */
/* enquanto o visitante escolhe, a tela inicial ocupa o lugar da réplica (que ainda não aparece) */
body.demo-escolhendo #demoApp { display: none; }
body.demo-escolhendo .demo-intro { position: static; padding: 8px 0 24px; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.demo-intro-card.largo { max-width: 600px; }
.demo-sims { display: grid; gap: 10px; margin: 4px 0 16px; text-align: left; }
.demo-sim {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; border-radius: 14px; cursor: pointer;
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.12); color: var(--white);
  font: inherit; text-align: left; transition: var(--transition);
}
.demo-sim:hover, .demo-sim:focus-visible { border-color: var(--blue); background: var(--blue-glow-soft); outline: none; }
.demo-sim-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.demo-sim-texto b { font-size: 0.98rem; font-weight: 600; color: var(--white); }
.demo-intro-card .demo-sim-texto small { display: block; margin: 0; color: var(--gray); font-size: 0.8rem; line-height: 1.4; }
.demo-sim-tempo { flex: none; padding: 3px 9px; border-radius: 999px; background: var(--blue-glow-soft); color: var(--blue); font-size: 0.72rem; white-space: nowrap; }
/* etiqueta opcional ao lado do título (roteiro: tag: 'Para a TI') */
.demo-sim-tag { display: inline-block; margin-left: 8px; padding: 2px 8px; border: 1px solid #f5a524; border-radius: 999px; color: #f5a524; font-size: 0.68rem; font-style: normal; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; vertical-align: middle; white-space: nowrap; }
.demo-final-sim { display: inline-block; margin-bottom: 14px; padding: 4px 12px; border-radius: 999px; background: var(--blue-glow-soft); color: var(--blue); font-size: 0.78rem; }

/* ---------- tela inicial (sobre a réplica) ---------- */
.demo-intro {
  position: absolute; inset: 0; z-index: 5;
  display: flex; justify-content: center; align-items: flex-start;
  padding: 40px 16px;
  background: rgba(5, 6, 15, 0.78);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  border-radius: 12px;
}
.demo-intro-card, .demo-final-card {
  width: 100%; max-width: 440px; text-align: center;
  background: var(--black-card); border: 1px solid var(--black-border); border-radius: 20px;
  padding: 28px 24px;
  box-shadow: 0 0 60px rgba(50, 182, 255, 0.12);
}
.demo-intro-mascote, .demo-final-mascote { width: 120px; height: 120px; object-fit: contain; animation: demoFlutua 3s ease-in-out infinite; }
@keyframes demoFlutua { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.demo-intro-card h1, .demo-final-card h1 { font-size: 1.5rem; line-height: 1.25; margin: 8px 0 8px; }
.demo-intro-card p, .demo-final-card p { color: var(--gray); margin: 0 0 16px; line-height: 1.6; }
.demo-intro-missoes { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 8px; text-align: left; }
.demo-intro-missoes li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); color: var(--white); font-size: 0.92rem;
}
.demo-intro-missoes span {
  width: 22px; height: 22px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--blue-glow-soft); color: var(--blue); font-size: 0.75rem; font-weight: 700;
}
.demo-intro-card small { display: block; margin-top: 14px; color: var(--gray-dark); font-size: 0.75rem; }
.demo-comecar { justify-content: center; min-width: 200px; font-size: 1rem; }

/* ---------- balão do tour (Driver.js) ---------- */
.driver-popover.demo-balao {
  background: var(--black-card2); color: var(--white);
  border: 1px solid rgba(50, 182, 255, 0.5); border-radius: 14px;
  padding: 12px 14px; min-width: 240px; max-width: min(320px, calc(100vw - 24px));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 24px rgba(50, 182, 255, 0.2);
}
.demo-balao .driver-popover-title, .demo-balao .driver-popover-footer, .demo-balao .driver-popover-close-btn { display: none !important; }
.demo-balao .driver-popover-description { font-family: 'Inter', sans-serif; font-size: 0.92rem; line-height: 1.45; color: var(--white); }
.demo-balao-corpo { display: flex; gap: 10px; align-items: flex-start; }
.demo-balao-mascote { width: 44px; height: 44px; object-fit: contain; flex: none; }
.demo-balao-corpo strong { display: block; color: var(--blue); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }
.demo-balao-corpo p { margin: 2px 0 6px; color: var(--white); }
.demo-balao-corpo b { color: var(--blue); font-weight: 600; }
.demo-balao-passo { display: block; color: var(--gray); font-size: 0.7rem; }
/* botão dos passos que só explicam (sem ação na réplica) */
.demo-balao-botao {
  display: inline-flex; align-items: center; margin-top: 10px; padding: 7px 18px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--blue); color: var(--black);
  font: 700 0.82rem 'Space Grotesk', 'Inter', sans-serif;
}
.demo-balao-botao:hover, .demo-balao-botao:focus-visible { background: var(--white); outline: none; }
.driver-popover.demo-balao .driver-popover-arrow-side-left { border-left-color: var(--black-card2); }
.driver-popover.demo-balao .driver-popover-arrow-side-right { border-right-color: var(--black-card2); }
.driver-popover.demo-balao .driver-popover-arrow-side-top { border-top-color: var(--black-card2); }
.driver-popover.demo-balao .driver-popover-arrow-side-bottom { border-bottom-color: var(--black-card2); }

/* ---------- onde clicar: anel pulsando + cursor animado ----------
   Os dois são camadas soltas no <body> (position: fixed), posicionadas pelo motor em cima do
   elemento. Assim nada em volta (recorte do tour, overflow de modal/abas/colunas) corta o anel. */
.demo-anel {
  position: fixed; left: 0; top: 0; z-index: 10002;   /* acima do escurecido, abaixo do balão */
  box-sizing: border-box;
  pointer-events: none !important;
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  animation: demoAnel 1.1s ease-in-out infinite;
}
.demo-anel[hidden] { display: none; }
@keyframes demoAnel {
  0%, 100% { outline-offset: 1px; outline-color: rgba(50, 182, 255, 1); box-shadow: 0 0 0 1px rgba(50, 182, 255, 0.25); }
  50% { outline-offset: 5px; outline-color: rgba(50, 182, 255, 0.45); box-shadow: 0 0 14px 6px rgba(50, 182, 255, 0.25); }
}
.demo-dedo {
  position: fixed; left: 0; top: 0; z-index: 10003;   /* acima do escurecido, abaixo do balão */
  pointer-events: none !important;
  filter: drop-shadow(0 0 6px rgba(50, 182, 255, 0.9)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}
.demo-dedo[hidden] { display: none; }
.demo-dedo svg { display: block; margin: -2px 0 0 -2px; animation: demoToque 1.1s ease-in-out infinite; }
.demo-dedo.arrastando svg { animation: none; }
@keyframes demoToque { 0%, 100% { transform: translate(10px, 10px); } 50% { transform: translate(0, 0) scale(0.92); } }

/* ---------- tela final ---------- */
.demo-final { display: flex; justify-content: center; padding: 24px 0; }
.demo-final-card { max-width: 520px; }
.demo-final-missoes { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; text-align: left; }
.demo-final-missoes li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); }
.demo-final-missoes li > span {
  width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-size: 0.8rem; font-weight: 700; background: rgba(255, 255, 255, 0.1); color: var(--gray);
}
.demo-final-missoes li.feita > span { background: #4ade80; color: var(--black); }
.demo-final-missoes b { display: block; color: var(--white); font-size: 0.95rem; }
.demo-final-missoes em { display: block; font-style: normal; color: var(--gray); font-size: 0.8rem; }
.demo-final-missoes li.pendente b { color: var(--gray); }
.demo-final-extras { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 20px; }
.demo-final-extras span { padding: 4px 10px; border-radius: 999px; background: var(--blue-glow-soft); color: var(--blue); font-size: 0.75rem; }
.demo-final-botoes { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 8px; }
.demo-final-botoes a { justify-content: center; flex: 1 1 200px; }
.demo-refazer { display: inline-block; margin-top: 18px; color: var(--gray); font-size: 0.82rem; text-decoration: underline; }

/* ---------- celular ---------- */
@media (max-width: 639px) {
  :root { --demo-hud: 74px; }
  .demo-main { padding-left: 8px; padding-right: 8px; padding-top: calc(var(--demo-topo) + 8px); }
  .demo-hud {
    grid-template-columns: auto 1fr;
    grid-template-areas: "mascote missoes" "pular pular" "progresso progresso";
    grid-template-rows: 1fr auto 4px;
    padding: 6px 10px 0; column-gap: 8px;
  }
  .demo-progresso { margin: 0 -10px; }
  .demo-hud-mascote { width: 28px; height: 28px; }
  .demo-missoes { gap: 5px; }
  .demo-missoes li { padding: 3px 8px 3px 3px; font-size: 0.74rem; }
  .demo-missao-longo { display: none; }
  .demo-missao-curto { display: inline; }
  .demo-pular { justify-self: end; padding: 4px 2px 6px; font-size: 0.74rem; }
  .demo-intro { padding: 20px 10px; }
  .demo-intro-mascote, .demo-final-mascote { width: 96px; height: 96px; }
}

@media (prefers-reduced-motion: reduce) {
  .demo-intro-mascote, .demo-final-mascote, .demo-missoes li.feita .demo-missao-num, .demo-anel, .demo-dedo svg { animation: none; }
  .demo-progresso-barra { transition: none; }
}
