:root {
  --azul: #1e3a6e;
  --azul-escuro: #142a52;
  --ocre: #e0a93b;
  --marrom: #3b2f2a;
  --fundo: #f5f2ec;
  --cartao: #ffffff;
  --texto: #1f2430;
  --suave: #6b7080;
  --borda: #e6e0d5;
  --erro: #b3261e;
  --seguro-baixo: env(safe-area-inset-bottom, 0px);
  --seguro-topo: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--fundo); color: var(--texto); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button { font: inherit; color: inherit; }
.ic { width: 24px; height: 24px; flex: none; }

.carregando { min-height: 100vh; display: grid; place-items: center; background: var(--azul); }
.carregando img { width: 88px; height: 88px; border-radius: 20px; animation: pulsa 1.2s ease-in-out infinite; }
@keyframes pulsa { 50% { transform: scale(.92); opacity: .8; } }

/* acesso */
.acesso { min-height: 100vh; display: flex; flex-direction: column; background: var(--fundo); }
.acesso-foto { height: 38vh; min-height: 220px; background: linear-gradient(180deg, rgba(20,42,82,.15), rgba(20,42,82,.85)), url(/assets/img/portaria.webp) center/cover; display: flex; align-items: flex-end; padding: calc(1rem + var(--seguro-topo)) 1.25rem 1.25rem; }
.acesso-foto.curta { height: 22vh; min-height: 160px; }
.acesso-marca { display: flex; gap: .75rem; align-items: center; color: #fff; }
.acesso-marca img { width: 52px; height: 52px; border-radius: 12px; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.acesso-marca small { display: block; font-size: .8rem; opacity: .85; }
.acesso-marca strong { font-size: 1.35rem; }
.acesso-form { flex: 1; display: flex; flex-direction: column; gap: .85rem; padding: 1.5rem 1.25rem calc(2rem + var(--seguro-baixo)); width: 100%; max-width: 460px; margin: 0 auto; }
.acesso-form h1 { margin: 0 0 .2rem; font-size: 1.5rem; color: var(--azul); }

label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .92rem; }
input { font: inherit; font-weight: 400; padding: .8rem .9rem; border: 1px solid var(--borda); border-radius: 12px; background: #fff; width: 100%; color: var(--texto); }
input:focus { outline: 2px solid var(--ocre); border-color: var(--ocre); }
input.codigo { letter-spacing: .5rem; font-size: 1.4rem; text-align: center; font-weight: 700; }
.botao { background: var(--azul); color: #fff; border: 0; border-radius: 12px; padding: .9rem 1rem; font-weight: 700; cursor: pointer; width: 100%; }
.botao:active { transform: scale(.98); }
.botao:disabled { opacity: .6; }
.botao.claro { background: transparent; color: var(--azul); border: 1px solid var(--borda); }
.erro { color: var(--erro); margin: 0; min-height: 1.2em; font-size: .92rem; }
.nota { color: var(--suave); font-size: .88rem; margin: 0; }

/* casca do app */
.topo { position: sticky; top: 0; z-index: 5; background: var(--azul); color: #fff; padding: calc(.85rem + var(--seguro-topo)) 1rem .85rem; display: flex; align-items: center; gap: .5rem; }
.topo h1 { font-size: 1.1rem; margin: 0; }
.voltar { background: none; border: 0; color: #fff; padding: .2rem; margin-left: -.3rem; display: flex; cursor: pointer; }
.corpo { padding: 1rem 1rem calc(6rem + var(--seguro-baixo)); max-width: 640px; margin: 0 auto; }
.abas { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; background: #fff; border-top: 1px solid var(--borda); padding-bottom: var(--seguro-baixo); }
.abas button { flex: 1; background: none; border: 0; padding: .55rem 0 .5rem; display: flex; flex-direction: column; align-items: center; gap: .1rem; font-size: .75rem; color: var(--suave); position: relative; cursor: pointer; }
.abas button.ativa { color: var(--azul); font-weight: 700; }
.abas .selo { position: absolute; top: .3rem; left: calc(50% + 6px); background: var(--erro); color: #fff; font-size: .68rem; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }

.ola { border-radius: 18px; padding: 1.4rem 1.25rem; color: #fff; background-size: cover; background-position: center; margin-bottom: 1rem; }
.ola p { margin: 0; opacity: .85; }
.ola h2 { margin: 0 0 .3rem; font-size: 1.7rem; }
.ola small { opacity: .9; }

.faixa-instalar { width: 100%; display: flex; align-items: center; gap: .8rem; text-align: left; background: #fff7e6; border: 1px solid #f1d9a6; color: var(--marrom); border-radius: 14px; padding: .85rem 1rem; margin-bottom: 1rem; cursor: pointer; }
.faixa-instalar strong { display: block; }
.faixa-instalar span { font-size: .88rem; }

.grade { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.atalho { background: #fff; border: 1px solid var(--borda); border-radius: 16px; padding: 1rem; text-align: left; display: flex; flex-direction: column; gap: .4rem; min-height: 112px; cursor: pointer; color: var(--texto); }
.atalho .ic { color: var(--azul); width: 28px; height: 28px; }
.atalho strong { font-size: .98rem; }
.atalho small { color: var(--ocre); font-weight: 700; font-size: .8rem; }
.atalho.breve { cursor: default; }
.atalho.breve .ic { color: #a9b0c0; }
.atalho.breve small { color: var(--suave); font-weight: 400; }
.fale { display: flex; align-items: center; justify-content: center; gap: .5rem; margin-top: 1rem; padding: .9rem; border-radius: 14px; background: #1f7a4d; color: #fff; text-decoration: none; font-weight: 700; }

.comunicados { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.comunicados button { width: 100%; text-align: left; background: #fff; border: 1px solid var(--borda); border-radius: 14px; padding: .9rem 1rem; display: flex; flex-direction: column; gap: .25rem; cursor: pointer; }
.comunicados button.novo { border-left: 4px solid var(--ocre); }
.comunicados button.novo .titulo::after { content: "novo"; margin-left: .5rem; font-size: .7rem; background: var(--ocre); color: var(--marrom); padding: .05rem .4rem; border-radius: 6px; vertical-align: middle; }
.comunicados .titulo { font-weight: 700; }
.comunicados .resumo { color: var(--suave); font-size: .92rem; }
.comunicados small { color: var(--suave); font-size: .8rem; }
.comunicado { background: #fff; border-radius: 16px; padding: 1.2rem; border: 1px solid var(--borda); }
.comunicado h2 { margin: 0 0 .2rem; color: var(--azul); }
.comunicado small { color: var(--suave); }
.comunicado .texto { margin-top: 1rem; }

.cartao { background: #fff; border: 1px solid var(--borda); border-radius: 16px; padding: 1.1rem 1.2rem; margin-bottom: 1rem; }
.cartao h2 { margin: 0 0 .6rem; font-size: 1.1rem; }
.formulario { display: flex; flex-direction: column; gap: .85rem; }
dl { display: grid; grid-template-columns: auto 1fr; gap: .3rem 1rem; margin: 0 0 .7rem; }
dt { color: var(--suave); }
dd { margin: 0; }
.unidades { list-style: none; padding: 0; margin: 0; }
.unidades li { padding: .5rem 0; border-bottom: 1px solid var(--borda); display: flex; flex-direction: column; }
.unidades li:last-child { border: 0; }
.unidades small { color: var(--suave); }
.menu { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--borda); border-radius: 16px; overflow: hidden; }
.menu button { background: none; border: 0; border-bottom: 1px solid var(--borda); padding: 1rem 1.1rem; display: flex; align-items: center; gap: .8rem; text-align: left; cursor: pointer; }
.menu button:last-child { border: 0; }
.menu .perigo { color: var(--erro); }
.passos ol { padding-left: 1.2rem; margin: 0 0 .6rem; }
.passos li { margin-bottom: .4rem; }
.vazio, .lista-carregando { color: var(--suave); text-align: center; padding: 2rem 0; }

/* módulos */
select, textarea { font: inherit; font-weight: 400; padding: .8rem .9rem; border: 1px solid var(--borda); border-radius: 12px; background: #fff; width: 100%; color: var(--texto); }
textarea { resize: vertical; }
label.marcar { flex-direction: row; align-items: center; gap: .6rem; font-weight: 400; }
label.marcar input { width: auto; }
.novo-item { display: flex; align-items: center; justify-content: center; gap: .4rem; margin-bottom: 1rem; }
.novo-item .ic { width: 20px; height: 20px; }
.topo-nota { margin: 0 0 .8rem; }
h3.secao { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--suave); margin: 1.2rem 0 .5rem; }
.itens { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.itens.apagados { opacity: .7; }
.item { background: #fff; border: 1px solid var(--borda); border-radius: 14px; padding: .85rem 1rem; display: flex; gap: .8rem; align-items: center; justify-content: space-between; }
.item > div { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.item strong { font-size: .98rem; }
.item small { color: var(--suave); font-size: .84rem; }
.item small.motivo { color: var(--erro); }
.item.clicavel { cursor: pointer; }
.item.nova { border-left: 4px solid var(--ocre); }
.item small.novidade { color: #9a6a00; font-weight: 700; }
.item.doc { text-decoration: none; color: inherit; justify-content: flex-start; }
.item.doc .ic { color: var(--azul); }
.acoes-item .botao { width: auto; display: inline-flex; align-items: center; gap: .3rem; padding: .5rem .8rem; }
.acoes-item .ic { width: 18px; height: 18px; }
.botao.pequeno { padding: .5rem .8rem; font-size: .9rem; }
.link { background: none; border: 0; color: var(--azul); font: inherit; padding: .3rem; cursor: pointer; text-decoration: underline; }
.link.perigo { color: var(--erro); }
.etiqueta { display: inline-block; align-self: flex-start; font-size: .72rem; font-weight: 700; padding: .1rem .5rem; border-radius: 6px; background: #ece9e2; color: var(--suave); margin: .15rem 0; }
.etiqueta.ok { background: #e3f3ea; color: #1f7a4d; }
.etiqueta.espera { background: #fbf0d6; color: #9a6a00; }
.etiqueta.ruim { background: #fbe7e5; color: var(--erro); }
.lista-info { margin: 0; padding-left: 1.1rem; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .45rem; }
.slot { border: 1px solid var(--borda); background: #fff; border-radius: 10px; padding: .6rem .3rem; font-weight: 600; cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.slot small { font-weight: 400; font-size: .72rem; }
.slot:disabled { background: #f1eee8; color: #aaa; cursor: default; text-decoration: line-through; }
.slot.escolhido { background: var(--azul); color: #fff; border-color: var(--azul); }
.regras-uso { background: #faf8f4; border: 1px solid var(--borda); border-radius: 10px; padding: .6rem .8rem; }
.regras-uso summary { font-weight: 700; cursor: pointer; }
.linha2 { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.foto-campo { flex-direction: row; align-items: center; gap: .6rem; border: 1px dashed #c9c1b2; border-radius: 12px; padding: .8rem; cursor: pointer; color: var(--azul); font-weight: 600; }
.foto-campo input { display: none; }
.foto-previa { max-width: 100%; max-height: 220px; border-radius: 12px; object-fit: cover; }
.convite-pronto { text-align: center; display: flex; flex-direction: column; gap: .7rem; }
.convite-pronto h2 { margin: 0; color: var(--azul); font-size: 1.4rem; }
.convite-pronto .nota { margin: 0; }
.codigo-grande { font-size: 2.2rem; font-weight: 800; letter-spacing: .3rem; color: var(--azul); font-variant-numeric: tabular-nums; }
.botao.zap { background: #1f7a4d; display: flex; align-items: center; justify-content: center; gap: .5rem; text-decoration: none; }
a.botao, .convite-pronto .botao { display: flex; align-items: center; justify-content: center; gap: .5rem; text-decoration: none; box-sizing: border-box; }
.destaque-aviso { display: flex; gap: .8rem; align-items: center; background: #fff7e6; border: 1px solid #f1d9a6; border-radius: 14px; padding: .9rem 1rem; margin-bottom: 1rem; color: var(--marrom); }
.conversa { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1rem; }
.msg { max-width: 85%; background: #fff; border: 1px solid var(--borda); border-radius: 14px; padding: .7rem .9rem; }
.msg.morador { align-self: flex-end; background: #e9eef8; border-color: #d3dcef; }
.msg small { color: var(--suave); font-size: .78rem; }
.msg p { margin: .2rem 0 0; }
.msg img { display: block; max-width: 100%; max-height: 260px; border-radius: 10px; margin-top: .4rem; }
.enquete h2 { color: var(--azul); }
.opcoes-voto { display: flex; flex-direction: column; gap: .5rem; margin: .6rem 0; }
.ja-votou { color: #1f7a4d; }
.resultado { display: grid; grid-template-columns: 1fr auto; gap: .2rem .8rem; margin-top: .7rem; font-size: .92rem; }
.resultado .barra { grid-column: 1 / -1; height: 8px; background: #eee9df; border-radius: 6px; overflow: hidden; }
.resultado .barra i { display: block; height: 100%; background: var(--ocre); }

@media (min-width: 700px) {
  .grade { grid-template-columns: repeat(3, 1fr); }
}

/* boletos */
.boleto { display: flex; flex-direction: column; gap: .5rem; }
.boleto.vencido { border-left: 4px solid var(--erro); }
.boleto-topo { display: flex; justify-content: space-between; gap: .6rem; align-items: flex-start; }
.boleto-topo small { display: block; color: var(--suave); }
.boleto-valor { font-size: 1.7rem; font-weight: 800; color: var(--azul); line-height: 1.1; margin: .2rem 0 .3rem; }
.boleto-valor small { display: block; font-size: .85rem; font-weight: 500; color: var(--suave); }
.boleto .botao { width: 100%; justify-content: center; }
.link-discreto { text-align: center; color: var(--azul); font-size: .9rem; padding: .3rem; }
.destaque-aviso.ok { background: #e9f6ee; border-color: #bfe3cc; color: #1d6b3f; }.desconto-app { margin: -.2rem 0 .2rem; color: #1d6b3f; font-size: .88rem; font-weight: 600; }
.composicao-app { list-style: none; margin: 0 0 .3rem; padding: 0; font-size: .88rem; color: var(--suave); }
.composicao-app li { display: flex; justify-content: space-between; padding: .15rem 0; border-bottom: 1px dashed var(--borda); }