/* ============================================================
   VELVETBOT — DESIGN SYSTEM
   Baseado na identidade visual do Velvet
   Dark mode por padrão + acento coral #FF6F61
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

/* ============================================================
   VARIÁVEIS
   ============================================================ */
:root {
  --primary: #FF6F61;
  --primary-hover: #e65b50;
  --primary-glow: rgba(255, 111, 97, 0.25);
  --primary-light: rgba(255, 111, 97, 0.12);

  /* Dark mode */
  --bg: #0a0a0a;
  --bg-card: #141414;
  --bg-card-hover: #1c1c1c;
  --bg-input: #1e1e1e;
  --border: rgba(255, 255, 255, 0.08);
  --border-active: rgba(255, 111, 97, 0.5);

  --text: #f0f0f0;
  --text-muted: #888;
  --text-dim: #555;

  --success: #00c896;
  --success-bg: rgba(0, 200, 150, 0.1);
  --warning: #f0a03a;
  --warning-bg: rgba(240, 160, 58, 0.1);
  --danger: #e05252;
  --danger-bg: rgba(224, 82, 82, 0.1);
  --info: #5b9cf6;
  --info-bg: rgba(91, 156, 246, 0.1);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-glow: 0 0 20px rgba(255, 111, 97, 0.2);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);
}

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

html { scroll-behavior: smooth; }

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

img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
input, textarea, select { font-family: inherit; }
a { text-decoration: none; color: inherit; }

/* ============================================================
   ANIMAÇÕES
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 var(--primary-glow); }
  50%       { box-shadow: 0 0 0 8px transparent; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.animate-fade  { animation: fadeIn 0.35s ease-out; }
.animate-slide { animation: slideUp 0.4s ease-out; }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* ============================================================
   SPINNER
   ============================================================ */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.spinner-overlay.hidden { display: none; }
.hidden { display: none !important; }

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.page { min-height: 100vh; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover { border-color: rgba(255,255,255,0.14); }

.card-glass {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 24px;
}

/* ============================================================
   INPUTS
   ============================================================ */
.input-field {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  color: var(--text);
  transition: all 0.25s;
  outline: none;
}

.input-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.input-field::placeholder { color: var(--text-dim); }

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.input-icon-wrap {
  position: relative;
}
.input-icon-wrap .input-field { padding-left: 44px; }
.input-icon-wrap .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 1rem;
}

/* ============================================================
   BOTÕES
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.2s;
  cursor: pointer;
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 16px rgba(255, 111, 97, 0.3);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: var(--shadow-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
  border-color: rgba(255,255,255,0.2);
  color: var(--text);
  background: rgba(255,255,255,0.04);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1.5px solid rgba(224, 82, 82, 0.2);
}
.btn-danger:hover:not(:disabled) { background: rgba(224,82,82,0.2); }

.btn-full { width: 100%; }
.btn-sm { padding: 7px 16px; font-size: 0.82rem; border-radius: var(--radius-sm); }

/* ============================================================
   BADGES / STATUS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger);  }
.badge-info    { background: var(--info-bg);    color: var(--info);    }
.badge-muted   { background: rgba(255,255,255,0.06); color: var(--text-muted); }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-outline { background: transparent; border: 1px dashed var(--border); color: var(--text-muted); }

/* ============================================================
   STAT CARDS (dashboard)
   ============================================================ */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color 0.2s, transform 0.2s;
}

.stat-card:hover {
  border-color: rgba(255,111,97,0.2);
  transform: translateY(-2px);
}

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-info { display: flex; flex-direction: column; gap: 2px; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; }
.stat-value { font-size: 1.5rem; font-weight: 800; color: var(--text); }

/* ============================================================
   TABELA
   ============================================================ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table thead th {
  background: rgba(255,255,255,0.03);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.data-table tbody td { padding: 13px 16px; color: var(--text); }

/* ============================================================
   ABAS (tabs)
   ============================================================ */
.tabs {
  display: flex;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 4px;
  gap: 2px;
  border: 1px solid var(--border);
}

.tab-btn {
  flex: 1;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tab-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(255,111,97,0.3);
}

.tab-btn:not(.active):hover { color: var(--text); background: rgba(255,255,255,0.05); }

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.25s ease-out; }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: sticky;
  top: 0;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar-brand span { color: var(--text); }

.navbar-actions { display: flex; align-items: center; gap: 12px; }

/* Avatar dropdown */
.avatar-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  border: 2px solid var(--primary);
  cursor: pointer;
  transition: transform 0.2s;
}
.avatar-btn:hover { transform: scale(1.08); }

/* ============================================================
   SIDEBAR (dashboard)
   ============================================================ */
.dashboard-layout {
  display: flex;
  min-height: calc(100vh - 60px);
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 24px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.sidebar-item i { font-size: 1rem; width: 18px; text-align: center; }
.sidebar-item:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.sidebar-item.active { background: var(--primary-light); color: var(--primary); }

.sidebar-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding: 14px 14px 6px;
}

.main-content {
  flex: 1;
  padding: 32px;
  min-width: 0;
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop.hidden { display: none; }

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 100%;
  max-width: 440px;
  animation: slideUp 0.3s ease-out;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.modal-close:hover { background: rgba(255,255,255,0.07); color: var(--text); }

/* ============================================================
   TOAST / ALERTAS
   ============================================================ */
.toast-container {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  min-width: 280px;
  max-width: 360px;
  animation: slideUp 0.3s ease-out;
  box-shadow: var(--shadow-card);
}

.toast.success { border-color: rgba(0,200,150,0.3); }
.toast.success i { color: var(--success); }
.toast.error   { border-color: rgba(224,82,82,0.3); }
.toast.error i { color: var(--danger); }
.toast.info    { border-color: rgba(91,156,246,0.3); }
.toast.info i  { color: var(--info); }

/* ============================================================
   STEP WIZARD (setup de integração)
   ============================================================ */
.step-wizard { display: flex; flex-direction: column; gap: 0; }

.wizard-step {
  display: flex;
  gap: 16px;
  position: relative;
}

.wizard-step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 40px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.step-number {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
  color: var(--text-muted);
  background: var(--bg);
  position: relative;
  z-index: 1;
}

.wizard-step.done .step-number {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--success);
}

.wizard-step.active .step-number {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.step-content { padding: 4px 0 24px; flex: 1; }
.step-content h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 6px; }
.step-content p  { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; }

/* ============================================================
   CODE / COPY BOX
   ============================================================ */
.code-box {
  background: #0d0d0d;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-family: 'Courier New', monospace;
  font-size: 0.88rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  word-break: break-all;
}

.copy-btn {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  transition: background 0.2s;
}
.copy-btn:hover { background: rgba(255,111,97,0.25); }

/* ============================================================
   LINK CARD
   ============================================================ */
.link-card {
  background: linear-gradient(135deg, rgba(255,111,97,0.12), rgba(255,111,97,0.04));
  border: 1px solid rgba(255,111,97,0.2);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
}

/* ============================================================
   SALDO CARD
   ============================================================ */
.saldo-hero {
  background: linear-gradient(135deg, #1a0d0c, #0a0a0a);
  border: 1px solid rgba(255,111,97,0.2);
  border-radius: var(--radius-xl);
  padding: 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.saldo-hero::before {
  content: '';
  position: absolute;
  top: -60px; left: 50%;
  transform: translateX(-50%);
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(255,111,97,0.15), transparent 70%);
  pointer-events: none;
}

.saldo-label { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.saldo-value { font-size: 2.8rem; font-weight: 900; color: var(--text); margin: 8px 0 4px; }
.saldo-sub { font-size: 0.85rem; color: var(--text-muted); }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state i { font-size: 3rem; color: var(--text-dim); margin-bottom: 16px; }
.empty-state h3 { font-size: 1rem; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; }
.empty-state p { font-size: 0.85rem; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .main-content { padding: 20px 16px; }
  .saldo-value { font-size: 2rem; }

  .stat-card { padding: 15px; }
  .stat-value { font-size: 1.2rem; }

  .navbar-brand { font-size: 1.2rem; }

  .modal-card { padding: 20px; }

  .tabs { gap: 0; }
  .tab-btn { font-size: 0.75rem; padding: 8px 6px; }

  .data-table thead th,
  .data-table tbody td { padding: 10px 12px; font-size: 0.82rem; }
}

@media (max-width: 480px) {
  .container { padding: 0 12px; }
  .main-content { padding: 16px 12px; }
  .card { padding: 16px; }
}

/* ============================================================
   MOBILE BOTTOM NAV (para mobile)
   ============================================================ */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(20, 20, 20, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  z-index: 200;
  padding: 8px 0 env(safe-area-inset-bottom, 8px);
}

.mobile-nav-items {
  display: flex;
  justify-content: space-around;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 16px;
  color: var(--text-dim);
  font-size: 0.65rem;
  font-weight: 700;
  transition: color 0.2s;
}

.mobile-nav-item i { font-size: 1.2rem; }
.mobile-nav-item.active { color: var(--primary); }

@media (max-width: 768px) {
  .mobile-nav { display: block; }
  .main-content { padding-bottom: 80px; }
}

/* ============================================================
   LANDING PAGE
   ============================================================ */
.landing-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 40px 20px;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,111,97,0.12) 0%, transparent 60%);
  position: relative;
}

.landing-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(255,111,97,0.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,111,97,0.06) 0%, transparent 50%);
  pointer-events: none;
}

.landing-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 24px;
  border: 1px solid rgba(255,111,97,0.2);
}

.landing-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  max-width: 700px;
}

.landing-title .highlight { color: var(--primary); }

.landing-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 520px;
  line-height: 1.7;
  margin-bottom: 36px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 40px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: left;
  transition: border-color 0.2s, transform 0.2s;
}
.feature-card:hover { border-color: rgba(255,111,97,0.2); transform: translateY(-3px); }
.feature-icon { font-size: 1.8rem; color: var(--primary); margin-bottom: 12px; }
.feature-title { font-weight: 800; margin-bottom: 6px; }
.feature-desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; }

/* ============================================================
   AUTH FORM
   ============================================================ */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(ellipse at 50% -20%, rgba(255,111,97,0.1) 0%, transparent 60%);
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px;
  width: 100%;
  max-width: 400px;
  animation: slideUp 0.4s ease-out;
}

.auth-logo {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 28px;
  letter-spacing: -0.02em;
}

.auth-tabs {
  display: flex;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 8px;
  text-align: center;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.2s;
  cursor: pointer;
}
.auth-tab.active { background: var(--primary); color: white; }
