/* Tokens do design system (modo dark), lidos das variáveis do Figma */
:root {
  --background: #0a0a0a;
  --foreground: #fafafa;
  --card: #171717;
  --border: #ffffff1a;
  --input: #ffffff26;
  --primary: #48db90;
  --primary-foreground: #eff6ff;
  --secondary: #27272a;
  --secondary-foreground: #fafafa;
  --muted-foreground: #a1a1a1;
  --destructive: #ff6467;
  --sidebar: #171717;
  --sidebar-foreground: #fafafa;
  --sidebar-accent: #262626;
  --amber\/9: #ffc53d;
  --amber\/11: #ffca16;
  --blue\/9: #0090ff;
  --blue\/11: #70b8ff;
  --general\/primary: #171717;
  --general\/primary-foreground: #fafafa;
  --font-definitions\/font-family-body: "Geist";

  --z: 1;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

html,
body {
  margin: 0;
  background: var(--sidebar);
}
body {
  font-family: "Geist", system-ui, sans-serif;
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
.font-inter {
  font-family: "Inter", sans-serif;
}

/* O layout é desenhado em 1440px e escalado para a largura da janela */
#stage {
  width: 1440px;
  zoom: var(--z);
}

/* ---------- Telas ---------- */
.view {
  display: none;
}
.view.is-active {
  display: block;
  animation: view-in 0.5s var(--ease) both;
}
@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

body.modal-open {
  overflow: hidden;
}

/* páginas: ocupam a janela e a sidebar fica presa durante a rolagem */
[data-node-id="160:2864"],
[data-node-id="3850:32017"] {
  overflow: visible;
  border-radius: 0;
  min-height: calc(100vh / var(--z));
}
[data-node-id="3801:28"] {
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: calc(100vh / var(--z));
}

/* ---------- Interação ---------- */
[data-action] {
  cursor: pointer;
  user-select: none;
  transition: opacity 0.18s ease, transform 0.18s var(--ease), background-color 0.18s ease;
}
[data-action]:hover {
  opacity: 0.88;
}
[data-action]:active {
  transform: scale(0.975);
}
[data-action]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
[data-action][aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.5;
}

/* ---------- Modal ---------- */
#overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  padding: 16px;
  overflow: auto;
}
#overlay[hidden] {
  display: none;
}
#scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  opacity: 0;
  transition: opacity 0.32s ease;
}
#shell {
  position: relative;
  flex: none;
  margin: auto;
  width: 400px;
  height: 512px;
  box-sizing: border-box;
  background: var(--background);
  border: 2px solid var(--border);
  border-radius: 16px;
  overflow: clip;
  box-shadow: 0 34px 80px 10px rgba(72, 219, 144, 0.07);
  /* --fit encolhe o modal quando a janela é mais baixa que ele, em vez de cortar */
  zoom: var(--fit, 1);
  opacity: 0;
  transform: translateY(14px) scale(0.965);
  transition: width 0.55s var(--ease), height 0.55s var(--ease), opacity 0.3s ease,
    transform 0.5s var(--ease), box-shadow 0.5s ease;
}
#overlay.is-open #scrim {
  opacity: 1;
}
#overlay.is-open #shell {
  opacity: 1;
  transform: none;
}
#shell[data-panel="intro"] {
  width: 400px;
  /* 652px do frame menos a lista de etapas (124px + 16px de respiro) */
  height: 512px;
}
#shell[data-panel="rec"] {
  width: 560px;
  /* 708px do frame + uma linha de tópicos (42px + 8px): 12 tópicos em 3 colunas */
  height: 758px;
}
#shell[data-panel="proc"] {
  width: 560px;
  /* 502px do frame + bloco de ações (24px de respiro + 88px) */
  height: 614px;
}
#shell[data-panel="error"] {
  width: 400px;
  height: var(--error-h, 460px);
  box-shadow: 0 34px 80px 10px rgba(72, 219, 144, 0);
}

.glow {
  position: absolute;
  width: 252px;
  height: 252px;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.glow > div {
  position: absolute;
  inset: -84.92%;
}
.glow img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
}
.glow-tl {
  left: -113px;
  top: -162px;
}
.glow-br {
  right: -202px;
  bottom: -232px;
}
#shell[data-panel="error"] .glow {
  opacity: 0;
}

/* Cada painel mantém o layout original do Figma; a casca (#shell) assume fundo, borda e brilho */
.panel {
  position: absolute;
  left: -2px;
  top: -2px;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  overflow: visible;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.3s ease, visibility 0s linear 0.18s;
}
.panel.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition: opacity 0.36s ease 0.16s, transform 0.55s var(--ease) 0.12s, visibility 0s;
}
/* no 6.0 a borda não ocupa espaço no layout (conteúdo a 32px da borda externa) */
.panel[data-panel="intro"] {
  border-width: 0;
}
/* brilhos originais de cada painel: substituídos pelos da casca */
[data-node-id="3867:28209"],
[data-node-id="3867:28210"],
[data-node-id="3877:26764"],
[data-node-id="3877:26765"],
[data-node-id="3856:2613"],
[data-node-id="3856:2614"] {
  display: none;
}

/* ---------- Esfera ---------- */
.orb {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transform: scale(var(--orb-s, 1));
  will-change: transform;
}
.orb-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 80px;
  height: 80px;
  margin: -40px 0 0 -40px;
  border-radius: 50%;
  box-shadow: 0 0 90px 0 rgba(72, 219, 144, 0.65);
}
/* brilho extra que cresce com a voz */
.orb-halo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 150px;
  height: 150px;
  margin: -75px 0 0 -75px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(72, 219, 144, 0.6) 0%, rgba(72, 219, 144, 0.28) 38%, rgba(72, 219, 144, 0) 70%);
  opacity: var(--orb-h, 0);
  will-change: opacity;
}
.orb-core {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(circle 40px at 28px 24px, #9ef0c7 0%, #48db90 55%, #1f8a54 100%);
}
.orb-blob {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  filter: blur(7px);
  will-change: transform;
}
.orb-blob.b1 {
  width: 54px;
  height: 54px;
  margin: -27px;
  background: radial-gradient(circle, rgba(214, 253, 233, 0.9) 0%, rgba(158, 240, 199, 0.6) 40%, rgba(158, 240, 199, 0) 70%);
  mix-blend-mode: screen;
}
.orb-blob.b2 {
  width: 62px;
  height: 62px;
  margin: -31px;
  background: radial-gradient(circle, #0f6b3d 0%, rgba(31, 138, 84, 0.8) 40%, rgba(31, 138, 84, 0) 70%);
  mix-blend-mode: multiply;
}
.orb-blob.b3 {
  width: 46px;
  height: 46px;
  margin: -23px;
  background: radial-gradient(circle, #48db90 0%, rgba(72, 219, 144, 0.9) 35%, rgba(72, 219, 144, 0) 70%);
}
.orb-blob.b4 {
  width: 40px;
  height: 40px;
  margin: -20px;
  background: radial-gradient(circle, #9ef0c7 0%, rgba(158, 240, 199, 0.7) 35%, rgba(158, 240, 199, 0) 70%);
  mix-blend-mode: screen;
}
/* volume da esfera: mesma luz do gradiente do Figma, por cima do movimento */
.orb-shade {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle 40px at 28px 24px, rgba(214, 253, 233, 0.34) 0%, rgba(158, 240, 199, 0) 46%),
    radial-gradient(circle 46px at 28px 24px, rgba(31, 138, 84, 0) 62%, rgba(31, 138, 84, 0.72) 100%);
}

/* ---------- Gravador ---------- */
/* dígitos de largura fixa: o cronômetro não empurra a onda a cada segundo */
[data-node-id="3877:27239"] {
  font-variant-numeric: tabular-nums;
}
[data-node-id="3877:27241"] {
  overflow: visible;
}
[data-node-id="3877:27237"] {
  animation: rec-dot 1.4s ease-in-out infinite;
}
#shell[data-rec="paused"] [data-node-id="3877:27237"],
#shell[data-rec="idle"] [data-node-id="3877:27237"] {
  animation: none;
  opacity: 0.35;
}
@keyframes rec-dot {
  50% {
    opacity: 0.25;
  }
}
[data-node-id="3877:27241"] > div {
  transition: height 0.14s ease-out, background-color 0.25s ease;
}

/* ---------- Processando ---------- */
.ind {
  flex: none;
  position: relative;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 100px;
  border: 2px solid var(--border);
  transition: background-color 0.35s ease, border-color 0.35s ease;
}
.ind img {
  width: 12px;
  height: 12px;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.25s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.passo p {
  transition: color 0.35s ease;
}
.passo[data-state="pending"] p {
  color: var(--muted-foreground);
}
.passo[data-state="active"] .ind {
  border-color: var(--primary);
}
.passo[data-state="active"] .ind::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  border: 2px solid var(--primary);
  animation: ind-pulse 1.5s ease-out infinite;
}
@keyframes ind-pulse {
  from {
    opacity: 0.7;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(1.6);
  }
}
.passo[data-state="done"] .ind {
  background: var(--primary);
  border-color: var(--primary);
}
.passo[data-state="done"] .ind img {
  opacity: 1;
  transform: none;
}
.word {
  opacity: 0;
  filter: blur(3px);
  transition: opacity 0.4s ease, filter 0.4s ease;
}
.word.is-in {
  opacity: 1;
  filter: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Revisar rascunho ---------- */
/* no Figma o traço dos cards não ocupa espaço no layout */
[data-node-id="3850:32105"] > div {
  border-width: 0;
  box-shadow: inset 0 0 0 1px var(--border);
}
/* barra de ações: presa ao rodapé do conteúdo, como no frame */
[data-node-id="3850:32437"] {
  position: sticky;
  bottom: 0;
  z-index: 5;
  width: calc(100% + 48px);
  margin: -28px -24px -80px;
}

/* transcrição completa: a caixa mantém a altura do frame (5 linhas) e rola quando o texto passa disso */
[data-node-id="3819:6570"] {
  min-height: 120px;
  max-height: 120px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--input) transparent;
}
[data-node-id="3819:6570"]::-webkit-scrollbar {
  width: 6px;
}
[data-node-id="3819:6570"]::-webkit-scrollbar-thumb {
  background: var(--input);
  border-radius: 100px;
}

/* o pulso do passo ativo ultrapassa a linha: os contêineres do Figma recortavam a animação */
.passo,
[data-node-id="3819:6551"] {
  overflow: visible;
}

/* o frame tem dois grupos "Tipo de imóvel": fica só o primeiro (Casa / Apartamento / Outro) */
[data-node-id="3850:32129"] {
  display: none;
}

/* tópico do roteiro reconhecido: indicador da variante Estado=Reconhecido (20px, primário, check de 12px) */
.topic-ok {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 100px;
  background: var(--primary);
  animation: topic-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.topic-ok img {
  position: static;
  width: 12px;
  height: 12px;
}
@keyframes topic-pop {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
}

/* roteiro com 12 tópicos: 3 colunas, com o mesmo card do frame um pouco mais estreito */
[data-node-id="3877:27403"] > div {
  width: calc((100% - 16px) / 3);
  padding-left: 10px;
  padding-right: 10px;
  gap: 8px;
}

/* descrição: o frame mostra o texto cortado em uma linha; no campo real ele quebra */
[data-node-id="3850:32368"] > div {
  height: auto;
}
[data-node-id="3850:32368"] p {
  height: auto;
  white-space: normal;
}

.btn-icon {
  flex: none;
  width: 16px;
  height: 16px;
}

/* ---------- Ilustração do 6.0 ---------- */
.illo [class^="illo-"] {
  transform-box: fill-box;
  transform-origin: center;
}
/* ondinha da voz: nasce perto da boca, cresce e some */
.illo .illo-voice {
  transform-origin: 0% 60%;
  animation: illo-voice 1.5s ease-out infinite;
}
@keyframes illo-voice {
  0% {
    opacity: 0;
    transform: scale(0.55) rotate(-6deg);
  }
  25% {
    opacity: 1;
  }
  70% {
    opacity: 1;
    transform: scale(1.05) rotate(2deg);
  }
  100% {
    opacity: 0;
    transform: scale(1.18) rotate(4deg);
  }
}
/* boca falando, no ritmo da ondinha */
.illo .illo-mouth {
  animation: illo-mouth 1.5s ease-in-out infinite;
}
@keyframes illo-mouth {
  0%,
  100% {
    transform: scale(0.9, 0.55);
  }
  15% {
    transform: scale(1, 1.1);
  }
  30% {
    transform: scale(0.95, 0.7);
  }
  45% {
    transform: scale(1.02, 1.15);
  }
  62% {
    transform: scale(0.94, 0.8);
  }
  78% {
    transform: scale(1, 1.05);
  }
}
/* piscada rápida a cada poucos segundos */
.illo .illo-eye {
  animation: illo-blink 4.2s ease-in-out infinite;
}
@keyframes illo-blink {
  0%,
  44%,
  50%,
  100% {
    transform: scaleY(1);
  }
  47% {
    transform: scaleY(0.12);
  }
}
.illo .illo-brow {
  animation: illo-brow 4.2s ease-in-out infinite;
}
@keyframes illo-brow {
  0%,
  55%,
  75%,
  100% {
    transform: translateY(0);
  }
  63% {
    transform: translateY(-0.8px);
  }
}
/* microfone na tela do celular pulsando como se estivesse gravando */
.illo .illo-mic {
  animation: illo-mic 1.5s ease-in-out infinite;
}
@keyframes illo-mic {
  0%,
  100% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.14);
  }
}

/* lista "1, 2, 3" do 6.0 removida */
[data-node-id="3867:42439"] {
  display: none;
}

/* contador do menu: o texto do componente vem numa caixa de 1px, o que descentraliza o número */
[data-name="badge/permissoes"] {
  padding: 0;
}
[data-name="badge/permissoes"] > div {
  width: auto;
}
[data-name="badge/permissoes"] p {
  flex: none;
}
