/* =====================================================================
   CARTELPAY - Tema escuro premium (fintech) — versão com gradientes,
   glow e microanimações.
   ===================================================================== */

:root {
  --color-blue: #1677FF;
  --color-blue-light: #4C9AFF;
  --color-purple: #7C5CFF;
  --color-cyan: #00E0FF;
  --color-black: #0F1115;
  --color-gray: #1C1F26;
  --color-gray-light: #262A33;
  --color-white: #FFFFFF;
  --color-muted: #8A94A6;
  --color-success: #17C964;
  --color-warning: #F5A524;
  --color-danger: #F31260;
  --radius: 16px;
  --shadow: 0 8px 30px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 0 1px rgba(22,119,255,0.15), 0 8px 30px rgba(22,119,255,0.12);
  --gradient-brand: linear-gradient(135deg, var(--color-blue) 0%, var(--color-purple) 55%, var(--color-cyan) 100%);
  --gradient-brand-soft: linear-gradient(135deg, rgba(22,119,255,0.16) 0%, rgba(124,92,255,0.16) 55%, rgba(0,224,255,0.16) 100%);
  --transition: all .25s cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--color-black);
  background-image:
    radial-gradient(circle at 15% 0%, rgba(22,119,255,0.10) 0%, transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(124,92,255,0.08) 0%, transparent 45%);
  background-attachment: fixed;
  color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  animation: pageFadeIn .4s ease;
}

@keyframes pageFadeIn { from { opacity: 0; } to { opacity: 1; } }

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--color-black); }
::-webkit-scrollbar-thumb { background: var(--color-gray-light); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-blue); }

/* ---------- Utilities ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.text-muted { color: var(--color-muted); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.text-gradient {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 12px;
  border: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
}
.btn-primary {
  background: var(--gradient-brand);
  background-size: 200% 200%;
  color: #fff;
  box-shadow: 0 4px 18px rgba(22,119,255,0.35);
}
.btn-primary:hover {
  background-position: 100% 0;
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(22,119,255,0.5);
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--color-gray-light);
  color: #fff;
}
.btn-outline:hover {
  border-color: var(--color-blue);
  color: var(--color-blue-light);
  box-shadow: 0 0 0 3px rgba(22,119,255,0.12);
  transform: translateY(-1px);
}
.btn-danger { background: linear-gradient(135deg, var(--color-danger), #ff5a8a); color: #fff; box-shadow: 0 4px 16px rgba(243,18,96,0.35); }
.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(243,18,96,0.45); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-block { width: 100%; }

/* Efeito ripple ao clicar */
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  transform: scale(0);
  animation: rippleAnim .6s ease-out;
  pointer-events: none;
}
@keyframes rippleAnim { to { transform: scale(3); opacity: 0; } }

.card {
  position: relative;
  background: linear-gradient(180deg, var(--color-gray) 0%, #191c23 100%);
  border: 1px solid #262A33;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.card:hover { border-color: #33384a; box-shadow: var(--shadow-glow); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2px;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.badge-success { background: rgba(23,201,100,0.14); color: var(--color-success); }
.badge-warning { background: rgba(245,165,36,0.14); color: var(--color-warning); animation: pulseSoft 2s infinite; }
.badge-danger { background: rgba(243,18,96,0.14); color: var(--color-danger); }
.badge-info { background: rgba(22,119,255,0.14); color: var(--color-blue-light); }

@keyframes pulseSoft { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

.form-group { margin-bottom: 18px; }
.form-label { display: block; margin-bottom: 8px; font-size: 13px; color: var(--color-muted); font-weight: 500; }
.form-control {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #2A2F3A;
  background: #14161C;
  color: #fff;
  font-size: 14px;
  transition: var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--color-blue);
  box-shadow: 0 0 0 4px rgba(22,119,255,0.18);
  background: #171a21;
}
select.form-control { appearance: none; }

/* ---------- Landing ---------- */
.navbar-landing {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 0;
}
.logo { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.logo span { background: var(--gradient-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }

.hero {
  position: relative;
  padding: 100px 0 80px;
  text-align: center;
  overflow: hidden;
}
.hero::before, .hero::after {
  content: '';
  position: absolute;
  width: 480px; height: 480px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: .35;
  z-index: -1;
  animation: floatBlob 10s ease-in-out infinite;
}
.hero::before { background: var(--color-blue); top: -180px; left: -120px; }
.hero::after { background: var(--color-purple); top: -140px; right: -140px; animation-delay: 2s; }
@keyframes floatBlob {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(30px,40px) scale(1.1); }
}

.hero h1 {
  font-size: 54px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -1px;
}
.hero h1 span { background: var(--gradient-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p {
  font-size: 18px;
  color: var(--color-muted);
  max-width: 620px;
  margin: 0 auto 36px;
}
.hero-actions { display: flex; gap: 16px; justify-content: center; }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin: 60px 0;
}
.feature-card { transition: var(--transition); }
.feature-card:hover { transform: translateY(-6px); border-color: var(--color-blue); }
.feature-icon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: var(--gradient-brand-soft);
  border-radius: 12px;
  color: var(--color-blue-light);
  margin-bottom: 16px;
  font-size: 21px;
  transition: var(--transition);
}
.feature-card:hover .feature-icon { transform: scale(1.1) rotate(-4deg); box-shadow: 0 0 24px rgba(22,119,255,0.35); }

.footer-landing {
  border-top: 1px solid var(--color-gray-light);
  padding: 30px 0;
  text-align: center;
  color: var(--color-muted);
  font-size: 13px;
}

/* ---------- Auth pages ---------- */
.auth-wrapper {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background: #0F1115;
}
.auth-wrapper::before, .auth-wrapper::after {
  content: '';
  position: absolute;
  width: 420px; height: 420px;
  border-radius: 50%;
  filter: blur(130px);
  opacity: .28;
  animation: floatBlob 12s ease-in-out infinite;
}
.auth-wrapper::before { background: var(--color-blue); top: -140px; left: -100px; }
.auth-wrapper::after { background: var(--color-purple); bottom: -160px; right: -100px; animation-delay: 3s; }
.auth-box { width: 100%; max-width: 420px; position: relative; z-index: 1; }
.auth-box .logo { text-align: center; display: block; margin-bottom: 28px; font-size: 26px; }
.auth-links { text-align: center; margin-top: 18px; font-size: 14px; color: var(--color-muted); }
.auth-box .card, .auth-box form { animation: cardIn .4s ease; }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- App layout (dashboard) ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px;
  background: linear-gradient(180deg, var(--color-gray) 0%, #14161c 100%);
  border-right: 1px solid #22252E;
  padding: 22px 16px;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
  transition: width .2s ease;
  flex-shrink: 0;
}
.sidebar.collapsed { width: 76px; }
.sidebar.collapsed .nav-label, .sidebar.collapsed .sidebar-logo-text { display: none; }

.sidebar-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 30px; padding: 0 6px; }
.sidebar-logo-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--gradient-brand);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  box-shadow: 0 4px 16px rgba(22,119,255,0.4);
}

.nav-section-title { font-size: 11px; text-transform: uppercase; color: #565E6D; margin: 18px 6px 8px; letter-spacing: .5px; }
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px;
  border-radius: 11px;
  color: var(--color-muted);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: var(--transition);
}
.nav-item:hover { background: var(--color-gray-light); color: #fff; transform: translateX(2px); }
.nav-item.active {
  background: var(--gradient-brand-soft);
  color: var(--color-blue-light);
  box-shadow: inset 0 0 0 1px rgba(22,119,255,0.25);
}
.nav-item.active::before {
  content: '';
  position: absolute; left: -16px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 60%;
  background: var(--gradient-brand);
  border-radius: 4px;
}
.nav-icon { width: 20px; text-align: center; flex-shrink: 0; }

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

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid #22252E;
  position: sticky; top: 0; background: rgba(15,17,21,0.85);
  backdrop-filter: blur(10px);
  z-index: 20;
}
.topbar-title { font-size: 18px; font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-gray); border: 1px solid #262A33; cursor: pointer;
  color: var(--color-muted);
  transition: var(--transition);
}
.icon-btn:hover { color: #fff; border-color: var(--color-blue); box-shadow: 0 0 14px rgba(22,119,255,0.35); transform: translateY(-1px); }

.user-chip { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gradient-brand);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  box-shadow: 0 3px 12px rgba(22,119,255,0.4);
}

.page-content { padding: 28px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-bottom: 26px; }
.stat-card {
  border-left: 3px solid var(--color-blue);
  background:
    linear-gradient(180deg, var(--color-gray) 0%, #191c23 100%) padding-box;
}
.stat-label { color: var(--color-muted); font-size: 13px; margin-bottom: 8px; }
.stat-value {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(90deg, #fff 0%, #c7d3ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-trend { font-size: 12px; margin-top: 6px; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data-table th {
  text-align: left; padding: 12px 16px; color: var(--color-muted);
  font-weight: 600; font-size: 12px; text-transform: uppercase;
  border-bottom: 1px solid #22252E;
}
table.data-table td { padding: 14px 16px; border-bottom: 1px solid #1B1E25; transition: var(--transition); }
table.data-table tr:hover td { background: rgba(22,119,255,0.05); }
.table-wrapper { overflow-x: auto; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.65);
  backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; z-index: 100;
}
.modal-backdrop.show { display: flex; animation: pageFadeIn .2s ease; }
.modal-box { width: 100%; max-width: 460px; margin: 20px; }

.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 280px; padding: 14px 18px; border-radius: 12px;
  background: linear-gradient(180deg, var(--color-gray) 0%, #191c23 100%);
  border-left: 4px solid var(--color-blue);
  box-shadow: var(--shadow);
  font-size: 14px;
  animation: slideIn .3s cubic-bezier(.34,1.56,.64,1);
}
.toast.success { border-color: var(--color-success); box-shadow: 0 8px 24px rgba(23,201,100,0.2); }
.toast.error { border-color: var(--color-danger); box-shadow: 0 8px 24px rgba(243,18,96,0.2); }
.toast.warning { border-color: var(--color-warning); box-shadow: 0 8px 24px rgba(245,165,36,0.2); }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.qr-box { background: #fff; padding: 16px; border-radius: 14px; display: inline-block; box-shadow: 0 8px 30px rgba(22,119,255,0.25); }
.copy-field { display: flex; gap: 8px; }
.copy-field input { flex: 1; }

@media (max-width: 900px) {
  .sidebar { position: fixed; left: -260px; z-index: 90; box-shadow: var(--shadow); }
  .sidebar.open { left: 0; }
  .hero h1 { font-size: 36px; }
  .page-content { padding: 18px; }

  /* Corrige o menu mobile: mostra o botão de abrir o menu (hambúrguer) e
     esconde o botão de recolher, que só faz sentido no layout de desktop. */
  #mobileMenuBtn { display: flex !important; }
  #sidebarToggle { display: none; }

  .stats-grid { grid-template-columns: 1fr; }
  table.data-table { font-size: 13px; }
}

/* ---------- QR Code do depósito (efeitos visuais) ---------- */
.qr-reveal { animation: qrRevealIn .45s cubic-bezier(.34,1.56,.64,1); }
@keyframes qrRevealIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

.qr-status-badge {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 10px 0 18px;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(245,165,36,0.14);
  color: var(--color-warning);
  font-size: 13px;
  font-weight: 600;
}
.qr-pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-warning);
  box-shadow: 0 0 0 0 rgba(245,165,36,0.6);
  animation: qrPulseDot 1.6s infinite;
}
@keyframes qrPulseDot {
  0%   { box-shadow: 0 0 0 0 rgba(245,165,36,0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(245,165,36,0); }
  100% { box-shadow: 0 0 0 0 rgba(245,165,36,0); }
}

.qr-box-glow {
  position: relative;
  display: inline-block;
  border-radius: 18px;
  padding: 14px;
  animation: qrGlowPulse 2.4s ease-in-out infinite;
}
.qr-box-glow img {
  display: block;
  border-radius: 10px;
  width: 220px;
  height: 220px;
}
@keyframes qrGlowPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(22,119,255,0.0), 0 8px 30px rgba(22,119,255,0.20); }
  50%      { box-shadow: 0 0 26px rgba(22,119,255,0.35), 0 8px 34px rgba(124,92,255,0.30); }
}

/* ---------- QR Code: moldura de scanner + linha animada ---------- */
.qr-scanner { position: relative; overflow: hidden; }

.qr-corner {
  position: absolute;
  width: 26px; height: 26px;
  border: 3px solid var(--color-cyan);
  opacity: 0;
  animation: qrCornerIn .5s ease forwards;
}
.qr-corner-tl { top: 4px; left: 4px; border-right: none; border-bottom: none; border-radius: 6px 0 0 0; animation-delay: .05s; }
.qr-corner-tr { top: 4px; right: 4px; border-left: none; border-bottom: none; border-radius: 0 6px 0 0; animation-delay: .15s; }
.qr-corner-bl { bottom: 4px; left: 4px; border-right: none; border-top: none; border-radius: 0 0 0 6px; animation-delay: .25s; }
.qr-corner-br { bottom: 4px; right: 4px; border-left: none; border-top: none; border-radius: 0 0 6px 0; animation-delay: .35s; }
@keyframes qrCornerIn { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: scale(1); } }

.qr-scan-line {
  position: absolute;
  left: 10px; right: 10px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-cyan) 20%, var(--color-blue-light) 50%, var(--color-cyan) 80%, transparent);
  box-shadow: 0 0 10px 2px rgba(0,224,255,0.7);
  animation: qrScanMove 2.6s ease-in-out infinite;
  z-index: 2;
}
@keyframes qrScanMove {
  0%   { top: 14px; opacity: 0; }
  8%   { opacity: 1; }
  50%  { top: calc(100% - 24px); }
  92%  { opacity: 1; }
  100% { top: 14px; opacity: 0; }
}

/* ---------- Tela obrigatória de ativação do 2FA ---------- */
.tfa-step { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tfa-step-num {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--gradient-brand); color: #fff; font-size: 13px; font-weight: 700;
  box-shadow: 0 0 0 4px rgba(22,119,255,0.15);
}
.tfa-step-label { font-size: 11px; color: var(--color-muted); font-weight: 600; letter-spacing: .3px; }
.tfa-step-line { width: 40px; height: 2px; background: var(--color-gray-light); margin-bottom: 18px; }
.tfa-qr-frame {
  display: inline-block; padding: 14px; border-radius: 20px;
  background: var(--gradient-brand-soft);
  box-shadow: var(--shadow-glow);
  animation: tfaPulseGlow 2.4s ease-in-out infinite;
}
@keyframes tfaPulseGlow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(22,119,255,0.15), 0 8px 30px rgba(22,119,255,0.12); }
  50% { box-shadow: 0 0 0 1px rgba(124,92,255,0.25), 0 10px 40px rgba(124,92,255,0.28); }
}
