:root {
  --bg: #f8faf9;
  --ink: #273c37;
  --muted: #83918d;
  --accent: #5b9e89;
  --mint: #e2f3ec;
  --peach: #fcebe6;
  --lavender: #eeebfa;
  --border: #e6eeea;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(145deg, #e8f5ef, #f8faf9 55%, #f4eafa);
}
.login-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 28px;
  width: min(100%, 420px);
  padding: 40px 32px;
  box-shadow: 0 18px 55px #315b4b12;
}
.brand-icon {
  display: grid;
  place-items: center;
  background: var(--mint);
  color: var(--accent);
  width: 58px;
  height: 58px;
  border-radius: 18px;
  font-size: 30px;
  margin-bottom: 22px;
}
h1 { font-size: 29px; letter-spacing: -1px; margin: 0 0 9px; }
.subtitle { color: var(--muted); line-height: 1.6; margin: 0 0 28px; }
label { display: block; font-size: 13px; font-weight: 650; margin: 18px 0 8px; }
input {
  width: 100%;
  padding: 15px;
  border-radius: 13px;
  border: 1px solid #dce8e2;
  background: #fbfdfc;
  font-size: 16px;
  outline-color: var(--accent);
}
.primary-button {
  width: 100%;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  font-size: 16px;
  padding: 16px;
  margin-top: 26px;
  cursor: pointer;
}
.footer-note { color: var(--muted); text-align: center; font-size: 12px; margin: 24px 0 0; }
.alert { background: #fff0ed; color: #aa5149; padding: 12px; border-radius: 12px; font-size: 14px; }
.layout { min-height: 100vh; padding-bottom: 90px; }
.topbar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 20px max(24px, calc((100vw - 1060px)/2));
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo { font-weight: 750; color: var(--accent); font-size: 18px; }
.logout-button { border: 1px solid var(--border); background: white; padding: 10px 17px; border-radius: 12px; cursor: pointer; }
.content { max-width: 1060px; margin: auto; padding: 38px 24px; }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: 2px; }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 32px 0; }
.summary-card { border-radius: 22px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.summary-card span { font-size: 14px; }
.summary-card strong { font-size: 28px; letter-spacing: -1px; }
.summary-card small { color: #657a72; }
.mint { background: var(--mint); }
.peach { background: var(--peach); }
.lavender { background: var(--lavender); }
.welcome-panel { background: white; border: 1px solid var(--border); border-radius: 24px; padding: 36px; text-align: center; }
.welcome-panel h2 { font-size: 21px; }
.welcome-panel p { color: var(--muted); line-height: 1.6; }
.panel-icon { font-size: 36px; }
.tag { display: inline-block; margin-top: 15px; background: var(--mint); color: #46836e; border-radius: 30px; padding: 9px 15px; font-size: 12px; font-weight: 700; }
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  background: white;
  border-top: 1px solid var(--border);
  padding: 12px 8px max(14px, env(safe-area-inset-bottom));
}
.bottom-nav span { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 22px; color: #a3b0aa; }
.bottom-nav span.active { color: var(--accent); }
.bottom-nav small { font-size: 10px; }
@media(max-width: 680px) {
  .topbar { padding: 18px; }
  .content { padding: 28px 18px; }
  h1 { font-size: 25px; }
  .summary-grid { grid-template-columns: 1fr; gap: 12px; }
  .summary-card { padding: 21px; gap: 9px; }
  .summary-card strong { font-size: 27px; }
  .welcome-panel { padding: 28px 20px; }
}

textarea {
  width: 100%;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fbfdfc;
  font: inherit;
  color: var(--text);
  resize: vertical;
  outline-color: #94d6bd;
}

.ia-detalhes {
  background: #f4faf7;
  padding: 15px 20px;
  border-radius: 16px;
  margin-bottom: 20px;
}

.ia-detalhes p {
  margin: 12px 0;
  overflow-wrap: anywhere;
}


/* Links do menu inferior */
.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 22px;
  color: #a3b0aa;
  text-decoration: none;
  min-width: 54px;
  min-height: 44px;
  cursor: pointer;
  position: relative;
  z-index: 2;
}

.bottom-nav a:hover,
.bottom-nav a:focus {
  color: var(--accent);
}

.bottom-nav a small {
  font-size: 10px;
}


/* Botão IA - navegação */
.bottom-nav .nav-ia {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 60px;
    min-height: 48px;
    padding: 4px 8px;
    color: #46836e;
    font-size: 22px;
    text-decoration: none;
    cursor: pointer;
    pointer-events: auto;
}

.bottom-nav .nav-ia small {
    font-size: 10px;
}

.bottom-nav {
    z-index: 1000;
}


/* ===== FINANCAS IA ===== */

.pagina-financas-ia {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
}

.conteudo-financas-ia {
    width: min(100% - 40px, 850px);
    margin: 0 auto;
    padding: 48px 0 90px;
}

.conteudo-financas-ia h1 {
    font-size: clamp(28px, 4vw, 38px);
    margin: 12px 0;
}

.conteudo-financas-ia .subtitle {
    color: var(--muted);
    margin-bottom: 30px;
}

.conteudo-financas-ia .welcome-panel {
    text-align: left;
    margin-bottom: 22px;
    padding: 30px;
}

.conteudo-financas-ia form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.conteudo-financas-ia label {
    font-weight: 600;
}

.conteudo-financas-ia textarea {
    box-sizing: border-box;
    width: 100%;
    min-height: 130px;
    padding: 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: white;
    font: inherit;
    resize: vertical;
}

.conteudo-financas-ia .primary-button {
    align-self: flex-start;
    padding: 14px 24px;
    border-radius: 12px;
    cursor: pointer;
}

.conteudo-financas-ia .ia-detalhes {
    margin-top: 18px;
}

@media (max-width: 680px) {
    .conteudo-financas-ia {
        width: calc(100% - 32px);
        padding-top: 28px;
    }

    .conteudo-financas-ia .welcome-panel {
        padding: 22px 18px;
    }

    .conteudo-financas-ia .primary-button {
        width: 100%;
    }
}


/* Microfone da Finanças IA */
.controle-voz {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  text-align: center;
}

.botao-microfone {
  width: 82px;
  height: 82px;
  border: 0;
  border-radius: 50%;
  background: #d9f2e6;
  color: #28664d;
  font-size: 35px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0,0,0,.08);
}

.botao-microfone.gravando {
  background: #fce1e1;
  color: #b42332;
  animation: pulso-microfone 1.2s infinite;
}

.botao-microfone:disabled {
  opacity: .45;
  cursor: not-allowed;
}

@keyframes pulso-microfone {
  50% {
    box-shadow: 0 0 0 13px rgba(220,60,60,.12);
  }
}

#estado-microfone {
  font-size: 14px;
  color: var(--muted);
}


/* Revisão antes de salvar */
.formulario-confirmacao {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 26px;
  text-align: left;
}
.formulario-confirmacao input,
.formulario-confirmacao select {
  box-sizing: border-box;
  width: 100%;
  padding: 13px;
  border: 1px solid #d6e4dc;
  border-radius: 12px;
  font: inherit;
  background: white;
}
.formulario-confirmacao label {
  font-weight: 600;
}
.formulario-confirmacao button {
  margin-top: 15px;
}
