/* wizard.css - Construtor Guiado */

.tabs-sep {
  align-self: center;
  color: #9aa6ac;
  font-size: 12px;
  margin: 0 4px 0 10px;
}
.full-bleed { max-width: none; }

/* Quando a aba guiada (full-bleed) esta ativa, o main ocupa a largura TODA
   (sem o max-width/centralizacao padrao), colando o conteudo a esquerda. */
main:has(> .full-bleed.active) {
  max-width: none;
  width: 100%;
  margin: 0;
}

/* Layout do construtor: editor fixo a esquerda + canvas (organograma) */
.builder {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  width: 100%;
}
@media (max-width: 820px) {
  .builder { grid-template-columns: 1fr; }
}
.builder-editor {
  position: sticky;
  top: 70px;
  background: #fff;
  border: 1px solid var(--borda);
  border-radius: 10px;
  padding: 16px;
  min-height: 300px;
}
.builder-editor-vazio {
  color: var(--cinza);
  text-align: center;
  padding: 40px 10px;
}
.ed-head { border-bottom: 1px solid var(--borda); margin-bottom: 12px; padding-bottom: 8px; }
.ed-head h2 { font-size: 17px; margin: 0 0 2px; }
.ed-sep { border: none; border-top: 1px solid var(--borda); margin: 16px 0; }

/* Area de anexo na opcao de resposta */
.op-anexo-area {
  margin-top: 6px;
  padding: 8px 10px;
  background: #f7f9fa;
  border: 1px dashed var(--borda);
  border-radius: 6px;
}
.op-anexo-atual { font-size: 12.5px; margin-top: 4px; }

.builder-canvas {
  background: #f7f9fa;
  border: 1px solid var(--borda);
  border-radius: 10px;
  padding: 10px 16px 24px;
}
.builder-canvas-topo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.builder-canvas-topo h3 { margin: 8px 0; color: var(--cinza); }

/* Cards de escolha (passo 2) */
.wz-escolha-cards { display: flex; gap: 12px; flex-wrap: wrap; }
.wz-card {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  text-align: left;
  padding: 16px;
  border: 2px solid var(--borda);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
.wz-card:hover { border-color: var(--verde); }
.wz-card.sel { border-color: var(--verde); background: #eef7f4; }
.wz-card-ic { font-size: 26px; }

.wz-opcao {
  background: #fff;
  border: 1px solid var(--borda);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
}

/* ---------- Organograma estilo caixas azuis (como o print) ---------- */
.org2 {
  padding: 16px 8px;
  overflow-x: auto;      /* usa a largura toda; scroll horizontal se precisar */
  display: flex;
  justify-content: flex-start;  /* arvore comeca a ESQUERDA, cresce p/ direita */
}
/* a arvore ocupa so o necessario (nao estica), permitindo crescer p/ direita */
.org2 > .tree-node { flex: 0 0 auto; }

/* ===== Arvore hierarquica (estilo organograma empresarial) ===== */
/* Estrutura: .tree-node > .tree-box + .tree-children(.tree-node...) */
.org2 .tree-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* a arvore cresce horizontalmente; nao encolher os nos */
}
/* Caixa do no */
.tree-box {
  background: #1f6f8b;
  color: #fff;
  border-radius: 6px;
  padding: 12px 20px;
  text-align: center;
  min-width: 130px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform .08s, box-shadow .08s;
  position: relative;
  z-index: 1;
}
.tree-box:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.tree-box.sel { border-color: #ffb300; box-shadow: 0 0 0 3px rgba(255,179,0,0.35); }
.tree-box-tit { font-weight: 600; font-size: 15px; }
.tree-box-sub { font-size: 11.5px; opacity: 0.85; margin-top: 2px; }
.tree-box.tree-info { background: #e0f2f1; color: #00695c; }
.tree-box.tree-info .tree-box-tit { font-weight: 500; font-size: 13px; }
.tree-box.tree-add { background: #eceff1; color: #37474f; border: 2px dashed #90a4ae; }

/* Area dos filhos */
.tree-children {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  /* filhos na MESMA linha horizontal, lado a lado */
}
/* so desenha conexoes quando o no tem filhos */
.tree-node.tem-filhos > .tree-children { padding-top: 24px; position: relative; }

/* conector vertical que SOBE de cada filho ate a barra horizontal */
.tree-node.tem-filhos > .tree-children > .tree-node {
  position: relative;
  padding: 0 14px;
}
.tree-node.tem-filhos > .tree-children > .tree-node::before {
  content: '';
  position: absolute;
  top: -24px;
  left: 50%;
  width: 2px;
  height: 24px;
  background: #90a4ae;
}
/* barra horizontal: metade superior ligando os filhos (menos nas bordas externas) */
.tree-node.tem-filhos > .tree-children > .tree-node::after {
  content: '';
  position: absolute;
  top: -24px;
  left: 0;
  right: 0;
  height: 2px;
  background: #90a4ae;
}
/* remove a metade da barra que "sai" nas extremidades */
.tree-node.tem-filhos > .tree-children > .tree-node:first-child::after { left: 50%; }
.tree-node.tem-filhos > .tree-children > .tree-node:last-child::after { right: 50%; }
.tree-node.tem-filhos > .tree-children > .tree-node:only-child::after { display: none; }

/* conector vertical que DESCE do pai ate a barra */
.tree-node.tem-filhos > .tree-box::after {
  content: '';
  position: absolute;
  bottom: -24px;
  left: 50%;
  width: 2px;
  height: 24px;
  background: #90a4ae;
  z-index: 0;
}

/* Previa da mensagem do menu gerada */
.ed-preview {
  margin-top: 14px;
  background: #f7f9fa;
  border: 1px solid var(--borda);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
}
.ed-preview pre {
  white-space: pre-wrap;
  margin: 6px 0 0;
  font-family: inherit;
  color: #333;
}
.wz-opcao.foco { border-color: #ffb300; box-shadow: 0 0 0 2px rgba(255,179,0,0.25); }
.op-submenu-hint { margin-top: 6px; }

/* Botao de trocar o tipo (Menu <-> Perguntas): destacado, cara de acao */
.btn-trocar-tipo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 14px;
  padding: 11px 14px;
  background: #eef4fb;
  color: #1a56db;
  border: 1px solid #bcd3f5;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-trocar-tipo:hover { background: #dbe8fb; border-color: #1a56db; }
.btn-trocar-tipo .ic { font-size: 16px; }

/* Linhas de horario por dia no editor de Saudacao */
.dia-linha {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13.5px;
}
.dia-linha input[type="time"] {
  padding: 5px 6px;
  border: 1px solid var(--borda);
  border-radius: 6px;
}
.dia-linha input[disabled] { opacity: 0.4; }
