/* ============================================================
   /assets/css/global.css
   Componentes globais reutilizáveis
   ============================================================ */

/* ── Botões ──────────────────────────────────────────────── */
.np-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--np-radius);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  transition: background var(--np-transition), opacity var(--np-transition), transform var(--np-transition);
  cursor: pointer;
  border: none;
  white-space: nowrap;
}
.np-btn:active { transform: scale(0.98); }
.np-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.np-btn-primary {
  background: var(--np-red);
  color: #fff;
}
.np-btn-primary:hover { background: var(--np-red-dark); }

.np-btn-ghost {
  background: transparent;
  color: var(--np-text-2);
  border: 1px solid var(--np-border-2);
}
.np-btn-ghost:hover { background: var(--np-surface-2); }

.np-btn-block { width: 100%; }

.np-btn-sm { padding: 6px 14px; font-size: 12px; }

/* ── Inputs ──────────────────────────────────────────────── */
.np-field { display: flex; flex-direction: column; gap: 5px; }

.np-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--np-text-2);
  display: flex;
  align-items: center;
  gap: 5px;
}

.np-input-wrap { position: relative; }

.np-input {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 40px;
  border: 1.5px solid var(--np-border);
  border-radius: var(--np-radius);
  font-size: 14px;
  color: var(--np-text);
  background: var(--np-surface);
  transition: border-color var(--np-transition), box-shadow var(--np-transition);
  outline: none;
}
.np-input:focus {
  border-color: var(--np-red);
  box-shadow: 0 0 0 3px var(--np-red-muted);
}
.np-input::placeholder { color: var(--np-text-3); }

.np-input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--np-text-3);
  pointer-events: none;
}

/* ── Alertas ─────────────────────────────────────────────── */
.np-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--np-radius);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}
.np-alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }

.np-alert-success { background: var(--np-success-bg); color: var(--np-success-text); }
.np-alert-danger  { background: var(--np-danger-bg);  color: var(--np-danger-text); }
.np-alert-warning { background: var(--np-warning-bg); color: var(--np-warning-text); }
.np-alert-info    { background: var(--np-info-bg);    color: var(--np-info-text); }

/* ── Cards ───────────────────────────────────────────────── */
.np-card {
  background: var(--np-surface);
  border-radius: var(--np-radius-lg);
  border: 1px solid var(--np-border);
  box-shadow: var(--np-shadow);
}

/* ── Spinner ─────────────────────────────────────────────── */
.np-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: np-spin 0.7s linear infinite;
}
@keyframes np-spin { to { transform: rotate(360deg); } }

/* ── Modal ───────────────────────────────────────────────── */
.np-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.np-modal-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}
.np-modal {
  background: var(--np-surface);
  border-radius: var(--np-radius-xl);
  width: 100%;
  max-width: 420px;
  margin: 16px;
  box-shadow: var(--np-shadow-md);
  transform: translateY(12px);
  transition: transform 0.22s ease;
}
.np-modal-overlay.is-open .np-modal { transform: translateY(0); }

.np-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--np-border);
}
.np-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--np-text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.np-modal-title svg { width: 18px; height: 18px; color: var(--np-red); }
.np-modal-close {
  width: 30px; height: 30px;
  border-radius: var(--np-radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--np-text-3);
  transition: background var(--np-transition);
}
.np-modal-close:hover { background: var(--np-surface-2); color: var(--np-text); }
.np-modal-close svg { width: 16px; height: 16px; }

.np-modal-body { padding: 20px 24px; }
.np-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px 20px;
  border-top: 1px solid var(--np-border);
}

/* ── Switch / Toggle ─────────────────────────────────────── */
.np-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.np-switch input { display: none; }
.np-switch-track {
  width: 36px; height: 20px;
  background: var(--np-border-2);
  border-radius: 99px;
  position: relative;
  transition: background 0.2s;
}
.np-switch-track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.np-switch input:checked + .np-switch-track { background: var(--np-red); }
.np-switch input:checked + .np-switch-track::after { transform: translateX(16px); }
.np-switch-label { font-size: 13px; color: var(--np-text-2); }

/* ── Utilitários ─────────────────────────────────────────── */
.np-text-sm  { font-size: 13px; }
.np-text-xs  { font-size: 11px; }
.np-text-2   { color: var(--np-text-2); }
.np-text-3   { color: var(--np-text-3); }
.np-hidden   { display: none !important; }

@media (min-width: 768px) { .np-hidden-desktop { display: none !important; } }
@media (max-width: 767px) { .np-hidden-mobile  { display: none !important; } }
