:root {
--bg: #060d09;
--bg2: #0c1a12;
--card: #111f17;
--card-hover: #172b1f;
--border: #1e3a28;
--text: #e2ede6;
--muted: #5f7d6b;
--accent: #10b981;
--accent-light: #34d399;
--accent-glow: rgba(16,185,129,0.25);
--danger: #ef4444;
--danger-glow: rgba(239,68,68,0.25);
--warning: #f59e0b;
--info: #06b6d4;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Reset/normalize dos ícones FontAwesome.
   Garante que apareçam com tamanho mínimo legível mesmo quando o pai
   tem font-size muito pequeno (ex.: text-sm do Tailwind = 0.875rem). */
.fa-solid, .fa-regular, .fa-brands, .fa {
  display: inline-block;
  font-style: normal;
  font-variant: normal;
  text-rendering: auto;
  line-height: 1;
  min-width: 1em;
  text-align: center;
}

body {
font-family: 'Space Grotesk', sans-serif;
background: var(--bg);
color: var(--text);
min-height: 100vh;
overflow-x: hidden;
}

/* Fundo animado */
.bg-blobs {
position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.blob {
position: absolute; border-radius: 50%; filter: blur(120px); opacity: 0.12;
}
.blob-1 {
width: 600px; height: 600px; background: #10b981;
top: -200px; left: -100px;
animation: blobMove1 20s ease-in-out infinite;
}
.blob-2 {
width: 500px; height: 500px; background: #06b6d4;
bottom: -150px; right: -100px;
animation: blobMove2 25s ease-in-out infinite;
}
.blob-3 {
width: 400px; height: 400px; background: #10b981;
top: 50%; left: 50%; transform: translate(-50%, -50%);
animation: blobMove3 18s ease-in-out infinite;
}

@keyframes blobMove1 {
0%, 100% { transform: translate(0,0) scale(1); }
33% { transform: translate(80px, 60px) scale(1.15); }
66% { transform: translate(-40px, -30px) scale(0.9); }
}
@keyframes blobMove2 {
0%, 100% { transform: translate(0,0) scale(1); }
33% { transform: translate(-60px, -80px) scale(1.1); }
66% { transform: translate(50px, 40px) scale(0.95); }
}
@keyframes blobMove3 {
0%, 100% { transform: translate(-50%,-50%) scale(1); }
50% { transform: translate(-40%,-60%) scale(1.2); }
}

@media (prefers-reduced-motion: reduce) {
.blob { animation: none !important; }
.balance-glow { animation: none !important; }
}

/* Cards de vidro */
.glass-card {
background: var(--card);
border: 1px solid var(--border);
border-radius: 16px;
backdrop-filter: blur(12px);
transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.glass-card:hover {
transform: translateY(-2px);
box-shadow: 0 8px 32px rgba(16,185,129,0.08);
border-color: rgba(16,185,129,0.3);
}

/* Saldo principal */
.balance-value {
font-size: clamp(2.5rem, 6vw, 4.5rem);
font-weight: 700;
letter-spacing: -2px;
transition: color 0.4s ease;
}
.balance-glow {
animation: pulseGlow 3s ease-in-out infinite;
}
@keyframes pulseGlow {
0%, 100% { filter: drop-shadow(0 0 12px var(--accent-glow)); }
50% { filter: drop-shadow(0 0 28px var(--accent-glow)); }
}
.balance-negative {
animation: pulseGlowRed 3s ease-in-out infinite;
}
@keyframes pulseGlowRed {
0%, 100% { filter: drop-shadow(0 0 12px var(--danger-glow)); }
50% { filter: drop-shadow(0 0 28px var(--danger-glow)); }
}

/* Tabs */
.tab-btn {
padding: 10px 20px; border-radius: 10px; font-weight: 500;
background: transparent; color: var(--muted); border: 1px solid transparent;
cursor: pointer; transition: all 0.3s ease; font-family: inherit; font-size: 0.9rem;
white-space: nowrap;
}
.tab-btn:hover { color: var(--text); background: var(--card); }
.tab-btn.active {
color: var(--accent-light); background: var(--card);
border-color: var(--accent); box-shadow: 0 0 16px var(--accent-glow);
}
.tab-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Inputs */
.fin-input {
background: var(--bg2); border: 1px solid var(--border); border-radius: 10px;
padding: 10px 14px; color: var(--text); font-family: inherit; font-size: 0.9rem;
transition: border-color 0.25s ease, box-shadow 0.25s ease; width: 100%;
}
.fin-input:focus {
outline: none; border-color: var(--accent);
box-shadow: 0 0 0 3px var(--accent-glow);
}
.fin-input::placeholder { color: var(--muted); }
select.fin-input { cursor: pointer; appearance: none;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%235f7d6b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
background-repeat: no-repeat; background-position: right 12px center;
padding-right: 32px;
}

/* Botão principal */
.btn-accent {
background: linear-gradient(135deg, #10b981, #059669);
color: #fff; border: none; border-radius: 10px; padding: 10px 22px;
font-family: inherit; font-weight: 600; font-size: 0.9rem; cursor: pointer;
transition: all 0.25s ease; box-shadow: 0 4px 16px var(--accent-glow);
}
.btn-accent:hover { transform: translateY(-1px); box-shadow: 0 6px 24px var(--accent-glow); }
.btn-accent:active { transform: translateY(0); }
.btn-accent:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 2px; }

.btn-danger {
background: transparent; color: var(--danger); border: 1px solid rgba(239,68,68,0.3);
border-radius: 8px; padding: 6px 12px; font-family: inherit; font-size: 0.8rem;
cursor: pointer; transition: all 0.2s ease;
}
.btn-danger:hover { background: rgba(239,68,68,0.1); border-color: var(--danger); }

/* Item da lista */
.list-item {
display: flex; align-items: center; justify-content: space-between;
padding: 14px 18px; border-radius: 12px;
background: var(--bg2); border: 1px solid var(--border);
transition: all 0.2s ease;
}
.list-item:hover { border-color: rgba(16,185,129,0.25); background: var(--card); }

/* Badge de categoria */
.cat-badge {
display: inline-block; padding: 3px 10px; border-radius: 20px;
font-size: 0.72rem; font-weight: 500; letter-spacing: 0.3px;
}

/* Barra de saúde financeira */
.health-bar {
height: 12px; border-radius: 6px; background: var(--bg2);
overflow: hidden; position: relative;
}
.health-fill {
height: 100%; border-radius: 6px; transition: width 0.8s ease, background 0.4s ease;
}

/* Toast */
.toast-container {
position: fixed; top: 24px; right: 24px; z-index: 9999;
display: flex; flex-direction: column; gap: 8px;
}
.toast {
padding: 14px 20px; border-radius: 12px; font-size: 0.88rem;
font-weight: 500; color: #fff; min-width: 260px; max-width: 380px;
box-shadow: 0 8px 24px rgba(0,0,0,0.3);
animation: toastIn 0.35s ease forwards;
}
.toast.out { animation: toastOut 0.3s ease forwards; }
.toast-success { background: linear-gradient(135deg, #059669, #10b981); }
.toast-error { background: linear-gradient(135deg, #dc2626, #ef4444); }
.toast-info { background: linear-gradient(135deg, #0891b2, #06b6d4); }

@keyframes toastIn {
from { opacity: 0; transform: translateX(60px); }
to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
from { opacity: 1; transform: translateX(0); }
to { opacity: 0; transform: translateX(60px); }
}

/* Scrollbar custom */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* Tab panels */
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn {
from { opacity: 0; transform: translateY(8px); }
to { opacity: 1; transform: translateY(0); }
}

/* Separação de seção dentro da tab */
.section-divider {
border-top: 1px solid var(--border); margin: 28px 0 20px;
padding-top: 20px;
}

/* Grid responsivo para formulários */
.form-grid {
display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
gap: 12px;
}

@media (max-width: 640px) {
.form-grid { grid-template-columns: 1fr; }
.summary-grid { grid-template-columns: 1fr 1fr !important; }
.charts-grid { grid-template-columns: 1fr !important; }
}

/* ===================================================================
   Telas de autenticação (login.html / register.html)
   =================================================================== */

.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 16px;
}

.auth-wrap {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 420px;
}

.auth-card {
  padding: 36px 32px 28px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.auth-brand {
  text-align: center;
  margin-bottom: 24px;
}

.auth-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), #047857);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px var(--accent-glow);
}
.auth-logo i { color: #fff; font-size: 22px; }

.auth-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--accent-light);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.auth-sub {
  font-size: 14px;
  color: var(--muted);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 14px;
  color: var(--muted);
  font-size: 14px;
  pointer-events: none;
}

.auth-input {
  width: 100%;
  padding-left: 40px !important;
  padding-right: 40px !important;
  font-size: 15px !important;
}

.auth-eye {
  position: absolute;
  right: 8px;
  background: transparent;
  border: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: pointer;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
}
.auth-eye:hover { color: var(--accent-light); background: rgba(16,185,129,0.08); }

.auth-hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}
.auth-hint code {
  background: rgba(255,255,255,0.05);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
}

.auth-submit {
  margin-top: 6px;
  width: 100%;
  padding: 13px 18px;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.auth-error {
  background: rgba(239, 68, 68, 0.10);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.auth-error::before {
  content: "\f071";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 14px;
}

.auth-foot {
  text-align: center;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}
.auth-link {
  color: var(--accent-light);
  text-decoration: none;
  font-weight: 600;
  margin-left: 4px;
  transition: color 0.15s ease;
}
.auth-link:hover { color: var(--accent); text-decoration: underline; }

/* Pequena barra do usuário no header do app principal */
.app-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}
.app-user .username { color: var(--text); font-weight: 500; }
.app-user .logout-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.app-user .logout-btn:hover {
  color: #fca5a5;
  border-color: rgba(239,68,68,0.35);
  background: rgba(239,68,68,0.06);
}

@media (max-width: 480px) {
  .auth-card { padding: 28px 22px 22px; }
  .auth-title { font-size: 22px; }
}

/* ===================================================================
   Câmbio + seletor de moeda
   =================================================================== */

.exchange-rate {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.currency-select {
  background: rgba(16, 185, 129, 0.10);
  color: var(--accent-light);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 8px;
  padding: 10px 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  appearance: none;
  -webkit-appearance: none;
}
.currency-select:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(16, 185, 129, 0.18);
}
.currency-select option {
  background: #0c1a12;
  color: var(--text);
}

.value-with-currency {
  display: grid;
  grid-template-columns: 1fr 90px;
  gap: 8px;
  align-items: stretch;
}

.item-currency-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}
.item-currency-badge.brl {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}
.item-currency-badge.usd {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
}
.item-currency-badge.eur {
  background: rgba(168, 85, 247, 0.18);
  color: #c4b5fd;
}

/* ============================================
   Reserva de Emergência
   ============================================ */
.reserve-tx-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 6px;
  margin-bottom: 4px;
  font-size: 12px;
}
.reserve-tx-item.contribute {
  background: rgba(16, 185, 129, 0.08);
}
.reserve-tx-item.withdraw {
  background: rgba(239, 68, 68, 0.08);
}
.reserve-tx-amount.contribute {
  color: #34d399;
  font-weight: 600;
}
.reserve-tx-amount.withdraw {
  color: #f87171;
  font-weight: 600;
}

