/* MarIA - assistente de acolhimento. Widget flutuante + janela de conversa. */
:root {
  --maria-roxo: #6f5fa0;
  --maria-roxo-claro: #8b7bb8;
  --maria-roxo-bolha: #efe9f7;
  --maria-dourado: #c5a15a;
  --maria-vermelho: #b81f24;
  --maria-escuro: #2d2d3a;
}

/* Botão flutuante (FAB) estilo CUIDAR: busto + badge */
.maria-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 9998;
  width: 64px; height: 64px; padding: 0; border: none; cursor: pointer;
  border-radius: 50%; background: #fff;
  box-shadow: 0 6px 22px rgba(0,0,0,.28);
  transition: transform .15s;
}
.maria-fab img { width: 60px; height: 60px; border-radius: 50%; display: block; margin: 2px; }
.maria-fab:hover { transform: translateY(-3px) scale(1.04); }
.maria-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 22px; height: 22px; line-height: 22px; padding: 0 5px;
  background: var(--maria-vermelho); color: #fff; font-size: .78rem; font-weight: 800;
  border-radius: 12px; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25);
}

/* Apresentação: MarIA de corpo inteiro "em pe" + balao de fala */
.maria-apresenta {
  position: fixed; right: 10px; bottom: 0; z-index: 9998;
  display: flex; align-items: flex-end; gap: 0;
  pointer-events: none;
  opacity: 0; transform: translateY(24px);
  transition: opacity .4s ease, transform .4s ease;
}
.maria-apresenta.mostra { opacity: 1; transform: none; }
.maria-corpo-img {
  width: 150px; height: auto; display: block; pointer-events: auto; cursor: pointer;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.25));
  animation: mariaFlutua 3.5s ease-in-out infinite;
}
@keyframes mariaFlutua { 0%,100%{ transform: translateY(0) } 50%{ transform: translateY(-6px) } }
.maria-balao {
  position: relative; pointer-events: auto;
  max-width: 230px; margin-bottom: 70px;
  background: #fff; border-radius: 16px; padding: 14px 16px;
  box-shadow: 0 8px 26px rgba(0,0,0,.22); font-size: .9rem; color: #333; line-height: 1.4;
  border: 2px solid var(--maria-roxo);
}
.maria-balao::after {
  content: ""; position: absolute; right: -11px; bottom: 26px;
  border: 10px solid transparent; border-left-color: #fff;
}
.maria-balao::before {
  content: ""; position: absolute; right: -14px; bottom: 25px;
  border: 11px solid transparent; border-left-color: var(--maria-roxo);
}
.maria-balao p { margin: 0 0 10px; }
.maria-balao strong { color: var(--maria-roxo); }
.maria-balao .maria-fechar-s {
  position: absolute; top: 6px; right: 10px; cursor: pointer;
  color: #aaa; font-size: 1.1rem; background: none; border: none;
}
.maria-balao-acoes { display: flex; gap: 8px; }
.maria-balao-acoes button {
  flex: 1; border: none; cursor: pointer; font-family: inherit; font-size: .82rem; font-weight: 700;
  border-radius: 9px; padding: 9px 10px;
}
.maria-balao-acoes .mb-sim { background: var(--maria-roxo); color: #fff; }
.maria-balao-acoes .mb-sim:hover { background: var(--maria-roxo-claro); }
.maria-balao-acoes .mb-nao { background: #eee; color: #555; }

/* Janela de conversa */
.maria-janela {
  position: fixed; right: 18px; bottom: 18px; z-index: 9999;
  width: 370px; max-width: calc(100vw - 24px);
  height: 560px; max-height: calc(100vh - 36px);
  background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.3);
  display: none; flex-direction: column;
}
.maria-janela.aberta { display: flex; animation: mariaEntra .3s ease both; }

.maria-cabecalho {
  background: linear-gradient(135deg, var(--maria-roxo-claro), var(--maria-roxo));
  color: #fff; padding: 14px 16px; display: flex; align-items: center; gap: 12px;
}
.maria-cabecalho img { width: 44px; height: 44px; border-radius: 50%; border: 2px solid rgba(255,255,255,.6); }
.maria-cabecalho .maria-nome { flex: 1; }
.maria-cabecalho .maria-nome strong { display: block; font-size: 1rem; }
.maria-cabecalho .maria-nome span { font-size: .74rem; opacity: .9; }
.maria-cabecalho .maria-fechar { background: none; border: none; color: #fff; font-size: 1.4rem; cursor: pointer; line-height: 1; }

.maria-corpo {
  flex: 1; overflow-y: auto; padding: 16px; background: #f7f5fb;
  display: flex; flex-direction: column; gap: 10px;
}

.maria-bolha {
  max-width: 85%; padding: 10px 14px; border-radius: 14px;
  font-size: .9rem; line-height: 1.45; animation: mariaEntra .25s ease both;
}
.maria-bolha.dela {
  align-self: flex-start; background: #fff; color: #333;
  border-bottom-left-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.maria-bolha.minha {
  align-self: flex-end; background: var(--maria-roxo); color: #fff;
  border-bottom-right-radius: 4px;
}
.maria-bolha.alerta { background: #fff4f4; border: 1px solid #f3c6c6; color: #7a1c1f; }
.maria-bolha strong { font-weight: 700; }
.maria-bolha a { color: var(--maria-roxo); font-weight: 600; }
.maria-bolha.minha a { color: #fff; text-decoration: underline; }

.maria-opcoes { display: flex; flex-direction: column; gap: 8px; padding: 4px 16px 14px; background: #f7f5fb; }
.maria-opcao {
  text-align: left; background: #fff; border: 1.5px solid var(--maria-roxo-claro);
  color: var(--maria-roxo); border-radius: 10px; padding: 11px 14px;
  font-size: .88rem; font-family: inherit; cursor: pointer; transition: all .15s;
}
.maria-opcao:hover { background: var(--maria-roxo); color: #fff; }
.maria-opcao.destaque { background: var(--maria-vermelho); color: #fff; border-color: var(--maria-vermelho); font-weight: 700; }
.maria-opcao.destaque:hover { background: #8f1418; }
.maria-opcao.voltar { border-color: #ccc; color: #666; }
.maria-opcao.voltar:hover { background: #666; color: #fff; }

.maria-digitando { align-self: flex-start; display: flex; gap: 4px; padding: 12px 16px; }
.maria-digitando span { width: 8px; height: 8px; border-radius: 50%; background: #bbb; animation: mariaPulo 1.2s infinite; }
.maria-digitando span:nth-child(2) { animation-delay: .2s; }
.maria-digitando span:nth-child(3) { animation-delay: .4s; }
@keyframes mariaPulo { 0%,60%,100% { transform: translateY(0); opacity:.5 } 30% { transform: translateY(-6px); opacity:1 } }

@media (max-width: 480px) {
  .maria-janela { right: 0; bottom: 0; width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
  .maria-corpo-img { width: 120px; } .maria-balao { max-width: 190px; }
}

/* Ícone de ajuda (?) ao lado dos campos do formulário */
.maria-ajuda-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; margin-left: 6px; vertical-align: middle;
  border-radius: 50%; border: none; cursor: pointer;
  background: var(--maria-roxo); color: #fff; font-size: .62rem;
  padding: 0; line-height: 1; box-shadow: 0 1px 3px rgba(111,95,160,.4);
  transition: transform .12s, background .12s;
}
.maria-ajuda-ic:hover { transform: scale(1.18); background: var(--maria-roxo-claro); }
.maria-ajuda-ic:active { transform: scale(.95); }
