/* ── Diagnóstico JPI ──────────────────────────────────────────────────── */

/* Modal CNPJ */
.modal-diag {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .6);
}
.modal-diag[hidden] { display: none; }
.modal-diag-corpo {
  background: var(--cor-superficie, #1a1a2e);
  border: 1px solid var(--cor-borda, #2a2a4a);
  border-radius: 14px;
  padding: 2rem;
  width: 90%;
  max-width: 400px;
}
.modal-diag-corpo h3 {
  margin: 0 0 .4rem;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
}
.modal-diag-corpo p {
  color: #a0a8b4;
  font-size: .85rem;
  margin: 0 0 1.2rem;
  line-height: 1.5;
}
.modal-diag-input {
  width: 100%;
  padding: .65rem .9rem;
  border-radius: 8px;
  border: 1px solid var(--cor-borda, #2a2a4a);
  background: var(--cor-fundo, #0d0d1a);
  color: #fff;
  font-size: 1rem;
  margin-bottom: .5rem;
  box-sizing: border-box;
}
.modal-diag-input:focus {
  outline: none;
  border-color: #00AEEF;
}
.modal-diag-input::placeholder { color: #555d68; }
.modal-diag-agente {
  width: 100%;
  padding: .5rem .9rem;
  border-radius: 8px;
  border: 1px solid var(--cor-borda, #2a2a4a);
  background: var(--cor-fundo, #0d0d1a);
  color: #fff;
  font-size: .85rem;
  margin-bottom: 1rem;
  box-sizing: border-box;
}
.modal-diag-agente:focus { outline: none; border-color: #00AEEF; }
.modal-diag-acoes { display: flex; gap: .5rem; justify-content: flex-end; }
.modal-diag-acoes button {
  padding: .5rem 1.2rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: .85rem;
  font-weight: 500;
}
.btn-diag-cancelar {
  background: transparent;
  color: #a0a8b4;
  border: 1px solid var(--cor-borda, #2a2a4a) !important;
}
.btn-diag-iniciar {
  background: #003EA5;
  color: #fff;
}
.btn-diag-iniciar:hover { background: #0050c8; }
.btn-diag-iniciar:disabled { opacity: .4; cursor: not-allowed; }
.modal-diag-erro {
  color: #F07020;
  font-size: .8rem;
  margin: 0 0 .5rem;
  min-height: 1.2em;
}

/* ── Painel lateral de progresso ──────────────────────────────────────── */

.diag-painel {
  padding: 1rem;
  border-bottom: 1px solid var(--cor-borda, #2a2a4a);
}
.diag-painel[hidden] { display: none; }

.diag-empresa-card {
  background: var(--cor-fundo, #0d0d1a);
  border-radius: 8px;
  padding: .6rem .8rem;
  margin-bottom: .8rem;
  font-size: .8rem;
  color: #a0a8b4;
}
.diag-empresa-card strong {
  color: #fff;
  display: block;
  margin-bottom: .15rem;
}

.diag-maturidade-geral { text-align: center; margin-bottom: .6rem; }
.diag-maturidade-valor {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.diag-maturidade-label {
  font-size: .7rem;
  color: #7a8290;
  display: block;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.diag-radar { display: flex; justify-content: center; margin-bottom: .6rem; }

/* ── Barras de progresso por tema ─────────────────────────────────────── */

.diag-temas { display: flex; flex-direction: column; gap: .45rem; }
.diag-tema-item { font-size: .75rem; }
.diag-tema-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .15rem;
  color: #a0a8b4;
}
.diag-tema-header span:first-child {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.diag-tema-pct {
  font-weight: 600;
  color: #fff;
  min-width: 3em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.diag-tema-barra {
  height: 4px;
  background: rgba(255, 255, 255, .06);
  border-radius: 2px;
  overflow: hidden;
}
.diag-tema-barra-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .6s ease-out, background-color .6s ease-out;
}

.diag-nivel-inicial { background: #E53935; }
.diag-nivel-desenvolvimento { background: #F07020; }
.diag-nivel-estruturado { background: #FDD835; }
.diag-nivel-gerenciado { background: #43A047; }
.diag-nivel-avancado { background: #00AEEF; }
.diag-nivel-vazio { background: rgba(255, 255, 255, .06); }

.diag-tema-badge {
  font-size: .65rem;
  color: #555d68;
  margin-left: .3rem;
}

.diag-concluir {
  width: 100%;
  margin-top: .8rem;
  padding: .55rem;
  background: #003EA5;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: .85rem;
  font-weight: 500;
}
.diag-concluir:hover { background: #0050c8; }
.diag-concluir:disabled { opacity: .4; cursor: not-allowed; }

/* ── Indicador de progresso (loading) ─────────────────────────────────── */

.diag-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  padding: 1.2rem !important;
}
.diag-loading-icon { display: flex; gap: .3rem; }
.diag-loading-icon span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00AEEF;
  animation: diag-pulse 1.4s infinite ease-in-out both;
}
.diag-loading-icon span:nth-child(1) { animation-delay: -0.32s; }
.diag-loading-icon span:nth-child(2) { animation-delay: -0.16s; }
@keyframes diag-pulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: .3; }
  40% { transform: scale(1); opacity: 1; }
}
.diag-loading-texto {
  color: #e0e4ea;
  font-size: .85rem;
  font-weight: 500;
}
.diag-loading-etapas { display: flex; gap: .6rem; font-size: .75rem; }
.diag-etapa {
  color: #555d68;
  padding: .2rem .5rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, .08);
  transition: all .3s ease-out;
}
.diag-etapa.ativa {
  color: #00AEEF;
  border-color: rgba(0, 174, 239, .3);
  background: rgba(0, 174, 239, .06);
}
.diag-etapa.concluida {
  color: #43A047;
  border-color: rgba(67, 160, 71, .3);
}

/* ── Botões de escolha ────────────────────────────────────────────────── */

.diag-escolha-grid {
  display: flex;
  gap: .5rem;
  margin-top: .6rem;
  flex-wrap: wrap;
}
.diag-escolha-btn {
  flex: 1;
  min-width: 200px;
  padding: .7rem .9rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: transparent;
  color: #e0e4ea;
  cursor: pointer;
  text-align: left;
  transition: border-color .2s, background .2s;
}
.diag-escolha-btn:hover {
  border-color: #00AEEF;
  background: rgba(0, 174, 239, .05);
}
.diag-escolha-btn:disabled { opacity: .4; cursor: default; }
.diag-escolha-btn strong { font-size: .85rem; }
.diag-escolha-btn small { color: #7a8290; font-size: .75rem; }

/* ── Onboarding ───────────────────────────────────────────────────────── */

.diag-onboarding {
  max-width: 500px !important;
  padding: 1.5rem 1.5rem 1.2rem !important;
}
.diag-onboarding-titulo {
  font-size: 1.15rem;
  color: #fff;
  font-weight: 600;
  margin-bottom: .15rem;
  letter-spacing: -.01em;
}
.diag-onboarding-sub {
  font-size: .85rem;
  color: #a0a8b4;
  margin-bottom: 1.2rem;
  line-height: 1.5;
}

.diag-onboarding-jornada {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-bottom: 1rem;
}
.diag-onboarding-etapa {
  display: flex;
  gap: .7rem;
  align-items: flex-start;
  padding: .65rem .75rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .07);
  background: rgba(255, 255, 255, .02);
}
.diag-onboarding-etapa-num {
  min-width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #003EA5;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: .75rem;
  flex-shrink: 0;
  margin-top: .1rem;
}
.diag-onboarding-etapa strong {
  font-size: .82rem;
  color: #e0e4ea;
  display: block;
  margin-bottom: .1rem;
  font-weight: 600;
}
.diag-onboarding-etapa small {
  font-size: .75rem;
  color: #8a909a;
  line-height: 1.5;
  display: block;
}

.diag-onboarding-entrega {
  background: rgba(0, 62, 165, .08);
  border-radius: 8px;
  padding: .65rem .8rem;
  margin-bottom: .7rem;
}
.diag-onboarding-entrega p {
  margin-bottom: .35rem;
  color: #e0e4ea;
  font-weight: 600;
  font-size: .82rem;
}
.diag-onboarding-doc-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .15rem .8rem;
}
.diag-doc-item {
  font-size: .75rem;
  color: #8a909a;
  padding: .2rem 0;
  line-height: 1.4;
}

.diag-onboarding-tempo {
  text-align: center;
  font-size: .75rem;
  color: #7a8290;
  margin-bottom: .8rem;
}

.diag-onboarding-cta {
  width: 100%;
  padding: .65rem;
  border: none;
  border-radius: 8px;
  background: #003EA5;
  color: #fff;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.diag-onboarding-cta:hover { background: #0050c8; }

@media (max-width: 500px) {
  .diag-onboarding-doc-preview { grid-template-columns: 1fr; }
}

/* ── Sidebar button ───────────────────────────────────────────────────── */

.nav-item-diag { margin-top: .3rem; }

/* ── Ferramentas pós-diagnóstico ──────────────────────────────────────── */

.diag-ferramentas-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  margin: .5rem 0;
}
.diag-ferramenta-btn {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  padding: .6rem .7rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: transparent;
  color: #e0e4ea;
  cursor: pointer;
  text-align: left;
  font-size: .8rem;
  transition: border-color .2s, background .2s;
}
.diag-ferramenta-btn:hover {
  border-color: #00AEEF;
  background: rgba(0, 174, 239, .05);
}
.diag-ferramenta-btn strong { font-size: .8rem; }
.diag-ferramenta-btn small { color: #7a8290; font-size: .7rem; }

@media (max-width: 600px) {
  .diag-ferramentas-grid { grid-template-columns: 1fr; }
}

/* ── Sair ──────────────────────────────────────────────────────────────── */

.diag-sair {
  width: 100%;
  margin-top: .5rem;
  padding: .4rem;
  background: transparent;
  color: #7a8290;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  cursor: pointer;
  font-size: .78rem;
  transition: color .2s;
}
.diag-sair:hover { color: #a0a8b4; }
