/*
 * Componentes básicos do Painel VIP: botão, rótulo, campo e aviso.
 * Ficam fora do painel.css para não se perderem quando ele for copiado
 * de novo do Dashboard Formalização.
 */

/* ===== botão ===== */
.p-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 20px; flex-shrink: 0;
  border: 1px solid transparent; border-radius: 6px;
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  font: inherit; font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap;
  text-decoration: none; cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.p-btn:hover { background: hsl(var(--primary) / 0.88); }
.p-btn:active { transform: scale(0.98); }
.p-btn:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
.p-btn:disabled, .p-btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
.p-btn svg { width: 16px; height: 16px; flex-shrink: 0; pointer-events: none; }
.p-btn.contorno { background: hsl(var(--background)); color: hsl(var(--foreground)); border-color: hsl(var(--input)); box-shadow: none; }
.p-btn.contorno:hover { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }
.p-btn.perigo { background: hsl(var(--destructive)); color: hsl(var(--destructive-foreground)); }
.p-btn.perigo:hover { background: hsl(var(--destructive) / 0.88); }
.p-btn.preto { background: #000; color: #ffcc00; }
.p-btn.preto:hover { background: #1a1a1a; }
.p-btn.pequeno { height: 32px; padding: 0 12px; font-size: 13px; }

/* ===== rótulo e campo ===== */
.p-rotulo { display: block; font-size: 14px; font-weight: 600; line-height: 1; color: hsl(var(--foreground)); }
.p-campo {
  display: flex; width: 100%; height: 40px; padding: 8px 12px;
  border: 1px solid hsl(var(--input)); border-radius: 6px;
  background: hsl(var(--background)); color: hsl(var(--foreground));
  font: inherit; font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.p-campo::placeholder { color: hsl(var(--muted-foreground)); }
.p-campo:focus-visible { outline: none; border-color: hsl(var(--ring)); box-shadow: 0 0 0 3px hsl(var(--ring) / 0.25); }
.p-campo:disabled { opacity: 0.6; cursor: not-allowed; }
textarea.p-campo { height: auto; min-height: 96px; resize: vertical; }
.p-campo-erro { margin: 4px 0 0; font-size: 12.5px; color: hsl(var(--destructive)); }
.p-campo-ajuda { margin: 4px 0 0; font-size: 12.5px; color: hsl(var(--muted-foreground)); }
/* campo com ícone à esquerda (lupa, telefone…) */
.p-campo-ico { position: relative; }
.p-campo-ico > svg, .p-campo-ico > i { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: hsl(var(--muted-foreground)); pointer-events: none; }
.p-campo-ico > .p-campo { padding-left: 36px; }
.p-grupo-campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

/* ===== avisos (canto superior direito) ===== */
.p-avisos { position: fixed; top: 16px; right: 16px; z-index: 100; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.p-aviso {
  --cor: hsl(var(--info));
  position: relative; display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 40px 14px 16px; pointer-events: auto;
  background: hsl(var(--card)); color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border)); border-left: 4px solid var(--cor); border-radius: 8px;
  box-shadow: 0 10px 28px rgba(20, 20, 20, 0.12), 0 2px 6px rgba(20, 20, 20, 0.06);
  animation: p-aviso-entra 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.p-aviso.sucesso { --cor: hsl(var(--success)); }
.p-aviso.erro { --cor: hsl(var(--destructive)); }
.p-aviso.atencao { --cor: hsl(var(--warning)); }
.p-aviso.saindo { animation: p-aviso-sai 0.25s ease forwards; }
.p-aviso .av-ico { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; color: var(--cor); }
.p-aviso .av-tit { margin: 0; font-size: 14px; font-weight: 700; }
.p-aviso .av-txt { margin: 2px 0 0; font-size: 13.5px; color: hsl(var(--muted-foreground)); }
.p-aviso .av-fechar { position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: hsl(var(--muted-foreground)); font-size: 18px; line-height: 1; cursor: pointer; }
.p-aviso .av-fechar:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
@keyframes p-aviso-entra { from { opacity: 0; transform: translateX(24px); } }
@keyframes p-aviso-sai { to { opacity: 0; transform: translateX(24px); } }
@media (prefers-reduced-motion: reduce) { .p-aviso, .p-aviso.saindo { animation: none; } }
