/* ================================================================
   StrucKeys — tema do painel
   Base escura com neon #20c997, no padrão dos painéis que servem
   de modelo: fundo circuito, cartões translúcidos, brilho suave.
   ================================================================ */

:root {
  --fundo: #0a0b0f;
  --cartao: rgba(14, 18, 26, 0.94);
  --borda: rgba(32, 201, 151, 0.22);
  --borda-forte: rgba(32, 201, 151, 0.5);
  --acento: #20c997;
  --acento-2: #00e5a3;
  --texto: #e2e8f0;
  --texto-suave: #8a94a6;
  --texto-fraco: #64748b;
  --erro: #ff6b6b;
  --ok: #20c997;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--fundo);
  color: var(--texto);
  min-height: 100vh;
  line-height: 1.5;
}

a { color: var(--acento); }

/* ── Fundo circuito ─────────────────────────────────────────── */
.cyber-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 50% 30%, rgba(32, 201, 151, 0.08) 0%, transparent 60%),
    linear-gradient(rgba(32, 201, 151, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 201, 151, 0.03) 1px, transparent 1px);
  background-size: 100% 100%, 48px 48px, 48px 48px;
}

#particleCanvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* ── Cartão central (desafio / login) ───────────────────────── */
.portal-wrap {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

.portal-card {
  width: 460px;
  max-width: 94vw;
  background: var(--cartao);
  border: 1px solid var(--borda);
  border-radius: 18px;
  padding: 40px 32px 28px;
  text-align: center;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.8),
    0 0 50px rgba(32, 201, 151, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
  animation: cartaoIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cartaoIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.portal-logo {
  width: 58px;
  height: 58px;
  margin-bottom: 14px;
  filter: drop-shadow(0 0 16px rgba(32, 201, 151, 0.4));
}

.portal-title {
  font-size: 21px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.portal-title span {
  background: linear-gradient(135deg, var(--acento), var(--acento-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.portal-subtitle {
  font-size: 13px;
  color: var(--texto-suave);
  line-height: 1.5;
  margin-bottom: 24px;
}

/* ── Puzzle de slider ───────────────────────────────────────── */
.puzzle-chamber {
  background: #090c12;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 22px 18px;
  margin-bottom: 18px;
  text-align: left;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

.chamber-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--texto-fraco);
  margin-bottom: 14px;
}

.chamber-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--acento);
  font-weight: 600;
}

.chamber-status-dot {
  width: 7px;
  height: 7px;
  background: var(--acento);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--acento);
  animation: pulseDot 1.6s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.85); }
}

.slider-rail {
  position: relative;
  height: 62px;
  background: #111622;
  border: 1px solid rgba(32, 201, 151, 0.15);
  border-radius: 12px;
  overflow: hidden;
  touch-action: none !important;
  -webkit-user-select: none;
  user-select: none;
}

.rail-glow-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(32, 201, 151, 0.12), rgba(32, 201, 151, 0.3));
  pointer-events: none;
}

.rail-hint-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--texto-fraco);
  letter-spacing: 0.8px;
  pointer-events: none;
  transition: opacity 0.2s;
}

.target-slot {
  position: absolute;
  top: 6px;
  bottom: 6px;
  width: 50px;
  border: 2px dashed rgba(32, 201, 151, 0.5);
  border-radius: 10px;
  background: rgba(32, 201, 151, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  pointer-events: none;
  box-shadow: 0 0 12px rgba(32, 201, 151, 0.1);
}

.target-slot svg {
  width: 20px;
  height: 20px;
  stroke: rgba(32, 201, 151, 0.6);
  fill: none;
  stroke-width: 2;
}

.target-slot.active-lock {
  border-color: var(--acento);
  background: rgba(32, 201, 151, 0.25);
  box-shadow: 0 0 24px rgba(32, 201, 151, 0.5);
  transform: scale(1.05);
}

.slider-handle {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--acento), #0ca678);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  z-index: 5;
  box-shadow: 0 4px 16px rgba(32, 201, 151, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: box-shadow 0.2s;
  touch-action: none;
}

.slider-handle svg {
  width: 24px;
  height: 24px;
  stroke: #0a0b0f;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.slider-handle:active, .slider-handle.dragging { cursor: grabbing; }

.feedback-label {
  margin-top: 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--texto-suave);
  min-height: 18px;
  text-align: center;
}
.feedback-label.success { color: var(--ok); font-weight: 600; }
.feedback-label.error   { color: var(--erro); font-weight: 600; }

/* ── Formulários ────────────────────────────────────────────── */
.campo { margin-bottom: 14px; text-align: left; }

.campo label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--texto-fraco);
  margin-bottom: 6px;
  font-weight: 600;
}

.campo input {
  width: 100%;
  padding: 12px 14px;
  background: #0d1119;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--texto);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.campo input:focus {
  border-color: var(--acento);
  box-shadow: 0 0 0 3px rgba(32, 201, 151, 0.15);
}

.campo input::placeholder { color: #475569; }

.btn-principal {
  width: 100%;
  padding: 13px;
  margin-top: 6px;
  background: linear-gradient(135deg, var(--acento), #0ca678);
  border: none;
  border-radius: 10px;
  color: #06130f;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
  box-shadow: 0 6px 20px rgba(32, 201, 151, 0.25);
}

.btn-principal:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 26px rgba(32, 201, 151, 0.4);
}

.btn-principal:disabled { opacity: 0.55; cursor: not-allowed; }

.mensagem {
  min-height: 20px;
  margin-top: 10px;
  font-size: 13px;
  text-align: center;
}
.mensagem.erro  { color: var(--erro); }
.mensagem.ok    { color: var(--ok); }

/* ── Bloco do QR (ativação do 2FA) ──────────────────────────── */
.dua-etapa {
  border: 1px solid rgba(32, 201, 151, 0.3);
  border-radius: 14px;
  background: #0d131c;
  padding: 18px;
  margin-bottom: 16px;
  text-align: center;
}

.dua-etapa h3 {
  font-size: 14px;
  color: var(--acento);
  margin-bottom: 10px;
  letter-spacing: 0.4px;
}

#quadroQr {
  display: inline-block;
  padding: 10px;
  background: #fff;
  border-radius: 12px;
  margin-bottom: 12px;
  line-height: 0;
}

#quadroQr img, #quadroQr svg { display: block; }

.segredo-mostrado {
  font-family: ui-monospace, 'Cascadia Mono', Menlo, monospace;
  font-size: 13px;
  color: var(--texto-suave);
  background: #0a0e15;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 8px 10px;
  margin: 8px 0 12px;
  word-break: break-all;
  -webkit-user-select: text !important;
  user-select: text !important;
}

.dica-app { font-size: 12px; color: var(--texto-fraco); margin-bottom: 4px; }

/* ── Rodapé dos portais ─────────────────────────────────────── */
.portal-footer {
  margin-top: 18px;
  font-size: 12px;
  color: #475569;
  line-height: 1.6;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 14px;
  text-align: center;
}

.portal-footer a { text-decoration: none; opacity: 0.75; }
.portal-footer a:hover { opacity: 1; }

/* ── Tela de sucesso (challenge) ────────────────────────────── */
.success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 11, 15, 0.95);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  backdrop-filter: blur(20px);
}

.success-overlay.visible { opacity: 1; pointer-events: auto; }

.success-icon-wrap {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: rgba(32, 201, 151, 0.12);
  border: 2px solid var(--acento);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 60px rgba(32, 201, 151, 0.45);
}

.success-icon-wrap svg {
  width: 40px;
  height: 40px;
  stroke: var(--acento);
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.success-title { font-size: 20px; font-weight: 700; color: #fff; }
.success-desc  { font-size: 13px; color: var(--texto-suave); }

/* ── Área logada (estilo ERP) ───────────────────────────────── */
.app {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.barra-lateral {
  background: #0c1017;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.barra-lateral .marca {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #fff;
  font-size: 15px;
  padding: 6px 10px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 14px;
}

.barra-lateral .marca img { width: 28px; height: 28px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: none;
  color: var(--texto-suave);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.nav-item svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.nav-item:hover { background: rgba(255, 255, 255, 0.04); color: var(--texto); }

.nav-item.ativa {
  background: rgba(32, 201, 151, 0.12);
  color: var(--acento);
}

.nav-separador {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: #3f4a5a;
  padding: 14px 12px 6px;
}

.barra-lateral .rodape-nav { margin-top: auto; }

.conteudo { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(12, 16, 23, 0.8);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar h1 { font-size: 18px; color: #fff; font-weight: 700; }

.topbar-direita { display: flex; align-items: center; gap: 14px; }

.usuario {
  font-size: 12.5px;
  color: var(--texto-suave);
  display: flex;
  align-items: center;
  gap: 8px;
}

.usuario .avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(32, 201, 151, 0.15);
  border: 1px solid var(--borda);
  color: var(--acento);
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pagina { padding: 26px 28px 48px; }

/* estatísticas */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}

.stat {
  background: var(--cartao);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 18px;
}

.stat .rotulo {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--texto-fraco);
  font-weight: 700;
  margin-bottom: 8px;
}

.stat .valor { font-size: 28px; font-weight: 800; color: #fff; }
.stat .valor.pequeno { font-size: 15px; color: var(--acento); padding-top: 7px; }

.painel-bloco {
  background: var(--cartao);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 20px;
}

.painel-bloco h2 {
  font-size: 15px;
  color: #fff;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.painel-bloco h2 .ponto {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--acento);
  box-shadow: 0 0 10px var(--acento);
}

/* tabela de bens */
.busca {
  width: 100%;
  padding: 11px 14px;
  background: #0d1119;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--texto);
  font-size: 14px;
  outline: none;
  margin-bottom: 16px;
}

.busca:focus { border-color: var(--acento); }

.categoria-bloco { margin-bottom: 18px; }

.categoria-titulo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--acento);
  font-weight: 800;
  padding: 4px 2px 8px;
  border-bottom: 1px solid rgba(32, 201, 151, 0.2);
  margin-bottom: 6px;
}

.categoria-titulo .qtd {
  font-size: 10px;
  background: rgba(32, 201, 151, 0.15);
  border: 1px solid var(--borda);
  padding: 2px 8px;
  border-radius: 20px;
  color: var(--texto-suave);
  letter-spacing: 0.5px;
}

.linha-bem {
  display: grid;
  grid-template-columns: 34px 1fr auto auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 8px;
  border-radius: 10px;
  transition: background 0.15s;
}

.linha-bem:hover { background: rgba(255, 255, 255, 0.03); }

.linha-bem .tipo-icone {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #0d131c;
  border: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: ui-monospace, monospace;
  font-size: 10px;
  font-weight: 700;
  color: var(--acento);
  text-transform: uppercase;
}

.linha-bem .nome { font-size: 13.5px; color: var(--texto); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linha-bem .meta { font-size: 11.5px; color: var(--texto-fraco); white-space: nowrap; }

.btn-baixar {
  padding: 8px 16px;
  border: 1px solid var(--borda-forte);
  border-radius: 9px;
  background: rgba(32, 201, 151, 0.08);
  color: var(--acento);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.btn-baixar:hover {
  background: rgba(32, 201, 151, 0.18);
  box-shadow: 0 0 14px rgba(32, 201, 151, 0.25);
}

.vazio {
  padding: 30px;
  text-align: center;
  color: var(--texto-fraco);
  font-size: 13px;
}

.carregando {
  padding: 40px;
  text-align: center;
  color: var(--texto-suave);
  font-size: 14px;
}

/* páginas institucionais simples */
.doc {
  position: relative;
  z-index: 10;
  max-width: 760px;
  margin: 0 auto;
  padding: 70px 24px 60px;
}

.doc h1 { font-size: 26px; color: #fff; margin-bottom: 18px; }
.doc h2 { font-size: 17px; color: var(--acento); margin: 22px 0 8px; }
.doc p, .doc li { font-size: 14px; color: var(--texto-suave); margin-bottom: 10px; }
.doc ul { padding-left: 20px; }
.doc .voltar { display: inline-block; margin-bottom: 24px; font-size: 13px; text-decoration: none; }

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .barra-lateral {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    padding: 10px;
  }
  .barra-lateral .marca { border-bottom: none; padding: 4px 10px; margin: 0; }
  .nav-separador, .rodape-nav { display: none; }
  .nav-item { width: auto; }
  .linha-bem { grid-template-columns: 34px 1fr auto; }
  .linha-bem .meta:nth-of-type(2) { display: none; }
}
