/* Conecta · app do cliente. Mobile first, cara de app. A cor vem do escritório (--cor, --cor-texto). */
:root {
  --cor: #0B1F2A;
  --cor-texto: #FFFFFF;
  --cor-suave: color-mix(in srgb, var(--cor) 10%, #FFFFFF);
  --fundo: #F4F7F6;
  --cartao: #FFFFFF;
  --tinta: #0B1F2A;
  --apagado: #5B6B73;
  --linha: #E3E9E7;
  --alerta: #B45309;
  --alerta-fundo: #FEF3C7;
  --ok: #157F45;
  --ok-fundo: #DCF5E6;
  --info: #1D4E89;
  --info-fundo: #E3EDFA;
  --perigo: #B42318;
  --raio: 16px;
  --barra: 64px;
  --seguro-baixo: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--fundo); color: var(--tinta);
  font: 16px/1.45 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, .ola, .protocolo { font-family: Sora, Inter, system-ui, sans-serif; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 22px; height: 22px; flex: none; }
[hidden] { display: none !important; }

/* ---------- abrindo / carregando ---------- */
.abrindo { min-height: 100dvh; display: grid; place-items: center; }
.girando { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--linha); border-top-color: var(--cor); animation: girar .8s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
.esqueleto { display: grid; gap: 12px; padding-top: 8px; }
.esqueleto span { height: 76px; border-radius: var(--raio); background: linear-gradient(90deg, #E9EEEC 0%, #F5F8F7 50%, #E9EEEC 100%); background-size: 200% 100%; animation: brilho 1.2s ease-in-out infinite; }
@keyframes brilho { to { background-position: -200% 0; } }

/* ---------- casca ---------- */
.casca { min-height: 100dvh; padding-bottom: calc(var(--barra) + var(--seguro-baixo) + 12px); }
.casca.sem-barra { padding-bottom: 24px; }
.topo {
  position: sticky; top: 0; z-index: 20; background: var(--cor); color: var(--cor-texto);
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px; display: flex; flex-direction: column; gap: 8px;
}
.topo-marca { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topo-marca b { font-family: Sora, Inter, sans-serif; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; background: #FFFFFF; flex: none; }
.logo.pequeno { width: 32px; height: 32px; border-radius: 8px; }
.logo.grande { width: 72px; height: 72px; border-radius: 18px; }
.logo.iniciais { display: grid; place-items: center; font: 700 15px Sora, Inter, sans-serif; color: var(--cor); }
.logo.grande.iniciais { font-size: 26px; }
.chip-empresa {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; max-width: 100%; align-self: flex-start;
  padding: 6px 12px; border-radius: 999px; border: 0; background: color-mix(in srgb, var(--cor-texto) 16%, transparent); color: var(--cor-texto); cursor: pointer;
}
.chip-empresa svg { width: 18px; height: 18px; }
.chip-empresa span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; font-size: 14px; }
.chip-empresa small { opacity: .8; font-size: 12px; text-decoration: underline; }
.chip-empresa.so-texto { cursor: default; }
.conteudo { padding: 16px; max-width: 640px; margin: 0 auto; }

/* barra inferior */
.barra {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--barra) + var(--seguro-baixo)); padding-bottom: var(--seguro-baixo);
  background: #FFFFFF; border-top: 1px solid var(--linha); box-shadow: 0 -4px 16px rgba(11, 31, 42, .05);
}
.barra a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--apagado); font-size: 12px; font-weight: 600; }
.barra a[aria-current="page"] { color: var(--cor); }
.barra a[aria-current="page"] svg { stroke-width: 2.3; }

/* ---------- textos e blocos ---------- */
.ola { font-size: 24px; margin: 4px 0 16px; }
.titulo-tela { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 16px; }
.titulo-tela h1, .titulo-simples { font-size: 24px; margin: 0; }
.titulo-simples { margin: 8px 0 4px; }
.apoio { color: var(--apagado); font-size: 14px; margin: 8px 0 16px; }
.centro { text-align: center; }
.bloco { margin: 24px 0; }
.titulo-bloco { display: flex; align-items: center; gap: 8px; font-size: 17px; margin: 0 0 10px; }
.titulo-bloco.pequeno { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--apagado); font-family: Inter, sans-serif; }
.titulo-bloco.alerta { color: var(--alerta); }
.titulo-linha { display: flex; align-items: baseline; justify-content: space-between; }
.titulo-linha a { font-size: 14px; font-weight: 600; color: var(--cor); text-decoration: none; padding: 8px 0; }
.contador { background: var(--alerta); color: #FFFFFF; border-radius: 999px; padding: 0 8px; font-size: 13px; line-height: 22px; font-family: Inter, sans-serif; }
.protocolo { font-weight: 700; color: var(--apagado); font-size: 14px; }
.protocolo.grande { font-size: 22px; color: var(--tinta); }

/* ---------- botões ---------- */
.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px;
  border-radius: 12px; border: 1px solid var(--linha); background: #FFFFFF; font-weight: 600; text-decoration: none; cursor: pointer;
}
.botao.principal { background: var(--cor); color: var(--cor-texto); border-color: transparent; }
.botao.grande { width: 100%; min-height: 56px; font-size: 17px; border-radius: 14px; }
.botao.icone { width: 44px; padding: 0; flex: none; }
.botao[disabled] { opacity: .6; cursor: wait; }
.botao.sair { margin-top: 24px; color: var(--perigo); }
.botao:active { transform: scale(.98); }
.link { background: none; border: 0; padding: 10px 4px; color: var(--cor); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link[disabled] { color: var(--apagado); text-decoration: none; cursor: default; }
.atalhos { display: grid; gap: 10px; margin: 20px 0; }
@media (min-width: 420px) { .atalhos { grid-template-columns: 1fr 1fr; } }

/* ---------- cartões e listas ---------- */
.cartao { background: var(--cartao); border-radius: var(--raio); padding: 16px; border: 1px solid var(--linha); }
.cartoes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cartao.pendente {
  display: grid; gap: 6px; text-decoration: none; border: 2px solid var(--alerta); background: #FFFBEB;
}
.cartao.pendente b { font-size: 17px; }
.cartao.pendente .botao { justify-self: start; margin-top: 4px; }
.trecho { margin: 0; color: var(--apagado); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tudo-certo { display: flex; gap: 12px; align-items: flex-start; }
.tudo-certo svg { color: var(--ok); background: var(--ok-fundo); border-radius: 50%; padding: 6px; width: 34px; height: 34px; }
.tudo-certo p, .instalar p, .dica p { margin: 2px 0 0; color: var(--apagado); font-size: 14px; }
.lista { list-style: none; margin: 0; padding: 0; background: var(--cartao); border: 1px solid var(--linha); border-radius: var(--raio); overflow: hidden; }
.lista li + li { border-top: 1px solid var(--linha); }
.item {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 12px 14px;
  background: none; border: 0; text-align: left; text-decoration: none; cursor: pointer;
}
.item:active { background: var(--cor-suave); }
.item.atual { background: var(--cor-suave); }
.item > svg { color: var(--apagado); width: 18px; height: 18px; }
.texto-item { flex: 1; min-width: 0; display: grid; gap: 2px; }
.texto-item b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.texto-item small { color: var(--apagado); font-size: 13px; }
.linha-topo { display: flex; align-items: center; gap: 8px; }
.tipo-arquivo { width: 42px; height: 42px; border-radius: 10px; background: var(--cor-suave); color: var(--cor); display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }
.selo { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.selo.neutro { background: #EEF2F1; color: var(--apagado); }
.selo.info { background: var(--info-fundo); color: var(--info); }
.selo.alerta { background: var(--alerta-fundo); color: var(--alerta); }
.selo.ok { background: var(--ok-fundo); color: var(--ok); }

/* segmento (abas) */
.segmento { display: grid; grid-template-columns: 1fr 1fr; background: #E7EDEB; border-radius: 12px; padding: 4px; margin: 16px 0; }
.segmento button { min-height: 40px; border: 0; background: none; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--apagado); cursor: pointer; }
.segmento button[aria-selected="true"] { background: #FFFFFF; color: var(--tinta); box-shadow: 0 1px 3px rgba(11, 31, 42, .12); }

.vazio { text-align: center; padding: 32px 16px; display: grid; gap: 8px; justify-items: center; }
.vazio b { font-size: 17px; }
.vazio p { margin: 0; color: var(--apagado); max-width: 32ch; }
.vazio.erro b { color: var(--perigo); }

/* ---------- solicitação ---------- */
.voltar { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; color: var(--cor); font-weight: 600; text-decoration: none; margin-left: -6px; }
.cabeca-solicitacao { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 10px; margin: 4px 0 16px; }
.cabeca-solicitacao .selo { justify-self: start; }
.cabeca-solicitacao h1 { grid-column: 1 / -1; font-size: 21px; margin: 4px 0 0; }
.cabeca-solicitacao .meta { grid-column: 1 / -1; margin: 0; color: var(--apagado); font-size: 14px; }
.aviso-alerta, .aviso-ok { display: flex; gap: 10px; align-items: flex-start; border-radius: 14px; padding: 12px 14px; margin-bottom: 16px; }
.aviso-alerta { background: var(--alerta-fundo); color: #78350F; }
.aviso-alerta p { margin: 0; }
.aviso-ok { background: var(--ok-fundo); color: #14532D; }
.aviso-ok p { margin: 2px 0 0; font-size: 14px; }
.conversa { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.bolha { max-width: 86%; padding: 10px 14px; border-radius: 16px; display: grid; gap: 6px; }
.bolha p { margin: 0; overflow-wrap: anywhere; }
.bolha time { font-size: 11px; opacity: .7; justify-self: end; }
.bolha.deles { background: #FFFFFF; border: 1px solid var(--linha); border-bottom-left-radius: 4px; justify-self: start; }
.bolha.minha { background: var(--cor); color: var(--cor-texto); border-bottom-right-radius: 4px; justify-self: end; }
.autor { font-size: 12px; font-weight: 700; color: var(--apagado); }
.sem-msg { color: var(--apagado); text-align: center; }
.anexo { display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 10px; border-radius: 10px; border: 0; background: color-mix(in srgb, currentColor 10%, transparent); text-align: left; cursor: pointer; }
.anexo svg { width: 16px; height: 16px; }
.anexo span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: underline; }
.resposta {
  position: sticky; bottom: calc(var(--barra) + var(--seguro-baixo)); background: var(--fundo); padding: 8px 0; margin: 0 -4px;
}
.linha-resposta { display: flex; align-items: flex-end; gap: 8px; background: #FFFFFF; border: 1px solid var(--linha); border-radius: 18px; padding: 6px; }
.linha-resposta textarea { flex: 1; border: 0; resize: none; min-height: 44px; max-height: 160px; padding: 10px 6px; background: none; outline: none; }
.linha-resposta .botao { border: 0; }
.cartao.fim { text-align: center; display: grid; gap: 8px; justify-items: center; }
.cartao.fim svg { color: var(--ok); }
.cartao.fim p { margin: 0; color: var(--apagado); }

/* anexos escolhidos */
.anexos { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.anexos li { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; background: var(--cor-suave); border-radius: 999px; padding: 4px 4px 4px 10px; font-size: 13px; }
.anexos li svg { width: 15px; height: 15px; }
.anexos li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anexos li button { border: 0; background: none; width: 32px; height: 32px; display: grid; place-items: center; cursor: pointer; }
.folha .anexos li { padding-right: 10px; }

/* ---------- formulários ---------- */
.formulario { display: grid; gap: 14px; }
.campo { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.campo small { font-weight: 400; color: var(--apagado); }
.campo input, .campo textarea, .campo select {
  width: 100%; min-height: 52px; padding: 12px 14px; border: 1.5px solid var(--linha); border-radius: 12px; background: #FFFFFF; font-size: 16px; font-weight: 400;
}
.campo textarea { resize: vertical; }
.campo input:focus, .campo textarea:focus, .campo select:focus, .linha-resposta:focus-within { outline: none; border-color: var(--cor); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cor) 18%, transparent); }
.campo .codigo { font: 700 28px/1 Sora, Inter, monospace; letter-spacing: .4em; text-align: center; }
.assunto { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--cor-suave); border-radius: 12px; padding: 6px 6px 6px 14px; font-weight: 600; }
.opcoes { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 10px; }
.opcao { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 60px; padding: 14px 16px; background: #FFFFFF; border: 1.5px solid var(--linha); border-radius: 14px; font-weight: 600; text-align: left; cursor: pointer; }
.opcao:active { border-color: var(--cor); background: var(--cor-suave); }
.opcao svg { color: var(--apagado); }

/* ---------- perfil ---------- */
.pessoa { display: grid; gap: 2px; }
.pessoa b { font-size: 18px; }
.pessoa span { color: var(--apagado); }
.escritorio { display: flex; align-items: center; gap: 12px; }
.dica, .instalar { display: flex; gap: 12px; align-items: flex-start; margin: 16px 0; }
.instalar { flex-wrap: wrap; }
.instalar > div:first-of-type { flex: 1; min-width: 180px; }
.instalar .acoes { display: flex; gap: 8px; align-items: center; width: 100%; }

/* ---------- folha que sobe da base ---------- */
.veu { position: fixed; inset: 0; background: rgba(11, 31, 42, .45); z-index: 40; animation: aparecer .15s ease-out; }
.folha {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: #FFFFFF; border-radius: 22px 22px 0 0;
  padding: 10px 16px calc(20px + var(--seguro-baixo)); max-height: 88dvh; overflow: auto; animation: subir .2s ease-out;
}
.folha::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--linha); margin: 0 auto 12px; }
.folha h2 { font-size: 19px; margin: 0 0 12px; }
@media (min-width: 700px) { .folha { left: 50%; right: auto; width: 560px; transform: translateX(-50%); bottom: 24px; border-radius: 22px; } }
@keyframes subir { from { transform: translateY(30px); opacity: 0; } }
@media (min-width: 700px) { @keyframes subir { from { opacity: 0; } } }
@keyframes aparecer { from { opacity: 0; } }
.progresso { height: 8px; background: var(--linha); border-radius: 4px; overflow: hidden; }
.progresso span { display: block; height: 100%; background: var(--cor); transition: width .3s; width: 5%; }
.progresso .p1 { width: 10%; } .progresso .p2 { width: 20%; } .progresso .p3 { width: 30%; } .progresso .p4 { width: 40%; }
.progresso .p5 { width: 50%; } .progresso .p6 { width: 60%; } .progresso .p7 { width: 70%; } .progresso .p8 { width: 80%; } .progresso .p9 { width: 90%; }

/* ---------- entrada ---------- */
.entrar { min-height: 100dvh; display: flex; flex-direction: column; background: linear-gradient(180deg, var(--cor) 0 230px, var(--fundo) 230px); padding: calc(env(safe-area-inset-top, 0px) + 32px) 16px 24px; }
.entrar-marca { display: grid; justify-items: center; gap: 10px; color: var(--cor-texto); text-align: center; margin-bottom: 24px; }
.entrar-marca b { font: 700 20px Sora, Inter, sans-serif; }
.entrar-cartao { background: #FFFFFF; border-radius: 22px; padding: 24px 20px; width: 100%; max-width: 440px; margin: 0 auto; box-shadow: 0 10px 30px rgba(11, 31, 42, .08); }
.entrar-cartao h1 { font-size: 22px; margin: 0 0 6px; }
.entrar-cartao > p { color: var(--apagado); margin: 0 0 18px; }
.entrar-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.erro-linha { background: #FEE4E2; color: var(--perigo); border-radius: 10px; padding: 10px 12px; font-size: 14px; font-weight: 600; margin: 0 0 14px !important; }

/* ---------- aviso (toast) e rodapé ---------- */
#aviso {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--barra) + var(--seguro-baixo) + 12px); z-index: 60; margin: 0 auto; max-width: 480px;
  background: var(--tinta); color: #FFFFFF; border-radius: 12px; padding: 12px 16px; font-weight: 600; font-size: 14px;
  opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .2s, transform .2s;
}
#aviso.visivel { opacity: 1; transform: none; }
#aviso.ok { background: var(--ok); }
#aviso.erro { background: var(--perigo); }
.tecnologia { text-align: center; color: #93A1A8; font-size: 11px; margin: 28px 0 8px; letter-spacing: .02em; }
.tecnologia b { font-weight: 600; }

@media (min-width: 700px) {
  .topo { flex-direction: row; align-items: center; justify-content: space-between; padding-left: 24px; padding-right: 24px; }
  .chip-empresa { align-self: auto; }
  .conteudo { padding: 24px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
