/* =========================================================
   INFINITUM 3D · ASSISTENTE IA (tema escuro do site)
========================================================= */
.ia-design {
  margin-bottom: 28px;
  padding: 24px;
  border-radius: 22px;
  border: 1px solid rgba(32, 220, 255, 0.28);
  background: linear-gradient(135deg, rgba(22, 143, 255, 0.10), rgba(120, 83, 255, 0.14));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
}
.ia-design h3 { margin: 0 0 6px; color: #fff; font-size: 20px; font-weight: 900; }
.ia-intro { margin: 0 0 16px; color: #b9c6dd; font-size: 14px; line-height: 1.5; }
.ia-start, .ia-use {
  min-height: 48px; padding: 0 22px; border: none; border-radius: 999px; cursor: pointer;
  color: #fff; font-weight: 800; font-size: 14.5px; font-family: inherit;
  background: linear-gradient(100deg, #168fff, #16d5ff 48%, #7853ff 100%);
  box-shadow: 0 8px 22px rgba(22, 148, 255, 0.25);
}
.ia-start:hover, .ia-use:hover { transform: translateY(-2px); }

.ia-chat { display: flex; flex-direction: column; gap: 10px; }
.ia-log {
  display: flex; flex-direction: column; gap: 10px;
  max-height: 380px; overflow-y: auto; padding: 4px 2px;
}
.ia-msg {
  max-width: 85%; padding: 11px 15px; border-radius: 16px;
  font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word;
}
.ia-bot { align-self: flex-start; background: rgba(11, 25, 48, 0.9); color: #e9f1ff; border: 1px solid rgba(117, 166, 255, 0.22); border-bottom-left-radius: 4px; }
.ia-user { align-self: flex-end; background: #1677ff; color: #fff; border-bottom-right-radius: 4px; }
.ia-wait { opacity: 0.7; font-style: italic; }
.ia-photo { padding: 4px; background: transparent; }
.ia-photo img { display: block; max-width: 160px; max-height: 160px; border-radius: 12px; }

.ia-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ia-chip {
  padding: 8px 14px; border-radius: 999px; cursor: pointer; font-family: inherit; font-weight: 700; font-size: 13px; line-height: 1.2;
  color: #bfe9ff; background: rgba(32, 220, 255, 0.08); border: 1px solid rgba(32, 220, 255, 0.35);
  text-decoration: none;
}
.ia-chip:hover { background: rgba(32, 220, 255, 0.18); color: #fff; }
.ia-chip-human { color: #d8c2ff; border-color: rgba(138, 92, 255, 0.45); background: rgba(138, 92, 255, 0.10); }

.ia-input { display: flex; gap: 8px; align-items: center; }
.ia-input input {
  flex: 1; min-height: 48px; padding: 0 16px; border-radius: 14px; font: inherit; font-size: 14.5px;
  color: #fff; background: rgba(11, 25, 48, 0.8); border: 1px solid rgba(117, 166, 255, 0.3);
}
.ia-input input:focus { outline: none; border-color: #20dcff; box-shadow: 0 0 0 1px #20dcff; }
.ia-send, .ia-attach {
  width: 48px; height: 48px; flex-shrink: 0; border-radius: 14px; cursor: pointer; font-size: 18px;
  color: #fff; border: 1px solid rgba(117, 166, 255, 0.3); background: rgba(11, 25, 48, 0.8);
}
.ia-send { background: linear-gradient(135deg, #168fff, #7853ff); border: none; }

.ia-note, .ia-demo { margin: 0; font-size: 11.5px; color: #8a9bb8; line-height: 1.4; }
.ia-demo { color: #ffd479; font-weight: 700; }

.ia-ficha {
  align-self: stretch; padding: 16px 18px; border-radius: 16px;
  background: rgba(8, 17, 34, 0.95); border: 1px solid rgba(32, 220, 255, 0.4);
}
.ia-ficha strong { display: block; color: #4abfff; margin-bottom: 8px; font-size: 15px; }
.ia-ficha dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 14px; font-size: 13.5px; }
.ia-ficha dt { color: #8a9bb8; font-weight: 700; }
.ia-ficha dd { margin: 0; color: #fff; }

.ia-window {
  position: fixed; right: 20px; bottom: 90px; z-index: 2500;
  width: min(370px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 120px));
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 20px; background: #071327; border: 1px solid rgba(117, 166, 255, 0.3);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
.ia-window[hidden] { display: none; }
.ia-window-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; color: #fff; background: linear-gradient(100deg, rgba(22, 143, 255, 0.35), rgba(120, 83, 255, 0.35));
}
.ia-close { background: none; border: none; color: #fff; font-size: 18px; cursor: pointer; }
.ia-window .ia-chat { padding: 14px; overflow: hidden; }
.ia-window .ia-log { max-height: 320px; }

@media (max-width: 640px) {
  .ia-design { padding: 18px; }
  .ia-msg { max-width: 92%; }
}

/* Página inicial: secção de atendimento */
.ia-home { padding: 70px 0; }
.ia-home-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 40px; align-items: start; }
.ia-home-text .section-tag { display: inline-block; margin-bottom: 12px; color: #4abfff; font-size: 11.5px; letter-spacing: 2px; font-weight: 900; }
.ia-home-text h2 { margin: 0 0 12px; color: #fff; font-size: clamp(30px, 3.4vw, 44px); letter-spacing: -0.5px; }
.ia-home-text p { margin: 0; color: #b9c6dd; font-size: 16px; line-height: 1.6; max-width: 420px; }
.ia-home-box {
  padding: 22px; border-radius: 24px;
  border: 1px solid rgba(32, 220, 255, 0.28);
  background: linear-gradient(135deg, rgba(22, 143, 255, 0.10), rgba(120, 83, 255, 0.14));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
}
.ia-home-box .ia-log { max-height: 340px; min-height: 120px; }
@media (max-width: 900px) {
  .ia-home { padding: 50px 0; }
  .ia-home-grid { grid-template-columns: 1fr; gap: 22px; }
  .ia-home-box { padding: 16px; }
}

/* Ficha: botões */
.ia-ficha-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* =========================================================
   Botão flutuante fixo (todas as páginas)
========================================================= */
.ia-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 2600;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: none; cursor: pointer; color: #fff; font-family: inherit;
  background: linear-gradient(135deg, #168fff, #16d5ff 55%, #7853ff);
  box-shadow: 0 12px 30px rgba(22, 120, 255, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ia-fab:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 16px 36px rgba(22, 120, 255, 0.55); }
.ia-fab:focus-visible { outline: 3px solid #20dcff; outline-offset: 3px; }
.ia-fab-dot {
  position: absolute; top: 6px; right: 6px; width: 12px; height: 12px; border-radius: 50%;
  background: #2ee66b; box-shadow: 0 0 0 2px #071327;
}
.ia-fab.is-open .ia-fab-dot { display: none; }

/* Estilo A: bolha */
.ia-fab-bolha { width: 64px; height: 64px; border-radius: 50%; }
.ia-fab-bolha::before {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid rgba(32, 220, 255, 0.55); animation: ia-pulse 2.4s ease-out infinite;
}
.ia-fab-bolha.is-open::before { display: none; }
@keyframes ia-pulse { 0% { transform: scale(0.9); opacity: 0.9; } 100% { transform: scale(1.35); opacity: 0; } }

.ia-teaser {
  position: fixed; right: 98px; bottom: 32px; z-index: 2600;
  display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 4px;
  border-radius: 16px 16px 4px 16px; background: #ffffff; color: #0b1930;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35); animation: ia-in 0.35s ease-out;
}
.ia-teaser[hidden] { display: none; }
.ia-teaser-text { border: none; background: none; cursor: pointer; padding: 8px 6px 8px 12px; font: inherit; font-weight: 800; font-size: 14px; color: #0b1930; }
.ia-teaser-close { border: none; background: #eef2f8; color: #5b6580; width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-size: 11px; }
@keyframes ia-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Estilo B: pastilha com texto */
.ia-fab-pastilha { height: 58px; padding: 0 24px 0 18px; border-radius: 999px; font-weight: 800; font-size: 15px; }
.ia-fab-pastilha .ia-fab-dot { top: 4px; right: 10px; }
.ia-fab-pastilha.is-open { width: 58px; padding: 0; }
.ia-fab-short { display: none; }

.ia-window { bottom: 100px !important; right: 22px !important; z-index: 2600 !important; }
.ia-window-title { display: flex; flex-direction: column; gap: 2px; }
.ia-window-title small { color: #7dffa9; font-size: 11.5px; font-weight: 700; }

@media (max-width: 640px) {
  .ia-fab { right: 16px; bottom: 16px; }
  .ia-fab-bolha { width: 58px; height: 58px; }
  .ia-teaser { right: 84px; bottom: 24px; }
  .ia-fab-pastilha { height: 54px; padding: 0 18px 0 14px; }
  .ia-fab-long { display: none; }
  .ia-fab-short { display: inline; }
  .ia-window { right: 12px !important; bottom: 84px !important; width: calc(100vw - 24px) !important; }
}

/* =========================================================
   Janela do chat: proporções (a conversa ocupa o espaço;
   as perguntas rápidas ficam numa linha deslizante)
========================================================= */
.ia-window {
  width: min(400px, calc(100vw - 32px)) !important;
  height: min(620px, calc(100vh - 130px));
  max-height: none !important;
}
.ia-window .ia-chat {
  flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px;
  padding: 12px 14px 12px; overflow: hidden;
}
.ia-window .ia-log { flex: 1; min-height: 0; max-height: none; overflow-y: auto; padding-right: 4px; }
.ia-window .ia-demo { flex-shrink: 0; }
.ia-window .ia-chips { flex-shrink: 0; max-height: 40%; overflow-y: auto; gap: 6px; }
.ia-window .ia-chip { padding: 6px 12px; font-size: 12.5px; }
/* depois da 1.ª pergunta: uma só linha que desliza para o lado */
.ia-window .ia-started .ia-chips {
  flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; max-height: none;
  padding-bottom: 6px; scrollbar-width: thin; scrollbar-color: rgba(32,220,255,.35) transparent;
}
.ia-window .ia-started .ia-chip { white-space: nowrap; flex-shrink: 0; }
.ia-window .ia-input { flex-shrink: 0; }
.ia-window .ia-input input, .ia-window .ia-send { min-height: 44px; height: 44px; }
.ia-window .ia-send { width: 44px; }
.ia-window .ia-note { flex-shrink: 0; font-size: 11px; }
.ia-window .ia-msg { max-width: 88%; font-size: 13.5px; }
.ia-log::-webkit-scrollbar, .ia-chips::-webkit-scrollbar { width: 6px; height: 6px; }
.ia-log::-webkit-scrollbar-thumb, .ia-chips::-webkit-scrollbar-thumb { background: rgba(32, 220, 255, 0.3); border-radius: 6px; }
@media (max-width: 640px) {
  .ia-window { height: calc(100vh - 110px); }
}
