/* GI: assistente de IA do site. Usa as cores e fontes do site.css. */

:root { --gi-base: 1rem; }

.gi-fab {
  position: fixed; right: 1rem; bottom: var(--gi-base); z-index: 95;
  width: 3.5rem; height: 3.5rem; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--font-display); font-weight: 700; font-size: 1rem; letter-spacing: 0.02em;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.55);
}
.gi-fab:hover { background: var(--accent-hover); }
.gi-fab:focus-visible { outline: 3px solid var(--accent-muted); outline-offset: 3px; }

.gi-painel {
  position: fixed; right: 1rem; z-index: 95;
  bottom: calc(var(--gi-base) + 4.25rem);
  width: min(24rem, calc(100vw - 2rem));
  max-height: min(38rem, calc(100vh - var(--gi-base) - 6rem));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel); color: var(--text-primary);
  border: 1px solid var(--line-strong); border-radius: 0.875rem;
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.65);
}
.gi-painel[hidden] { display: none; }

.gi-cabeca { display: flex; align-items: center; gap: 0.75rem; padding: 0.875rem 1rem; border-bottom: 1px solid var(--line); }
.gi-avatar {
  flex: 0 0 auto; width: 2.25rem; height: 2.25rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--font-display); font-weight: 700; font-size: 0.8125rem;
}
.gi-cab-texto { min-width: 0; }
.gi-titulo { margin: 0; font-size: 1rem; font-family: var(--font-display); }
.gi-papel { display: block; font-size: 0.8125rem; color: var(--text-muted); }
.gi-fechar {
  margin-left: auto; cursor: pointer; padding: 0.3rem 0.6rem; border-radius: 0.5rem;
  background: transparent; color: var(--text-primary); border: 1px solid var(--line-strong);
}
.gi-fechar:focus-visible, .gi-rapidas button:focus-visible, .gi-enviar:focus-visible, .gi-campo:focus-visible {
  outline: 3px solid var(--accent-muted); outline-offset: 2px;
}

.gi-aviso { margin: 0; padding: 0.625rem 1rem; font-size: 0.75rem; line-height: 1.45; color: var(--text-muted); border-bottom: 1px solid var(--line); }

.gi-log {
  flex: 1 1 auto; min-height: 10rem; overflow-y: auto;
  display: flex; flex-direction: column; gap: 0.625rem; padding: 1rem;
}
.gi-msg { max-width: 88%; padding: 0.625rem 0.8rem; border-radius: 0.75rem; font-size: 0.9375rem; line-height: 1.5; white-space: pre-wrap; }
.gi-bot { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); }
.gi-usuario { align-self: flex-end; background: var(--accent); color: var(--accent-ink); }
.gi-link {
  display: inline-block; margin-top: 0.5rem; font-weight: 600; color: var(--accent-muted);
  text-decoration: underline; text-underline-offset: 3px;
}
.gi-digitando { font-style: italic; color: var(--text-muted); }

.gi-rapidas { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0 1rem 0.75rem; }
.gi-rapidas button {
  font: inherit; font-size: 0.8125rem; cursor: pointer;
  padding: 0.35rem 0.65rem; border-radius: 999px;
  background: transparent; color: var(--text-primary); border: 1px solid var(--line-strong);
}
.gi-rapidas button:hover { border-color: var(--accent); }

.gi-form { display: flex; gap: 0.5rem; padding: 0.75rem 1rem; border-top: 1px solid var(--line); }
.gi-campo {
  flex: 1 1 auto; min-width: 0; font: inherit; padding: 0.6rem 0.7rem;
  border-radius: 0.5rem; border: 1px solid var(--line-strong);
  background: var(--canvas); color: var(--text-primary);
}
.gi-enviar {
  flex: 0 0 auto; font: inherit; font-weight: 600; cursor: pointer;
  padding: 0.6rem 0.9rem; border-radius: 0.5rem; border: 0;
  background: var(--accent); color: var(--accent-ink);
}
.gi-enviar:hover { background: var(--accent-hover); }
.gi-enviar:disabled { opacity: 0.6; cursor: progress; }

@media (max-width: 720px) {
  .gi-painel { right: 0.5rem; left: 0.5rem; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .gi-fab, .gi-enviar { transition: none; }
}

/* Imagem da GI: ocupa o botão e o avatar, sem o fundo de texto */
.gi-fab { padding: 0; overflow: hidden; }
.gi-fab img, .gi-avatar img { display: block; width: 100%; height: 100%; border-radius: 50%; }
.gi-avatar { background: transparent; }

/* Opções de escolha dentro da conversa (abertura e guia) */
.gi-opcoes { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.gi-opcoes button {
  font: inherit; font-size: 0.8125rem; cursor: pointer;
  padding: 0.35rem 0.65rem; border-radius: 999px;
  background: transparent; color: var(--text-primary); border: 1px solid var(--line-strong);
}
.gi-opcoes button:hover { border-color: var(--accent); }
.gi-opcoes button:focus-visible { outline: 3px solid var(--accent-muted); outline-offset: 2px; }
