/* ============================================================
   MapeaMente — Componentes reutilizáveis
   Botões, cards, badges, inputs, barras.
   ============================================================ */

body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(45, 107, 255, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(0, 212, 255, 0.07), transparent 60%),
    var(--preto);
  color: var(--texto);
  font-family: var(--fonte-corpo);
  font-size: 16px;
}

h1, h2, h3, h4 {
  font-family: var(--fonte-titulo);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

/* ---------- Fundo decorativo global (textura de painel) ---------- */
.fundo-decor {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.grid-decor {
  position: absolute;
  inset: -2px;
  background-image:
    linear-gradient(to right, rgba(45,107,255,0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(45,107,255,0.06) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 75%);
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 75%);
  animation: deslizar-grade 18s linear infinite;
}
.orbe {
  position: absolute;
  border-radius: 50%;
  filter: blur(55px);
  opacity: 0.5;
  will-change: transform;
}
.grid-decor { will-change: background-position; }
.orbe-1 {
  width: 380px; height: 380px;
  top: -120px; right: -80px;
  background: radial-gradient(circle, rgba(45,107,255,0.55), transparent 70%);
  animation: derivar-1 22s ease-in-out infinite;
}
.orbe-2 {
  width: 320px; height: 320px;
  bottom: -120px; left: -100px;
  background: radial-gradient(circle, rgba(0,212,255,0.40), transparent 70%);
  animation: derivar-2 26s ease-in-out infinite;
}
.orbe-3 {
  width: 240px; height: 240px;
  top: 40%; left: 60%;
  background: radial-gradient(circle, rgba(26,58,143,0.55), transparent 70%);
  animation: derivar-1 30s ease-in-out infinite reverse;
}

/* ---------- Cartão com brilho varrendo ---------- */
.com-varredura { position: relative; overflow: hidden; }
.com-varredura::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
  transform: translateX(-120%) skewX(-20deg);
  pointer-events: none;
}
.com-varredura:hover::before { animation: varrer 900ms ease; }

/* ---------- Chips informativos ---------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: var(--preto-elevado);
  border: 1px solid var(--borda);
  font-size: 13px;
  font-weight: 600;
  color: var(--texto-suave);
}
.chip svg { color: var(--azul-eletrico); }

/* ---------- Tira de estatísticas (dashboard) ---------- */
.tira-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
}
.stat {
  position: relative;
  padding: var(--sp-4);
  background: linear-gradient(160deg, var(--preto-card), var(--preto-elevado));
  border: 1px solid var(--borda);
  border-radius: var(--r-sm);
  text-align: center;
  overflow: hidden;
}
.stat .num {
  font-family: var(--fonte-titulo);
  font-weight: 800;
  font-size: 26px;
  background: linear-gradient(120deg, var(--azul-claro), var(--azul-eletrico));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat .rot { font-size: 12px; color: var(--texto-suave); }

/* ---------- Passos "como funciona" ---------- */
.passos {
  display: grid;
  gap: var(--sp-3);
}
.passo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--preto-card);
  border: 1px solid var(--borda);
  border-radius: var(--r-sm);
}
.passo .n {
  flex: 0 0 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(45,107,255,0.14);
  border: 1px solid rgba(45,107,255,0.4);
  color: var(--azul-claro);
  font-family: var(--fonte-titulo);
  font-weight: 800;
}
.passo .txt h4 { font-size: 15px; }
.passo .txt p { font-size: 13px; color: var(--texto-suave); }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 52px;
  padding: 0 var(--sp-6);
  border-radius: var(--r-pill);
  font-family: var(--fonte-titulo);
  font-weight: 600;
  font-size: 16px;
  transition: transform 120ms ease, box-shadow 200ms ease, background 200ms ease, border-color 200ms ease;
}
.btn:active { transform: scale(0.98); }

.btn-primario {
  background: linear-gradient(135deg, var(--azul), var(--azul-claro));
  color: #fff;
  box-shadow: var(--glow-azul);
}
.btn-primario:hover {
  box-shadow: 0 0 34px rgba(45, 107, 255, 0.45);
  transform: translateY(-2px);
}
.btn-primario:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-fantasma {
  background: var(--preto-elevado);
  color: var(--texto);
  border: 1px solid var(--borda);
}
.btn-fantasma:hover {
  border-color: var(--azul);
  box-shadow: var(--glow-azul);
}

.btn-bloco { width: 100%; }

/* ---------- Cards ---------- */
.card {
  background: var(--preto-card);
  border: 1px solid var(--borda);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  box-shadow: var(--sombra-card);
}

/* ---------- Badges / pills ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 4px 12px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--fonte-titulo);
}
.badge-feito {
  background: rgba(47, 224, 140, 0.12);
  color: var(--sucesso);
  border: 1px solid rgba(47, 224, 140, 0.35);
}
.badge-nota {
  background: rgba(45, 107, 255, 0.14);
  color: var(--azul-claro);
  border: 1px solid rgba(45, 107, 255, 0.35);
}

/* ---------- Inputs ---------- */
.campo {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}
.campo label {
  font-size: 14px;
  color: var(--texto-suave);
  font-weight: 600;
}
.campo input,
.campo select {
  width: 100%;
  min-height: 50px;
  padding: 0 var(--sp-4);
  background: var(--preto-elevado);
  border: 1px solid var(--borda);
  border-radius: var(--r-sm);
  color: var(--texto);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.campo input:focus,
.campo select:focus {
  border-color: var(--azul);
  box-shadow: var(--glow-azul);
}
.campo select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%239A9AB0' stroke-width='2'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sp-4) center;
  padding-right: var(--sp-8);
}
.campo select:disabled { opacity: 0.5; }

.erro-campo {
  color: var(--erro);
  font-size: 13px;
  min-height: 16px;
}
.dica-campo {
  font-size: 12px;
  color: var(--texto-suave);
}

/* ---------- Barra de progresso ---------- */
.barra-progresso {
  width: 100%;
  height: 8px;
  background: var(--preto-elevado);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.barra-progresso > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--azul), var(--azul-eletrico));
  border-radius: var(--r-pill);
  transition: width 300ms ease-in-out;
}

/* ---------- Abas ---------- */
.abas {
  display: flex;
  gap: var(--sp-2);
  background: var(--preto-elevado);
  padding: var(--sp-1);
  border-radius: var(--r-pill);
  margin-bottom: var(--sp-6);
}
.aba {
  flex: 1;
  min-height: 44px;
  border-radius: var(--r-pill);
  color: var(--texto-suave);
  font-family: var(--fonte-titulo);
  font-weight: 600;
  transition: background 200ms ease, color 200ms ease;
}
.aba.ativa {
  background: linear-gradient(135deg, var(--azul), var(--azul-claro));
  color: #fff;
  box-shadow: var(--glow-azul);
}

/* ---------- Ícones de topo ---------- */
.barra-topo {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
  flex-wrap: wrap;
}
.icones-topo { display: flex; gap: var(--sp-2); flex-wrap: wrap; justify-content: flex-end; }
.btn-icone {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--preto-elevado);
  border: 1px solid var(--borda);
  color: var(--texto-suave);
  transition: border-color 180ms ease, color 180ms ease;
}
.btn-icone:hover { border-color: var(--azul); color: var(--azul-claro); }

/* Controle de tamanho de fonte */
.fonte-ctrl {
  display: inline-flex;
  align-items: center;
  background: var(--preto-elevado);
  border: 1px solid var(--borda);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.fonte-ctrl button {
  min-width: 38px;
  height: 44px;
  color: var(--texto-suave);
  font-family: var(--fonte-titulo);
  font-weight: 700;
  font-size: 14px;
  transition: background 160ms ease, color 160ms ease;
}
.fonte-ctrl button:first-child { border-right: 1px solid var(--borda); }
.fonte-ctrl button:last-child { border-left: 1px solid var(--borda); }
.fonte-ctrl button:hover { background: rgba(45,107,255,0.12); color: var(--azul-claro); }
.fonte-ctrl .fonte-rot {
  min-width: 46px;
  text-align: center;
  font-family: var(--fonte-titulo);
  font-size: 13px;
  color: var(--texto-suave);
}

/* Modal genérico */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  place-items: center;
  padding: var(--sp-4);
  background: rgba(5, 5, 12, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal-overlay.aberto { display: grid; animation: entrar-tela 200ms ease; }
.modal-caixa {
  width: min(100%, 420px);
  background: var(--preto-card);
  border: 1px solid var(--borda);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  box-shadow: var(--sombra-card);
}
.modal-titulo { font-size: 22px; margin-bottom: var(--sp-3); }
.modal-texto { color: var(--texto-suave); line-height: 1.6; margin-bottom: var(--sp-6); }
.modal-acoes { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.modal-acoes .btn { flex: 1; min-width: 130px; }

/* Interruptor (switch) */
.switch {
  appearance: none;
  -webkit-appearance: none;
  width: 52px; height: 30px;
  flex: 0 0 auto;
  border-radius: var(--r-pill);
  background: var(--preto-elevado);
  border: 1px solid var(--borda);
  position: relative;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--texto-suave);
  transition: transform 200ms ease, background 200ms ease;
}
.switch:checked {
  background: linear-gradient(135deg, var(--azul), var(--azul-claro));
  border-color: var(--azul);
}
.switch:checked::after { transform: translateX(22px); background: #fff; }
