/* Janela de conversa do diagnóstico com IA (mesma do site anterior). */
/* Janela */
.chat { position: relative; }
.chat__glow {
  position: absolute;
  inset: -14% -10% -10% -8%;
  z-index: 0;
  background: radial-gradient(42% 38% at 78% 12%, color-mix(in srgb, var(--sun) 22%, transparent), transparent 70%),
              radial-gradient(36% 34% at 12% 92%, color-mix(in srgb, var(--paper) 8%, transparent), transparent 70%);
  filter: blur(18px);
  pointer-events: none;
}
.chat__window {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: clamp(540px, 74vh, 660px);
  overflow: hidden;
  border-radius: 28px;
  background: color-mix(in srgb, var(--paper) 5%, var(--ink));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--paper) 13%, transparent), 0 40px 80px -40px rgb(0 0 0 / 0.9);
}

.chat__head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid color-mix(in srgb, var(--paper) 10%, transparent); }
.chat__avatar { flex: none; line-height: 0; }
.chat__avatar img { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--paper) 22%, transparent); }
.chat__who { display: grid; gap: 2px; min-width: 0; }
.chat__name { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.chat__status { display: flex; align-items: center; gap: 7px; font-size: 13px; color: color-mix(in srgb, var(--paper) 65%, var(--ink)); }
.chat__live { width: 7px; height: 7px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 10px var(--sun); }
.has-motion .chat__live { animation: chat-live 2.2s ease-in-out infinite; }
@keyframes chat-live { 50% { opacity: 0.35; } }
.chat__reset { margin-left: auto; min-height: 34px; padding: 0 14px; border-radius: 999px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--paper) 25%, transparent); color: var(--paper); font-size: 13px; font-weight: 600; }
.chat__reset:hover { background: color-mix(in srgb, var(--paper) 10%, transparent); }
.chat__reset[hidden] { display: none; }

/* Conversa */
.chat__log {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 22px 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--paper) 20%, transparent) transparent;
}
.msg { display: flex; }
.msg--user { justify-content: flex-end; }
.has-motion .msg { animation: msg-in 0.45s var(--ease) both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(10px); } }
.msg__bubble { display: grid; gap: 10px; max-width: min(88%, 520px); padding: 14px 16px; font-size: 16px; line-height: 1.55; overflow-wrap: anywhere; }
.msg--ai .msg__bubble { border-radius: 20px 20px 20px 6px; background: color-mix(in srgb, var(--paper) 10%, var(--ink)); color: color-mix(in srgb, var(--paper) 90%, var(--ink)); }
.msg--user .msg__bubble { display: block; border-radius: 20px 20px 6px 20px; background: var(--paper); color: var(--ink); font-weight: 500; white-space: pre-wrap; }
.msg__bubble strong { color: var(--paper); font-weight: 700; }
.msg__bubble ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.msg__bubble li { position: relative; padding-left: 18px; }
.msg__bubble li::before { content: ""; position: absolute; left: 2px; top: 0.62em; width: 6px; height: 6px; border-radius: 50%; background: var(--sun); }
.msg__bubble--error { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sun) 70%, transparent); }
.msg__typing { display: inline-flex; gap: 5px; padding: 6px 2px; }
.msg__typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--sun); }
.has-motion .msg__typing i { animation: typing 1.1s ease-in-out infinite; }
.has-motion .msg__typing i:nth-child(2) { animation-delay: 0.15s; }
.has-motion .msg__typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 60%, 100% { transform: none; opacity: 0.45; } 30% { transform: translateY(-5px); opacity: 1; } }

.msg--cta { display: block; }
.chat__cta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--sun) 9%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sun) 55%, transparent);
  color: var(--paper);
  font-size: 15px;
  line-height: 1.4;
  text-decoration: none;
  transition: background 0.3s var(--ease);
}
.chat__cta:hover { background: color-mix(in srgb, var(--sun) 16%, transparent); }
.chat__cta strong { font-weight: 700; }
.chat__cta > span:last-child { margin-left: auto; font-size: 18px; color: var(--sun); }
.chat__cta-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--sun); }

/* Caixa de mensagem */
.chat__composer { display: grid; gap: 10px; padding: 14px 16px 16px; border-top: 1px solid color-mix(in srgb, var(--paper) 10%, transparent); }
.chat__starts { display: flex; flex-wrap: wrap; gap: 8px; }
.chat__starts[hidden] { display: none; }
.chat__start {
  min-height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--paper) 24%, transparent);
  color: color-mix(in srgb, var(--paper) 88%, var(--ink));
  font-size: 13px;
  font-weight: 600;
  transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.chat__start:hover { background: color-mix(in srgb, var(--paper) 10%, transparent); box-shadow: inset 0 0 0 1px var(--paper); }
.chat__box {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 6px 6px 6px 18px;
  border-radius: 22px;
  background: color-mix(in srgb, var(--paper) 9%, var(--ink));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--paper) 18%, transparent);
  transition: box-shadow 0.25s var(--ease);
}
.chat__box:focus-within { box-shadow: inset 0 0 0 2px var(--sun); }
.chat__box textarea {
  flex: 1;
  min-width: 0;
  max-height: 160px;
  padding: 11px 0;
  border: 0;
  background: transparent;
  color: var(--paper);
  font: inherit;
  font-size: 16px;
  line-height: 1.45;
  resize: none;
  outline: none;
}
.chat__box textarea::placeholder { color: color-mix(in srgb, var(--paper) 45%, var(--ink)); }
.chat__box textarea:disabled { cursor: not-allowed; }
.chat__send {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--sun);
  color: var(--on-sun);
  transition: transform 0.2s var(--ease), opacity 0.2s;
}
.chat__send:hover { transform: scale(1.06); }
.chat__send:disabled { opacity: 0.4; cursor: default; transform: none; }
.chat__send:focus-visible { outline: 2px solid var(--paper); outline-offset: 3px; }
.chat__error { font-size: 13px; font-weight: 600; color: var(--sun); }
.chat__error:empty { display: none; }
.chat__hint { font-size: 12px; color: color-mix(in srgb, var(--paper) 55%, var(--ink)); }

@media (max-width: 899px) {
  .chat__window { height: clamp(500px, 78svh, 620px); border-radius: 24px; }
}
@media (max-width: 480px) {
  .chat__log { padding: 18px 12px; }
  .chat__composer { padding: 12px; }
  .msg__bubble { max-width: 92%; font-size: 15px; }
}
