/* ============================================================
   CLARIS — Identidade Visual
   Cor principal: #D4A017 (âmbar dourado)
   ============================================================ */

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

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

:root {
  --amarelo:       #D4A017;
  --amarelo-light: #FDF6E3;
  --amarelo-mid:   #F5C842;
  --amarelo-soft:  rgba(212,160,23,0.12);
  --texto:         #16161A;
  --texto-sec:     #71717A;
  --texto-ter:     #A1A1AA;
  --fundo:         #FFFFFF;
  --fundo-sec:     #FAFAF9;
  --fundo-input:   #F5F5F4;
  --borda:         rgba(0,0,0,0.06);
  --borda-forte:   rgba(0,0,0,0.10);
  --radius-sm:     8px;
  --radius:        12px;
  --radius-lg:     18px;
  --shadow:        0 1px 2px rgba(0,0,0,0.03), 0 8px 24px rgba(0,0,0,0.05);
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.04);
  --verde:         #15803D;
  --verde-bg:      #F0FDF4;
  --vermelho:      #DC2626;
  --vermelho-bg:   #FEF2F2;
  --azul:          #1D4ED8;
  --azul-bg:       #EFF6FF;
  --ease:          cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--fundo-sec);
  color: var(--texto);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.011em;
}

/* ---- Layout de auth ---- */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.auth-card {
  background: var(--fundo);
  border-radius: 22px;
  border: 1px solid var(--borda);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 400px;
  padding: 36px 30px;
}

/* ---- Logo / marca ---- */
.claris-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.claris-logo-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  position: relative;
  z-index: 1;
}

.claris-logo-icon img {
  width: 48px !important;
  height: 48px !important;
  max-width: 48px !important;
  max-height: 48px !important;
  min-width: 48px !important;
  min-height: 48px !important;
  object-fit: cover;
  display: block;
  border-radius: 14px;
  position: relative;
  z-index: 1;
}

.claris-logo-icon-fallback {
  width: 48px;
  height: 48px;
  background: var(--amarelo);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.claris-logo-text { line-height: 1.2; }
.claris-logo-text .nome { font-size: 20px; font-weight: 600; color: var(--texto); letter-spacing: -0.03em; }
.claris-logo-text .tagline { font-size: 12px; color: var(--texto-ter); }

/* ---- Títulos de tela ---- */
.auth-titulo { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; color: var(--texto); margin-bottom: 6px; }
.auth-sub    { font-size: 14px; color: var(--texto-sec); margin-bottom: 26px; line-height: 1.55; }

/* ---- Formulários ---- */
.campo { margin-bottom: 16px; }
.campo label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--texto-sec);
  margin-bottom: 7px;
  letter-spacing: -0.005em;
}
.campo input,
.campo select,
.campo textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 16px;
  color: var(--texto);
  background: var(--fundo-input);
  outline: none;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
  -webkit-text-size-adjust: 100%;
  -webkit-appearance: none;
  appearance: none;
}
.campo input::placeholder,
.campo textarea::placeholder { color: var(--texto-ter); }

.campo input:hover,
.campo select:hover,
.campo textarea:hover { background: #F0F0EF; }

.campo input:focus,
.campo select:focus,
.campo textarea:focus {
  background: var(--fundo);
  border-color: var(--amarelo);
  box-shadow: 0 0 0 3px var(--amarelo-soft);
}

.campo select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23A1A1AA' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

.campo input[type="checkbox"],
.campo input[type="radio"] { width: auto; padding: 0; }

.campo-senha { position: relative; }
.campo-senha input { padding-right: 44px; }
.toggle-senha {
  position: absolute; right: 14px; top: 50%;
  transform: translateY(-50%);
  cursor: pointer; color: var(--texto-ter); font-size: 18px;
  background: none; border: none; padding: 0;
  transition: color 0.15s var(--ease);
}
.toggle-senha:hover { color: var(--texto-sec); }

/* ---- Regras de senha ---- */
.regras-senha {
  background: var(--fundo-sec);
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
}
.regra {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--texto-ter); margin-bottom: 4px;
  transition: color 0.2s var(--ease);
}
.regra i { font-size: 15px; }
.regra.ok { color: var(--verde); }
.regra:last-child { margin-bottom: 0; }

/* ---- Botões ---- */
.btn {
  display: block; width: 100%; padding: 14px;
  border: none; border-radius: var(--radius);
  font-family: inherit;
  font-size: 15px; font-weight: 500; cursor: pointer;
  text-align: center; text-decoration: none;
  letter-spacing: -0.01em;
  transition: transform 0.12s var(--ease), background 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.btn:active { transform: scale(0.985); }
.btn-primary {
  background: var(--amarelo); color: #fff;
  box-shadow: 0 1px 2px rgba(212,160,23,0.2), 0 4px 12px rgba(212,160,23,0.15);
}
.btn-primary:hover { background: #C29314; }
.btn-outline {
  background: var(--fundo); border: 1px solid var(--borda-forte); color: var(--texto);
}
.btn-outline:hover { background: var(--fundo-sec); }
.btn-sm { padding: 9px 18px; font-size: 13px; width: auto; display: inline-block; }

/* ---- Links ---- */
.auth-footer {
  text-align: center; font-size: 14px;
  color: var(--texto-sec); margin-top: 22px;
}
.auth-footer a, .link-amarelo {
  color: var(--amarelo); text-decoration: none; font-weight: 500; cursor: pointer;
  transition: opacity 0.15s var(--ease);
}
.auth-footer a:hover, .link-amarelo:hover { opacity: 0.75; }
.link-voltar {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 14px; color: var(--amarelo); cursor: pointer;
  text-decoration: none; margin-bottom: 20px;
}

/* ---- Alertas ---- */
.alerta {
  border-radius: var(--radius); padding: 12px 14px;
  font-size: 13.5px; margin-bottom: 16px; display: flex; gap: 9px; align-items: flex-start;
  line-height: 1.5;
}
.alerta i { font-size: 17px; flex-shrink: 0; margin-top: 1px; }
.alerta-erro    { background: var(--vermelho-bg); color: var(--vermelho); }
.alerta-sucesso { background: var(--verde-bg);    color: var(--verde); }
.alerta-info    { background: var(--azul-bg);     color: var(--azul); }

/* ---- Divisor ---- */
.divisor {
  display: flex; align-items: center; gap: 10px;
  margin: 20px 0; color: var(--texto-ter); font-size: 12px;
}
.divisor::before, .divisor::after {
  content: ''; flex: 1; height: 1px; background: var(--borda);
}

/* ---- Confirmação de e-mail ---- */
.confirm-icon {
  width: 72px; height: 72px;
  background: var(--amarelo-light); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 22px;
}
.confirm-icon i { font-size: 34px; color: var(--amarelo); }
.auth-card.centrado { text-align: center; }

/* ---- Dashboard base ---- */
.app-shell {
  display: flex; flex-direction: column; min-height: 100vh;
  max-width: 480px; margin: 0 auto; background: var(--fundo);
}
.app-header {
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--borda);
  padding: 16px 20px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.app-nav {
  display: flex;
  background: rgba(255,255,255,0.9);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--borda); position: sticky; bottom: 0; z-index: 50;
}
.app-nav a {
  flex: 1; padding: 11px 4px 13px; display: flex; flex-direction: column;
  align-items: center; gap: 4px; text-decoration: none;
  color: var(--texto-ter); font-size: 10px; font-weight: 500;
  transition: color 0.18s var(--ease);
}
.app-nav a i { font-size: 22px; }
.app-nav a:hover { color: var(--texto-sec); }
.app-nav a.ativo { color: var(--amarelo); }
.app-content { flex: 1; padding: 20px; overflow-y: auto; }

/* ---- Saldo card ---- */
.saldo-card {
  background: linear-gradient(135deg, #D4A017 0%, #E0B23C 100%);
  border-radius: 20px;
  padding: 26px; margin-bottom: 20px; color: #fff;
  box-shadow: 0 4px 20px rgba(212,160,23,0.22);
}
.saldo-label { font-size: 12px; opacity: 0.85; margin-bottom: 6px; font-weight: 500; }
.saldo-valor { font-size: 34px; font-weight: 600; letter-spacing: -0.035em; }
.saldo-meta { display: flex; gap: 16px; margin-top: 20px; }
.saldo-meta-item { flex: 1; }
.saldo-meta-label { font-size: 10px; opacity: 0.8; font-weight: 500; }
.saldo-meta-val   { font-size: 15px; font-weight: 600; letter-spacing: -0.015em; }

/* ---- Cards de resumo ---- */
.resumo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 22px; }
.resumo-card {
  background: var(--fundo-sec); border-radius: var(--radius);
  padding: 15px; border: 1px solid var(--borda);
  transition: border-color 0.18s var(--ease);
}
.resumo-card .rc-label { font-size: 11px; color: var(--texto-ter); margin-bottom: 5px; font-weight: 500; }
.resumo-card .rc-valor { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.resumo-card.receita .rc-valor { color: var(--verde); }
.resumo-card.despesa .rc-valor { color: var(--vermelho); }

/* ---- Últimos lançamentos ---- */
.lancamentos-lista { list-style: none; }
.lancamento-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 0; border-bottom: 1px solid var(--borda);
}
.lancamento-item:last-child { border-bottom: none; }
.lanc-icone {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.lanc-info { flex: 1; min-width: 0; }
.lanc-desc  { font-size: 14.5px; font-weight: 500; letter-spacing: -0.01em; }
.lanc-cat   { font-size: 12px; color: var(--texto-ter); }
.lanc-valor { font-size: 15px; font-weight: 600; letter-spacing: -0.015em; }
.lanc-valor.entrada { color: var(--verde); }
.lanc-valor.saida   { color: var(--vermelho); }

/* ---- FAB ---- */
.fab {
  position: fixed; bottom: 76px; right: 20px;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--amarelo); color: #fff;
  border: none; font-size: 26px; cursor: pointer;
  box-shadow: 0 4px 16px rgba(212,160,23,0.4);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; z-index: 100;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.fab:hover { transform: scale(1.05); box-shadow: 0 6px 20px rgba(212,160,23,0.45); }
.fab:active { transform: scale(0.97); }

/* ---- Carteira switch ---- */
.carteira-switch {
  display: flex; gap: 4px; margin-bottom: 20px;
  background: var(--fundo-input); padding: 4px; border-radius: 14px;
}
.carteira-btn {
  flex: 1; padding: 9px; border-radius: 10px;
  border: none; background: transparent;
  font-family: inherit;
  font-size: 13.5px; font-weight: 500; color: var(--texto-sec); cursor: pointer; text-align: center;
  transition: all 0.18s var(--ease);
}
.carteira-btn:hover { color: var(--texto); }
.carteira-btn.ativo {
  background: var(--fundo); color: var(--texto);
  box-shadow: var(--shadow-sm);
}

/* ---- Utilidades ---- */
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.text-sec { color: var(--texto-sec); }
.text-sm  { font-size: 13px; }
.bold { font-weight: 600; }
.hidden { display: none !important; }

@media (min-width: 481px) {
  .app-shell {
    border-left: 1px solid var(--borda);
    border-right: 1px solid var(--borda);
  }
}
