/* Identidade visual da Pro Pública Brasil sobre uma conversa no estilo WhatsApp */
:root {
  --azul: #32587d;
  --azul-escuro: #24435f;
  --verde: #4eb1a1;
  --verde-escuro: #1b6e61;
  --verde-claro: #b5e5e3;
  --bolha-minha: #d6f1ec;
  --fundo: #e8f3f1;
  --texto: #1f2d3a;
  --cinza: #667781;
  --branco: #ffffff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Mulish', Arial, sans-serif;
  background: #cfe3e6;
  color: var(--texto);
  -webkit-font-smoothing: antialiased;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 760px;
  margin: 0 auto;
  background: var(--fundo);
  box-shadow: 0 0 40px rgba(36, 67, 95, .18);
}

/* Cabeçalho */
.topo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: var(--azul);
  color: var(--branco);
}
.avatar { width: 44px; height: 44px; border-radius: 50%; flex: none; }
.topo-texto { flex: 1; min-width: 0; }
.topo h1 { font-family: 'Montserrat', Arial, sans-serif; font-size: 17px; font-weight: 700; line-height: 1.2; }
.topo p { font-size: 13px; color: #cfe0ea; }
.topo-logo { height: 34px; width: auto; filter: brightness(0) invert(1); opacity: .9; }

/* Faixa das entidades: PPB, FENECAP e ANEPECP */
.parceiros {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 8px 16px;
  background: var(--branco);
  border-bottom: 1px solid #d5e3e1;
}
.parceiro { display: block; width: auto; height: 36px; }
.parceiro-ppb { height: 30px; }
.parceiro-fenecap { height: 40px; }

/* Área da conversa */
.conversa {
  flex: 1;
  overflow-y: auto;
  padding: 16px 5% 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background-color: var(--fundo);
  background-image:
    radial-gradient(circle at 12px 12px, rgba(78, 177, 161, .12) 2px, transparent 2.5px),
    radial-gradient(circle at 36px 36px, rgba(50, 88, 125, .08) 2px, transparent 2.5px);
  background-size: 48px 48px;
}
.aviso-cripto {
  align-self: center;
  max-width: 90%;
  margin: 4px 0 12px;
  padding: 6px 12px;
  border-radius: 8px;
  background: #fdf6d8;
  color: #54656f;
  font-size: 12.5px;
  text-align: center;
}

/* Balões */
.msg {
  position: relative;
  max-width: 82%;
  padding: 7px 10px 18px;
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.45;
  box-shadow: 0 1px .5px rgba(11, 20, 26, .13);
  animation: chega .18s ease-out;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.msg + .msg.ela, .msg + .msg.eu { margin-top: 2px; }
.msg.ela { align-self: flex-start; background: var(--branco); border-top-left-radius: 2px; }
.msg.eu { align-self: flex-end; background: var(--bolha-minha); border-top-right-radius: 2px; }
.msg.ela.primeira { margin-top: 8px; }
.msg.eu.primeira { margin-top: 8px; }
.msg b { font-weight: 700; color: var(--azul-escuro); }
.msg a { color: var(--verde-escuro); font-weight: 600; }
.msg .hora {
  position: absolute;
  right: 8px;
  bottom: 3px;
  font-size: 11px;
  color: var(--cinza);
  white-space: nowrap;
}
.msg.eu .hora::after { content: " ✓✓"; color: var(--verde); letter-spacing: -2px; }

@keyframes chega { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Digitando */
.digitando { display: inline-flex; gap: 4px; padding: 12px 14px; }
.digitando span {
  width: 7px; height: 7px; border-radius: 50%;
  background: #9bb3b0;
  animation: pisca 1.2s infinite ease-in-out;
}
.digitando span:nth-child(2) { animation-delay: .2s; }
.digitando span:nth-child(3) { animation-delay: .4s; }
@keyframes pisca { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* Documento anexo */
.doc {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 4px;
  padding: 10px;
  border-radius: 6px;
  background: #f0f7f6;
  text-decoration: none;
  color: var(--texto);
  white-space: normal;
}
.doc-icone {
  flex: none;
  width: 38px; height: 46px;
  border-radius: 4px;
  background: var(--azul);
  color: var(--branco);
  font: 700 10px 'Montserrat', Arial, sans-serif;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 6px;
}
.doc-nome { font-weight: 700; font-size: 14px; line-height: 1.3; }
.doc-info { font-size: 12px; color: var(--cinza); }
.doc-baixar {
  margin-left: auto;
  flex: none;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--verde);
  color: var(--verde-escuro);
  display: flex; align-items: center; justify-content: center;
}

/* Respostas rápidas */
.opcoes {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 5%;
  background: var(--fundo);
}
.opcoes:not(:empty) { padding-top: 6px; padding-bottom: 8px; }
.opcao {
  border: 1.5px solid var(--verde);
  background: var(--branco);
  color: var(--verde-escuro);
  font: 700 14px 'Mulish', Arial, sans-serif;
  padding: 8px 14px;
  border-radius: 18px;
  cursor: pointer;
}
.opcao:hover, .opcao:focus-visible { background: var(--verde); color: var(--branco); outline: none; }

/* Rodapé de digitação */
.rodape {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  background: #f0f2f5;
}
.entrada {
  flex: 1;
  min-width: 0;
  border: none;
  border-radius: 22px;
  padding: 11px 16px;
  font: 400 15px 'Mulish', Arial, sans-serif;
  color: var(--texto);
  background: var(--branco);
}
.entrada:focus { outline: 2px solid var(--verde-claro); }
.entrada:disabled { background: #e9edef; }
.enviar {
  flex: none;
  width: 46px; height: 46px;
  border: none;
  border-radius: 50%;
  background: var(--verde);
  color: var(--branco);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.enviar:disabled { background: #a9cfc8; cursor: default; }

@media (max-width: 520px) {
  .msg { max-width: 90%; font-size: 15px; }
  .topo-logo { height: 28px; }
  .parceiros { gap: 18px; padding: 6px 12px; }
  .parceiro { height: 28px; }
  .parceiro-ppb { height: 24px; }
  .parceiro-fenecap { height: 32px; }
}
