/* ================= TOSTADINHO — visual ================= */
:root {
  --prim: #0f766e;
  --prim-esc: #134e4a;
  --ent: #15803d;
  --ent-bg: #dcfce7;
  --sai: #b91c1c;
  --sai-bg: #fee2e2;
  --alerta: #d97706;
  --alerta-bg: #fef3c7;
  --fundo: #f3f5f4;
  --card: #ffffff;
  --texto: #1c2626;
  --suave: #64748b;
  --borda: #e3e8e6;
  --cinza: #edf1f0;
  --raio: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body {
  background: var(--fundo);
  color: var(--texto);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body { min-height: 100vh; min-height: 100dvh; }
body.travado { overflow: hidden; }
button, input, a { font: inherit; color: inherit; }

.tela { max-width: 480px; margin: 0 auto; padding: 16px 16px 110px; }

.demo-aviso {
  background: var(--alerta-bg); color: #92400e;
  text-align: center; font-size: 13px; padding: 6px 12px;
}

/* ---------- campos e botões ---------- */
.campo { margin-bottom: 14px; }
.campo label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.campo input {
  width: 100%; padding: 13px 14px; font-size: 16px; /* 16px evita zoom no iPhone */
  border: 1.5px solid var(--borda); border-radius: 12px; background: #fff;
}
.campo input:focus { outline: none; border-color: var(--prim); box-shadow: 0 0 0 3px rgba(15,118,110,.15); }
.input-valor { font-size: 24px !important; font-weight: 700; }

.btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 14px; border: 0; border-radius: 12px;
  font-size: 16px; font-weight: 700; cursor: pointer; text-decoration: none;
  transition: transform .08s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primario { background: var(--prim); color: #fff; }
.btn-sec { background: var(--cinza); color: var(--texto); }
.btn-entrada { background: var(--ent); color: #fff; }
.btn-saida { background: var(--sai); color: #fff; }
.btn-texto { background: none; border: 0; color: var(--suave); font-weight: 600; padding: 8px; cursor: pointer; }

.msg { font-size: 14px; margin-bottom: 12px; line-height: 1.4; }
.msg.erro { color: var(--sai); }
.msg.ok { color: var(--ent); }

/* ---------- login ---------- */
.link-pequeno { margin-top: 10px; font-size: 14px; color: var(--prim); font-weight: 600; }
.link-pequeno + .link { margin-top: 2px; }
#tela-login, .tela-centro { display: flex; align-items: center; min-height: 100vh; min-height: 100dvh; padding-bottom: 16px; }
.login-box {
  width: 100%; background: var(--card); border-radius: 20px;
  padding: 28px 20px; box-shadow: 0 6px 24px rgba(0,0,0,.06);
}
.logo {
  width: 60px; height: 60px; margin: 0 auto 12px; border-radius: 18px;
  background: linear-gradient(135deg, var(--prim), var(--prim-esc));
  color: #fff; display: grid; place-items: center; font-size: 28px; font-weight: 800;
}
.login-box h1 { text-align: center; font-size: 26px; }
.sub { text-align: center; color: var(--suave); margin: 4px 0 24px; line-height: 1.4; }
.link { display: block; width: 100%; margin-top: 16px; padding: 8px; background: none; border: 0; color: var(--suave); cursor: pointer; }
.link b { color: var(--prim); }

/* ---------- início ---------- */
.topo { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.ola { font-size: 20px; font-weight: 700; }

.mes-nav {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border-radius: 14px; padding: 6px; margin-bottom: 12px;
}
.mes-nav span { font-weight: 700; }
.mes-nav button {
  width: 42px; height: 42px; border: 0; border-radius: 10px;
  background: var(--cinza); font-size: 22px; cursor: pointer;
}

.card-sobrou {
  background: linear-gradient(135deg, var(--prim), var(--prim-esc));
  color: #fff; border-radius: var(--raio); padding: 20px; margin-bottom: 10px;
}
.card-sobrou.negativo { background: linear-gradient(135deg, #b91c1c, #7f1d1d); }
.card-sobrou span { font-size: 14px; opacity: .85; }
.card-sobrou strong { display: block; font-size: 34px; margin-top: 4px; letter-spacing: -.5px; }

.linha-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card { background: var(--card); border-radius: var(--raio); padding: 14px; min-width: 0; }
.card span { font-size: 13px; color: var(--suave); }
.card strong { display: block; font-size: 18px; margin-top: 4px; overflow-wrap: anywhere; }
.card-entrada strong { color: var(--ent); }
.card-saida strong { color: var(--sai); }

.plano-info { background: var(--card); border-radius: var(--raio); padding: 12px 14px; margin: 12px 0; font-size: 14px; }
.plano-info:empty { display: none; }
.plano-texto { display: flex; justify-content: space-between; color: var(--suave); margin-bottom: 8px; }
.barra { height: 8px; background: var(--cinza); border-radius: 99px; overflow: hidden; }
.barra div { height: 100%; background: var(--prim); border-radius: 99px; transition: width .3s; }
.plano-info.esgotado .barra div { background: var(--alerta); }
.plano-info .btn { margin-top: 10px; padding: 11px; font-size: 15px; }
.plano-info.assinante { color: var(--prim); font-weight: 600; text-align: center; }

.lista h2 { font-size: 16px; margin: 18px 0 8px; }
#lista-lancamentos { list-style: none; background: var(--card); border-radius: var(--raio); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 10px 12px 14px; border-bottom: 1px solid var(--borda); }
.item:last-child { border-bottom: 0; }
.item-icone { width: 38px; height: 38px; flex-shrink: 0; border-radius: 11px; display: grid; place-items: center; font-weight: 800; }
.entrada .item-icone { background: var(--ent-bg); color: var(--ent); }
.saida .item-icone { background: var(--sai-bg); color: var(--sai); }
.item-info { flex: 1; min-width: 0; }
.item-desc { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-data { font-size: 13px; color: var(--suave); }
.item-valor { font-weight: 700; white-space: nowrap; }
.entrada .item-valor { color: var(--ent); }
.saida .item-valor { color: var(--sai); }
.item-excluir { width: 34px; height: 34px; border: 0; background: none; color: #a0aec0; font-size: 22px; cursor: pointer; border-radius: 8px; }
.item-excluir:active { background: var(--cinza); }
.vazio { text-align: center; color: var(--suave); padding: 28px 16px; background: var(--card); border-radius: var(--raio); line-height: 1.6; }

.acoes {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  max-width: 480px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 16px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(rgba(243,245,244,0), var(--fundo) 35%);
}
.acoes .btn { box-shadow: 0 4px 14px rgba(0,0,0,.12); }

/* ---------- janelas (modais) ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal-fundo { position: absolute; inset: 0; background: rgba(15,23,42,.45); }
.modal-caixa {
  position: relative; width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto;
  background: var(--card); border-radius: 22px 22px 0 0;
  padding: 22px 16px calc(20px + env(safe-area-inset-bottom));
  animation: sobe .22s ease-out;
}
@keyframes sobe { from { transform: translateY(40px); opacity: 0; } }
.modal-caixa h3 { font-size: 19px; margin-bottom: 14px; }

.tipo-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 14px; background: var(--cinza); border-radius: 12px; }
.tipo-toggle button { padding: 10px; border: 0; border-radius: 9px; background: none; font-weight: 700; color: var(--suave); cursor: pointer; }
.tipo-toggle button.ativo { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.tipo-toggle button.ativo[data-tipo="entrada"] { color: var(--ent); }
.tipo-toggle button.ativo[data-tipo="saida"] { color: var(--sai); }
.modal-botoes { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 6px; }

.paywall { text-align: center; }
.paywall-icone { width: 58px; height: 58px; margin: 2px auto 12px; border-radius: 50%; background: var(--alerta-bg); color: var(--alerta); display: grid; place-items: center; font-size: 28px; }
.paywall p { color: var(--suave); line-height: 1.5; margin-bottom: 14px; }
.preco { font-size: 34px; font-weight: 800; margin-bottom: 10px; }
.preco small { font-size: 16px; font-weight: 600; color: var(--suave); }
.beneficios { list-style: none; text-align: left; display: inline-block; margin-bottom: 16px; color: var(--texto); line-height: 1.9; }
.paywall .btn + .btn { margin-top: 8px; }
.pagamento-seguro { font-size: 12px; color: var(--suave); margin-top: 12px; line-height: 1.5; }
.plano-sub { font-size: 13px; font-weight: 400; color: var(--suave); margin-top: 4px; }
.link-cancelar { background: none; border: 0; padding: 0; color: var(--suave); text-decoration: underline; font-size: 13px; cursor: pointer; }

/* ---------- aviso rápido ---------- */
.toast {
  position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top)); z-index: 60; transform: translateX(-50%);
  background: #1c2626; color: #fff; padding: 11px 18px; border-radius: 99px;
  font-size: 14px; max-width: calc(100% - 32px); text-align: center;
}
