/* Conversa com a escola, o lado da família (js/conversa.js). Desenho: estudo v3, fileira
   "Proposta (10/10/2026): conversa com a escola". Cores e cantos do tokens.css. */

/* ---------- o balão na barra de baixo ----------
   Desde 21/10/2026 (pedido dela) o balão mora na barra de baixo, entre a agenda e o perfil:
   o topo ficou com "Avisar falta", atualizar e o sino. Cada botão do topo segue com 44 x 44 px
   para o dedo; só ocupa 36 px na linha (encosta 4 px em cada vizinho). */
.topo { gap: 2px; }
.topo__logo { margin-right: 4px; }
.topo .icone-botao { width: 44px; margin: 0 -4px; }
.topo .icone-botao:last-child { margin-right: -2px; }
.topo .botao--pilula { padding: 0 10px; margin-right: 2px; }
.barra__conversa { position: relative; }
.barra__conversa[hidden] { display: none; }
.conversa-num {
  position: absolute; top: 2px; right: 10px; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box;
  border-radius: var(--radius-pill); background: var(--pink); border: 2px solid var(--surface);
  color: var(--on-pink); font-size: 11px; font-weight: 700; line-height: 14px; text-align: center;
}
.conversa-num[hidden] { display: none; }

/* ---------- escolher a criança ---------- */
.conversa-lista { display: flex; flex-direction: column; gap: 8px; }
.conversa-lista__item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: none; border-radius: var(--radius-lg);
  background: var(--surface-sunk); color: var(--ink); text-align: left; font: inherit;
}
.conversa-lista__bicho { width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0; background: var(--surface); }
.conversa-lista__texto { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.conversa-lista__linha { display: flex; justify-content: space-between; gap: 8px; }
.conversa-lista__linha b { font-family: var(--font-display); font-weight: 800; font-size: 17px; }
.conversa-lista__linha small { font-size: 12px; color: var(--ink-soft); }
.conversa-lista__turma { font-size: 13px; color: var(--ink-soft); }
.conversa-lista__previa { font-size: 14px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversa-lista__previa--nova { color: var(--ink); font-weight: 700; }
.conversa-lista__num {
  min-width: 22px; height: 22px; padding: 0 6px; box-sizing: border-box; border-radius: var(--radius-pill);
  background: var(--pink); color: var(--on-pink); font-size: 12px; font-weight: 700; line-height: 22px; text-align: center;
}
.conversa-lista__pe { margin: 14px 4px 0; font-size: 13px; color: var(--ink-soft); line-height: 1.45; }
.conversa-selo {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin-top: 3px; padding: 4px 10px;
  border-radius: var(--radius-pill); background: var(--surface-soft); color: var(--ink-soft); font-size: 12.5px; font-weight: 700;
}
.conversa-selo--espera { background: var(--sun-soft); color: var(--sun-ink); }

/* ---------- a tela ---------- */
.conversa {
  position: fixed; top: 0; left: 0; right: 0; height: calc(100vh / var(--zoom)); height: calc(100dvh / var(--zoom)); z-index: 40; max-width: 480px; margin: 0 auto;
  display: flex; flex-direction: column; background: var(--surface); animation: aparece .25s ease;
}
.conversa__topo {
  flex-shrink: 0; display: flex; align-items: center; gap: 10px;
  min-height: calc(66px + env(safe-area-inset-top, 0px)); padding: calc(8px + env(safe-area-inset-top, 0px)) 14px 8px 4px; box-sizing: border-box;
  border-bottom: 1px solid var(--line); background: var(--surface);
}
.conversa__logo { width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; background: var(--sun-soft); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.conversa__logo img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.conversa__quem { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.conversa__quem b { font-family: var(--font-display); font-weight: 800; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversa__quem small { font-size: 12.5px; line-height: 1.3; color: var(--ink-soft); }
.conversa__fora { color: var(--lilac-ink); font-weight: 700; }
.conversa__corpo { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.conversa__fio { display: flex; flex-direction: column; gap: 10px; padding: 14px 14px 12px; }
.conversa__fio .esqueleto__linha { height: 44px; border-radius: 22px; }
.conversa__erro { margin: 16px; }
.conversa__privado {
  align-self: center; max-width: 300px; margin: 0 0 4px; color: var(--ink-mute); font-size: 12px; line-height: 1.4;
  display: flex; gap: 5px; align-items: baseline; justify-content: center; text-align: center; text-wrap: balance;
}
.conversa__privado svg { flex-shrink: 0; position: relative; top: 1px; }
.conversa__dia { align-self: center; margin: 4px 0 0; font-size: 12px; color: var(--ink-mute); }
.conversa__dia::first-letter { text-transform: uppercase; }
.conversa__vazio { align-self: center; max-width: 280px; margin: 24px 0; text-align: center; font-size: 14px; color: var(--ink-soft); line-height: 1.45; }

/* ---------- as mensagens ---------- */
.conversa-msg { display: flex; flex-direction: column; }
.conversa-msg--eu { align-items: flex-end; }
.conversa-msg--escola { align-items: flex-start; }
.conversa-msg--chega { animation: chega .4s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes chega { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
.conversa-msg__autor { font-size: 12px; color: var(--ink-soft); margin: 0 0 3px 12px; }
.conversa-msg__balao {
  max-width: 80%; padding: 10px 14px; box-sizing: border-box; font-size: 15.5px; line-height: 1.42;
  white-space: pre-line; overflow-wrap: anywhere;
}
.conversa-msg--eu .conversa-msg__balao { background: #FFE1EC; border-radius: 22px 22px 6px 22px; }
.conversa-msg--escola .conversa-msg__balao { background: var(--surface-soft); border-radius: 22px 22px 22px 6px; }
.conversa-msg__rodape { font-size: 11.5px; color: var(--ink-mute); margin: 3px 6px 0; }
.conversa-msg__falhou {
  margin-top: 4px; padding: 6px 10px; border: none; border-radius: var(--radius-sm); background: var(--sun-soft); color: var(--sun-ink);
  font: inherit; font-size: 12.5px; font-weight: 700;
}

/* o recado pronto vira um cartão colorido */
.conversa-cartao {
  width: 78%; box-sizing: border-box; padding: 14px 16px; border-radius: 22px 22px 6px 22px;
  display: flex; flex-direction: column; gap: 3px; line-height: 1.4;
}
.conversa-cartao--ceu { background: var(--sky-soft); color: #1F4E8C; }
.conversa-cartao--menta { background: var(--mint-soft); color: var(--mint-ink); }
.conversa-cartao--sol { background: var(--sun-soft); color: #7A4E00; }
.conversa-cartao__rotulo { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; }
.conversa-cartao__principal { font-family: var(--font-display); font-weight: 800; font-size: 21px; line-height: 1.15; overflow-wrap: anywhere; }
.conversa-cartao__detalhe { font-size: 14px; white-space: pre-line; overflow-wrap: anywhere; }
.conversa-cartao__fotos { display: flex; gap: 6px; margin-top: 8px; }
.conversa-cartao__foto { flex: 1; height: 92px; border: none; padding: 0; border-radius: 14px; overflow: hidden; background: rgba(255, 255, 255, .75); }
.conversa-cartao__foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.conversa-cartao__situacao {
  margin-top: 8px; padding-top: 9px; border-top: 1.5px solid rgba(43, 34, 51, .1);
  font-size: 12.5px; display: flex; align-items: center; gap: 6px;
}

/* a foto aberta, em tela cheia */
.conversa-foto { position: fixed; inset: 0; z-index: 70; background: rgba(20, 16, 24, .92); display: flex; align-items: center; justify-content: center; animation: aparece .2s ease; }
.conversa-foto img { max-width: 100%; max-height: 100%; object-fit: contain; }
.conversa-foto__fechar { position: absolute; top: calc(10px + env(safe-area-inset-top, 0px)); right: 10px; color: #FFFFFF; }

/* ---------- escrever ---------- */
.conversa__baixo { flex-shrink: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 8px 0 calc(14px + env(safe-area-inset-bottom, 0px)); }
.conversa__baixo[hidden] { display: none; }
.conversa__escrever { display: flex; align-items: flex-end; gap: 8px; padding: 0 12px; margin: 0; }
.conversa__escrever textarea {
  flex: 1; min-height: 46px; max-height: 120px; box-sizing: border-box; border: none; border-radius: 23px;
  background: var(--surface-soft); color: var(--ink); padding: 12px 16px; font: inherit; font-size: 16px; font-weight: 600; line-height: 1.35; resize: none;
}
.conversa__enviar {
  width: 46px; height: 46px; flex-shrink: 0; border: none; border-radius: 50%; padding: 0;
  background: #C2306A; color: #FFFFFF; display: flex; align-items: center; justify-content: center;
}
.conversa__enviar:disabled { background: #D9CFE0; }

/* ---------- as folhas dos recados prontos ---------- */
/* o tokens.css tem um estilo de texto chamado .folha (título, 28px): sem isto, o texto da folha sai com a letra de título */
.folha.folha--conversa { font-family: var(--font-body); font-size: 15px; line-height: 1.4; font-weight: 600; }
.folha--conversa .folha__sub { line-height: 1.4; }
/* ---------- esperando a escola / não liberada ---------- */
.conversa-estado { min-height: 100%; box-sizing: border-box; padding: 48px 28px calc(28px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; align-items: center; text-align: center; }
.conversa-estado__icone { width: 150px; height: 150px; border-radius: 50%; background: var(--surface-soft); color: var(--ink-soft); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.conversa-estado__icone--espera { background: var(--sun-soft); color: #7A4E00; animation: balanca 3.2s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes balanca { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.conversa-estado h2 { margin: 26px 0 0; font-family: var(--font-display); font-weight: 800; font-size: 26px; line-height: 1.15; text-wrap: balance; }
.conversa-estado p { margin: 12px 0 0; font-size: 15.5px; line-height: 1.5; color: #4A4053; }
.conversa-estado__lista {
  list-style: none; margin: 22px 0 0; padding: 14px 16px; width: 100%; box-sizing: border-box; border-radius: 20px;
  background: var(--surface-sunk); text-align: left; display: flex; flex-direction: column; gap: 10px; font-size: 14.5px; line-height: 1.4;
}
.conversa-estado__lista li { display: flex; gap: 10px; align-items: center; }
.conversa-estado__lista svg { flex-shrink: 0; color: var(--ink-soft); }
.conversa-estado__lista .conversa-estado__ok { color: var(--mint-ink); }
.conversa-estado .conversa-estado__pe { margin-top: auto; padding-top: 24px; font-size: 13px; color: var(--ink-soft); line-height: 1.45; }
.conversa-estado .botao { margin-top: 14px; }

@media (prefers-reduced-motion: reduce) {
  .conversa, .conversa-msg--chega, .conversa-estado__icone--espera, .conversa-foto { animation: none; }
}

/* o lembrete fixo acima da caixa de escrever: saúde não vai pela Redinha (16/10/2026) */
.conversa__aviso { margin: 0; padding: 0 16px 8px; font-size: 12px; line-height: 1.35; color: var(--ink-mute); text-align: center; text-wrap: balance; }
