/* Chat de cadastro do médico — identidade do Grupo Zoe (estudio/marca/MARCA.md) */
:root {
  --violeta: #680CC7; --violeta-escuro: #4C0895; --noite: #24063F; --azul: #2A66F4; --orquidea: #C566F3;
  --lilas: #F5EBFD; --lilas-2: #EBDCFA; --texto: #221933; --cinza: #5D5670; --branco: #FFFFFF;
  --fundo: #F7F3FC; --verde: #12805C; --verde-claro: #E3F5EE; --aviso: #B4540A; --aviso-claro: #FDF0E4;
  --grad: linear-gradient(140deg, #7A1FD6 0%, #680CC7 35%, #4C0895 70%, #24063F 100%);
  --grad-marca: linear-gradient(90deg, #C566F3 0%, #680CC7 50%, #2A66F4 100%);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: 'Inter', system-ui, sans-serif; color: var(--texto); background: var(--noite); background-image: var(--grad); }
[hidden] { display: none !important; }
.app {
  height: 100dvh; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column;
  background: var(--fundo); box-shadow: 0 0 60px rgba(20, 2, 40, .45);
}
@media (min-width: 600px) { .app { height: calc(100dvh - 32px); margin-top: 16px; border-radius: 22px; overflow: hidden; } }

.topo {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 16px 14px;
  padding-top: max(12px, env(safe-area-inset-top)); background: var(--grad); color: var(--branco);
}
.topo-icone { width: 40px; height: 40px; object-fit: contain; background: var(--branco); border-radius: 50%; padding: 5px; }
.topo-nome { font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 17px; letter-spacing: -0.01em; }
.topo-sub { font-size: 12.5px; opacity: .85; }
.progresso { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, .18); }
.progresso-barra { height: 100%; width: 0; background: var(--grad-marca); transition: width .4s ease; }

.conversa { flex: 1; overflow-y: auto; padding: 18px 14px 8px; display: flex; flex-direction: column; gap: 8px; scroll-behavior: smooth; }
.bolha {
  max-width: 84%; padding: 10px 14px; border-radius: 18px; font-size: 15.5px; line-height: 1.45; white-space: pre-line;
  overflow-wrap: anywhere; animation: entra .22s ease-out;
}
.bolha.nina { align-self: flex-start; background: var(--branco); border-bottom-left-radius: 6px; box-shadow: 0 1px 2px rgba(36, 6, 63, .08); }
.bolha.medico { align-self: flex-end; background: var(--violeta); color: var(--branco); border-bottom-right-radius: 6px; }
.bolha.erro { background: var(--aviso-claro); color: #6E3306; }
.bolha a { color: var(--violeta); font-weight: 600; }
.secao {
  align-self: center; margin: 10px 0 2px; font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 11px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--violeta); background: var(--lilas); padding: 5px 12px; border-radius: 999px;
}
.digitando { align-self: flex-start; background: var(--branco); border-radius: 18px; border-bottom-left-radius: 6px; padding: 13px 16px; display: flex; gap: 5px; }
.digitando i { width: 7px; height: 7px; border-radius: 50%; background: var(--orquidea); animation: pula 1s infinite ease-in-out; }
.digitando i:nth-child(2) { animation-delay: .15s; } .digitando i:nth-child(3) { animation-delay: .3s; }

.resumo { align-self: stretch; background: var(--branco); border-radius: 16px; padding: 12px 14px; box-shadow: 0 1px 2px rgba(36, 6, 63, .08); animation: entra .22s ease-out; }
.resumo h3 { font-family: 'Montserrat', sans-serif; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--violeta); margin: 10px 0 4px; }
.resumo h3:first-child { margin-top: 0; }
.resumo dl { display: grid; grid-template-columns: minmax(96px, 38%) 1fr; gap: 3px 10px; font-size: 14px; }
.resumo dt { color: var(--cinza); }
.resumo dd { font-weight: 600; overflow-wrap: anywhere; }

.grupo {
  align-self: stretch; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px;
  background: var(--verde-claro); border: 1px solid #BFE6D6; text-decoration: none; color: var(--texto); animation: entra .22s ease-out;
}
.grupo-icone { width: 40px; height: 40px; border-radius: 50%; background: #25D366; display: grid; place-items: center; flex: none; }
.grupo-txt { flex: 1; min-width: 0; }
.grupo-nome { font-weight: 700; font-size: 15px; }
.grupo-acao { font-size: 13px; color: var(--verde); font-weight: 600; }

.rodape { background: var(--branco); border-top: 1px solid var(--lilas-2); padding: 10px 12px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.opcoes { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.opcoes:not(:empty) + .escrever:not([hidden]) { margin-top: 10px; }
.opcoes.grade { max-height: 38dvh; overflow-y: auto; justify-content: flex-start; }
.chip {
  font: inherit; font-size: 14.5px; font-weight: 600; padding: 10px 16px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--violeta); background: var(--branco); color: var(--violeta); min-height: 44px;
}
.chip.forte { background: var(--violeta); color: var(--branco); }
.chip:hover { background: var(--lilas); } .chip.forte:hover { background: var(--violeta-escuro); }
.chip:disabled { opacity: .5; cursor: default; }
/* "← Voltar" (03/12): discreto e à esquerda, longe do botão principal */
.chip.voltar { border-color: var(--lilas-2); color: var(--texto); background: var(--branco); margin-right: auto; font-weight: 500; }
.chip.voltar:hover { background: var(--fundo); }
.escrever { display: flex; gap: 8px; align-items: center; }
.entrada {
  flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 12px 16px; border-radius: 999px;
  border: 1.5px solid var(--lilas-2); background: var(--fundo); color: var(--texto); outline: none;
}
.entrada:focus { border-color: var(--violeta); background: var(--branco); }
.enviar { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--violeta); color: var(--branco); cursor: pointer; display: grid; place-items: center; }
.enviar:disabled { background: var(--lilas-2); cursor: default; }
.isca { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.semjs { color: var(--branco); text-align: center; padding: 40px 16px; }

@keyframes entra { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pula { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-5px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
/* cartão do contrato (01/12): mesmo formato do cartão do grupo, na cor da Zoe */
.grupo.contrato .grupo-icone { background: #680CC7; }
.grupo.contrato .grupo-acao { color: #680CC7; }
.grupo.contrato { background: var(--lilas); border-color: var(--lilas-2); }
.grupo.contrato .grupo-icone { background: var(--violeta); }
.grupo.contrato .grupo-acao { color: var(--violeta); }
