:root {
  --bg-app: #0A0C10;
  --bg-card: #12161F;
  --bg-input: #1A1F2B;
  --primary: #00D09C;
  --primary-hover: #00B386;
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --border: #2D3748;
  --danger: #EF4444;
  --warning: #F59E0B;
  --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
body { background: var(--bg-app); color: var(--text-main); line-height: 1.5; overflow-x: hidden; }
a { text-decoration: none; color: inherit; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* Toast */
#toast-container { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 10000; display: flex; flex-direction: column; gap: 10px; width: 90%; max-width: 400px; pointer-events: none; }
.toast { background: var(--bg-card); border: 1px solid var(--border); color: var(--text-main); padding: 16px; border-radius: 8px; display: flex; align-items: center; gap: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); animation: slideDown 0.3s ease forwards; pointer-events: auto; }
.toast.success { border-left: 4px solid var(--primary); }
.toast.error { border-left: 4px solid var(--danger); }
.toast i { font-size: 1.5rem; }
.toast.success i { color: var(--primary); }
.toast.error i { color: var(--danger); }
.toast p { font-size: 0.9rem; font-weight: 500; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }

/* Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 24px; border-radius: 100px; font-weight: 600; font-size: 0.95rem; cursor: pointer; border: none; transition: all 0.2s; font-family: inherit; }
.btn-primary { background: var(--primary); color: #000; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: transparent; color: var(--text-main); border: 1px solid var(--border); }
.btn-block { display: flex; width: 100%; text-align: center; }
.btn-lg { padding: 16px 32px; font-size: 1rem; }

/* Header e Telas */
.header { position: sticky; top: 0; z-index: 100; background: rgba(10, 12, 16, 0.9); border-bottom: 1px solid var(--border); backdrop-filter: blur(10px); }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.2rem; }
.logo-svg { width: 28px; height: 28px; color: var(--primary); }
.logo-text span { color: var(--primary); }

.screen { display: none; }
.screen.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.app-container { max-width: 520px; margin: 0 auto; padding: 40px 24px; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.center-screen { text-align: center; align-items: center; }
.btn-back { background: none; border: none; color: var(--text-muted); font-size: 0.9rem; cursor: pointer; display: flex; align-items: center; gap: 8px; margin-bottom: 24px; font-family: inherit; }

.form-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; }
.input-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.input-group label { font-size: 0.85rem; font-weight: 500; color: var(--text-muted); }
.input-group input { background: var(--bg-input); border: 1px solid var(--border); padding: 14px 16px; border-radius: 8px; color: var(--text-main); font-size: 1rem; }
.input-group input:focus { outline: none; border-color: var(--primary); }

.strength-meter { width: 100%; height: 4px; background: var(--border); border-radius: 100px; margin-top: 4px; overflow: hidden; }
.strength-bar { height: 100%; width: 0%; transition: 0.3s; }
.strength-bar.weak { width: 33%; background: var(--danger); }
.strength-bar.medium { width: 66%; background: var(--warning); }
.strength-bar.strong { width: 100%; background: var(--primary); }

.loading-spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 20px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Dashboard */
.screen-app { background-color: var(--bg-app); min-height: 100vh; padding-bottom: 80px; }
.app-top-bar { background-color: var(--bg-card); padding: 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }
.top-user { display: flex; align-items: center; gap: 12px; }
.top-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--primary); color: #000; display: grid; place-items: center; font-weight: 800; }
.top-name strong { display: block; font-size: 1rem; }
.top-name small { display: block; color: var(--text-muted); font-size: 0.75rem; }
.icon-btn { background: var(--bg-input); border: 1px solid var(--border); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 1.2rem; color: var(--text-main); cursor: pointer; }
.app-scroll-content { padding: 20px; }

.info-banner { background: rgba(0, 208, 156, 0.05); border: 1px solid rgba(0, 208, 156, 0.2); border-radius: var(--radius); padding: 16px; display: flex; gap: 12px; margin-bottom: 24px; }
.info-banner i { font-size: 1.5rem; color: var(--primary); }
.info-banner div strong { font-size: 0.95rem; display: block; margin-bottom: 4px; }
.info-banner div p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.4; margin-bottom: 12px; }

.balance-section { background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 24px; padding: 20px; }
.b-value h1 { font-size: 2.2rem; font-weight: 800; display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.b-value h1 i { font-size: 1.5rem; color: var(--text-muted); cursor: pointer; }
.b-actions { display: flex; gap: 12px; }
.b-btn { flex: 1; background: var(--bg-input); border: 1px solid var(--border); padding: 12px; border-radius: 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; color: var(--text-main); font-size: 0.8rem; font-weight: 600; }
.b-btn i { font-size: 1.4rem; color: var(--primary); }

.section-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }

.empty-card { background: var(--bg-card); border: 1px dashed var(--border); border-radius: var(--radius); padding: 30px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty-card i { font-size: 2.5rem; color: var(--text-muted); }
.empty-card p { color: var(--text-muted); font-size: 0.9rem; }

.virtual-card { background: linear-gradient(135deg, #1A1F2B, #0A0C10); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; display: none; flex-direction: column; gap: 20px; }
.vc-top { display: flex; justify-content: space-between; color: var(--text-muted); font-weight: 700; font-size: 0.85rem; }
.vc-number { font-family: monospace; font-size: 1.3rem; letter-spacing: 2px; color: #FFF; }
.vc-bottom { display: flex; justify-content: space-between; align-items: flex-end; }
.vc-bottom small { display: block; font-size: 0.55rem; color: var(--text-muted); letter-spacing: 1px; margin-bottom: 4px; }
.vc-bottom span { font-size: 0.85rem; font-weight: 500; }

.bottom-nav { position: fixed; bottom: 0; left: 0; width: 100%; background: var(--bg-card); display: flex; justify-content: space-around; align-items: center; padding: 12px 0 20px; border-top: 1px solid var(--border); z-index: 100; }
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text-muted); cursor: pointer; font-size: 0.7rem; font-weight: 600; }
.nav-item i { font-size: 1.5rem; }
.nav-item.active { color: var(--primary); }
.center-pix { position: relative; top: -15px; }
.pix-circle { width: 58px; height: 58px; background: #FFFFFF; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 0 25px 5px rgba(0, 191, 165, 0.5); margin-bottom: 4px; transition: transform 0.2s; }
.center-pix:hover .pix-circle { transform: scale(1.05); }

.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); backdrop-filter: blur(5px); display: flex; justify-content: center; align-items: flex-end; opacity: 0; visibility: hidden; transition: 0.3s; z-index: 999; }
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-content { background: var(--bg-card); width: 100%; max-width: 520px; border-radius: 24px 24px 0 0; padding: 30px 24px; position: relative; transform: translateY(100%); transition: 0.3s; max-height: 90vh; overflow-y: auto; }
.modal-overlay.active .modal-content { transform: translateY(0); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.modal-header h3 { font-size: 1.3rem; }
.modal-close { background: var(--bg-input); border: none; width: 32px; height: 32px; border-radius: 50%; color: var(--text-muted); cursor: pointer; }

.pix-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pix-options button { background: var(--bg-input); border: 1px solid var(--border); padding: 20px 16px; border-radius: var(--radius); color: var(--text-main); display: flex; flex-direction: column; align-items: center; gap: 10px; cursor: pointer; font-size: 0.9rem; font-weight: 600; transition: 0.2s; }
.pix-options button:hover { border-color: var(--primary); }
.pix-options button i { font-size: 1.8rem; color: var(--primary); }

.modal-gateway { background: #FFFFFF !important; color: #111827; border-radius: 16px !important; padding: 0 !important; overflow: hidden; display: flex; flex-direction: column; }
.gateway-header { background: #F3F4F6; padding: 16px 24px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #E5E7EB; }
.gateway-header h3 { font-size: 1.1rem; color: #111827; font-weight: 700; display: flex; align-items: center; gap: 8px;}
.gateway-header .modal-close { background: transparent; color: #6B7280; }
.gateway-body { padding: 32px 24px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.gateway-qr-container { background: #F9FAFB; border: 1px solid #E5E7EB; padding: 16px; border-radius: 12px; margin-bottom: 24px; }
.gateway-qr { width: 200px; height: 200px; display: block; }
.gateway-valor { font-size: 2rem; font-weight: 800; color: #111827; margin-bottom: 8px; }
.gateway-desc { font-size: 0.9rem; color: #6B7280; margin-bottom: 24px; }
.gateway-copy { display: flex; width: 100%; border: 1px solid #D1D5DB; border-radius: 8px; padding: 8px; margin-bottom: 24px; background: #F9FAFB; }
.gateway-copy input { flex: 1; border: none; background: transparent; font-size: 0.85rem; color: #4B5563; outline: none; padding-left: 8px; }
.gateway-copy button { background: #E5E7EB; color: #374151; border: none; padding: 10px 16px; border-radius: 6px; font-weight: 600; cursor: pointer; transition: 0.2s; }
.gateway-copy button:hover { background: #D1D5DB; }
.gateway-btn { background: #3B82F6; color: #FFFFFF; border-radius: 8px; padding: 16px; width: 100%; font-weight: 700; font-size: 1rem; border: none; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 8px; transition: 0.2s; }
.gateway-btn:hover { background: #2563EB; }
.gateway-footer { background: #F9FAFB; padding: 16px; text-align: center; border-top: 1px solid #E5E7EB; font-size: 0.75rem; color: #9CA3AF; display: flex; justify-content: center; align-items: center; gap: 6px; }

.boleto-tabs { display: flex; gap: 10px; margin-bottom: 20px; }
.boleto-tab { flex: 1; padding: 12px; background: var(--bg-input); border: 1px solid var(--border); color: var(--text-muted); border-radius: 8px; cursor: pointer; text-align: center; font-weight: 600; }
.boleto-tab.active { background: var(--primary); color: #000; border-color: var(--primary); }
.camera-container { width: 100%; height: 250px; background: #000; border-radius: var(--radius); position: relative; overflow: hidden; margin-bottom: 16px; border: 1px solid var(--border); display: none; }
#videoCamera { width: 100%; height: 100%; object-fit: cover; }
.scan-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.scan-target { width: 80%; height: 120px; border: 2px solid var(--primary); border-radius: 8px; position: relative; }
.scan-line { position: absolute; top: 0; left: 0; width: 100%; height: 2px; background: var(--primary); box-shadow: 0 0 10px var(--primary); animation: scan 2s linear infinite; }
@keyframes scan { 0% { top: 0; } 100% { top: 100%; } }

.extrato-item { display: flex; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid var(--border); }
.extrato-item div strong { display: block; font-size: 0.95rem; }
.extrato-item div small { color: var(--text-muted); font-size: 0.8rem; }
.extrato-item .valor { font-weight: 700; }
.extrato-item .valor.pos { color: var(--primary); }

.device-item { display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--bg-input); border-radius: 8px; margin-bottom: 12px; }
.device-item i { font-size: 1.5rem; color: var(--text-muted); }
.device-item div strong { display: block; font-size: 0.9rem; }
.device-item div small { color: var(--primary); font-size: 0.75rem; }

/* =========================================
   VERIFICAÇÃO FACIAL (TELA CHEIA E OVAL)
   ========================================= */
.face-verify-fullscreen {
  position: fixed;
  inset: 0;
  background: #0A0C10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 24px;
}

.face-verify-header {
  text-align: center;
  margin-bottom: 30px;
}
.face-verify-header h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}
.face-verify-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 300px;
}

.face-oval-container {
  position: relative;
  width: 260px;
  height: 340px;
  border-radius: 50%;
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 0 9999px rgba(10, 12, 16, 0.85); /* Escurece tudo ao redor */
  border: 3px solid rgba(0, 208, 156, 0.3);
  margin-bottom: 30px;
}

#videoVerify {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.face-oval-mask {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 40px rgba(0, 208, 156, 0.2);
  pointer-events: none;
}

.face-scan-line {
  position: absolute;
  top: 10%;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--primary);
  box-shadow: 0 0 15px var(--primary);
  display: none;
  animation: scanFace 2s linear infinite;
}

.face-verify-fullscreen.scanning .face-scan-line { display: block; }
.face-verify-fullscreen.scanning .face-oval-container { border-color: var(--primary); }

@keyframes scanFace {
  0% { top: 10%; }
  100% { top: 90%; }
}

.face-verify-actions {
  text-align: center;
}