/* ═══════════════════════════════════════════════════════════════
   Compliance Avant — global.css
   Reset + Tokens + Componentes reutilizáveis em todas as páginas
═══════════════════════════════════════════════════════════════ */


/* ──────────────────────────────────────────────────────────────
   1. RESET
────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

ul, ol { list-style: none; }


/* ──────────────────────────────────────────────────────────────
   2. TOKENS — variáveis CSS globais
────────────────────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg:          #0d0f12;
  --surface:     #13161b;
  --surface-2:   #1a1e25;

  /* Bordas */
  --border:      #252a33;
  --border-2:    #2f3540;

  /* Acento principal: verde */
  --green:       #2dffa0;
  --green-dim:   #1acc7a;
  --green-glow:  rgba(45, 255, 160, 0.18);

  /* Perigo */
  --red:         #ff4f4f;
  --red-dim:     rgba(255, 79, 79, 0.12);

  /* Texto */
  --text:        #e8edf5;
  --text-soft:   #9aa3b0;
  --text-muted:  #6b7585;

  /* Forma */
  --radius:      10px;
  --radius-sm:   6px;
  --radius-lg:   14px;

  /* Layout */
  --sidebar-w:   240px;
  --topbar-h:    72px;

  /* Sombras */
  --shadow:      0 4px 24px rgba(0, 0, 0, 0.45);
  --shadow-sm:   0 2px 10px rgba(0, 0, 0, 0.3);
}


/* ──────────────────────────────────────────────────────────────
   3. SCROLLBAR personalizada
────────────────────────────────────────────────────────────── */
::-webkit-scrollbar              { width: 6px; height: 6px; }
::-webkit-scrollbar-track        { background: var(--surface); }
::-webkit-scrollbar-thumb        { background: var(--border-2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover  { background: var(--text-muted); }


/* ──────────────────────────────────────────────────────────────
   4. TIPOGRAFIA utilitária
────────────────────────────────────────────────────────────── */
.font-display {
  font-family: 'Syne', sans-serif;
}

.text-muted  { color: var(--text-muted); }
.text-soft   { color: var(--text-soft); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }

.text-sm  { font-size: .8rem; }
.text-xs  { font-size: .72rem; }


/* ──────────────────────────────────────────────────────────────
   5. BOTÕES
────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: filter .18s, transform .12s, background .15s;
  white-space: nowrap;
  line-height: 1;
}

.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.btn:active  { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

/* Variantes */
.btn-primary {
  background: var(--green);
  color: #0a0d0f;
  font-weight: 700;
  box-shadow: 0 0 18px var(--green-glow);
}
.btn-primary:hover { filter: brightness(1.1); }

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

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(255, 79, 79, .25);
}
.btn-danger:hover { background: rgba(255, 79, 79, .22); }

/* Tamanhos */
.btn-sm { padding: 6px 13px; font-size: .8rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }


/* ──────────────────────────────────────────────────────────────
   6. INPUTS / FORMULÁRIOS
────────────────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: .73rem;
  font-weight: 600;
  color: var(--text-soft);
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* Wrapper para ícone dentro do input */
.input-wrap { position: relative; }

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

.form-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .9rem;
  padding: 13px 15px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}

/* Com ícone à esquerda */
.input-wrap .form-input { padding-left: 38px; }

/* Com botão à direita (ex: toggle senha) */
.input-wrap .form-input.has-action { padding-right: 40px; }

.form-input:focus {
  border-color: var(--green-dim);
  box-shadow: 0 0 0 3px var(--green-glow);
}

.form-input::placeholder { color: var(--text-muted); }

.form-hint {
  font-size: .75rem;
  color: var(--text-muted);
}


/* ──────────────────────────────────────────────────────────────
   7. BADGE
────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: .73rem;
  font-weight: 500;
  background: var(--surface-2);
  color: var(--text-soft);
  border: 1px solid var(--border-2);
  white-space: nowrap;
}


/* ──────────────────────────────────────────────────────────────
   8. SPINNER (carregamento)
────────────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid var(--border-2);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Spinner dentro de btn-primary (fundo escuro) */
.btn-primary .spinner {
  border-color: rgba(0, 0, 0, .2);
  border-top-color: #0a0d0f;
}

@keyframes spin { to { transform: rotate(360deg); } }


/* ──────────────────────────────────────────────────────────────
   9. TOAST / notificações
────────────────────────────────────────────────────────────── */
.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: .86rem;
  color: var(--text);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  max-width: 340px;
  pointer-events: all;
  animation: toastIn .25s ease forwards;
}

.toast.removing { animation: toastOut .25s ease forwards; }

.toast-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.toast.success .toast-dot { background: var(--green); box-shadow: 0 0 6px var(--green); }
.toast.error   .toast-dot { background: var(--red);   box-shadow: 0 0 6px var(--red);   }
.toast.info    .toast-dot { background: #4da6ff;       box-shadow: 0 0 6px #4da6ff;       }

@keyframes toastIn  { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(18px); } }


/* ──────────────────────────────────────────────────────────────
   10. ANIMAÇÃO de entrada genérica
────────────────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

.animate-fade-up {
  animation: fadeUp .35s cubic-bezier(.22, 1, .36, 1) both;
}


/* ──────────────────────────────────────────────────────────────
   11. PULSE (ponto piscando — status conectado)
────────────────────────────────────────────────────────────── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .35; }
}

.pulse { animation: pulse 2.4s ease-in-out infinite; }