/* =========================================================
   Scallar — Widget de chat de suporte (cores e fonte ajustadas ao site novo em 01/11/2026)
   Variáveis escopadas na raiz do widget (não vazam para o
   site nem herdam o tema claro/escuro da página).
   ========================================================= */

#scallar-chat-root {
  --sc-blue: #1D6FE8;
  --sc-blue-dark: #0B2A5B;
  --sc-cyan: #1D6FE8;
  --sc-orange: #F58C28;
  --sc-text: #0B2A5B;
  --sc-muted: #5A6985;
  --sc-bubble-bg: #EEF4FD;
  --sc-border: #E4ECF7;
  --sc-card: #FFFFFF;
  --sc-radius: 20px;
  --sc-font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  position: fixed;
  z-index: 2147483000;
  bottom: 0;
  right: 0;
  font-family: var(--sc-font);
  color: var(--sc-text);
}

#scallar-chat-root * { box-sizing: border-box; }

/* ---------- Botão flutuante ---------- */
.sc-launcher {
  position: fixed;
  right: 24px;
  bottom: 92px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--sc-blue-dark);
  border: none;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 16px 40px rgba(11, 42, 91, .14);
  transition: transform .15s ease, box-shadow .15s ease;
}
.sc-launcher:hover { transform: translateY(-2px); }
.sc-launcher svg { width: 26px; height: 26px; }
.sc-launcher.is-hidden { display: none; }

.sc-badge-novo {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--sc-orange);
  border: 2px solid #fff;
}

/* ---------- Janela do chat ---------- */
.sc-window {
  position: fixed;
  right: 24px;
  bottom: 160px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: min(600px, calc(100vh - 200px));
  background: var(--sc-card);
  border-radius: var(--sc-radius);
  border: 1px solid var(--sc-border);
  box-shadow: 0 16px 40px rgba(11, 42, 91, .14);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.sc-window.is-open { display: flex; }

.sc-header {
  background: var(--sc-blue);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}
.sc-header-title { font-weight: 700; font-size: 15.5px; margin: 0; }
.sc-header-sub { font-size: 12px; opacity: .85; margin: 3px 0 0; }
.sc-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 2px;
  display: inline-flex;
  flex-shrink: 0;
  opacity: .9;
}
.sc-close:hover { opacity: 1; }
.sc-close svg { width: 20px; height: 20px; }

.sc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sc-msg {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  white-space: normal;
  word-wrap: break-word;
}
.sc-msg p { margin: 0 0 6px; }
.sc-msg p:last-child { margin-bottom: 0; }
.sc-msg ul { margin: 4px 0; padding-left: 18px; list-style: disc; }
.sc-msg a { color: inherit; text-decoration: underline; }
.sc-msg-bot {
  align-self: flex-start;
  background: var(--sc-bubble-bg);
  color: var(--sc-text);
  border-radius: 14px 14px 14px 4px;
}
.sc-msg-user {
  align-self: flex-end;
  background: var(--sc-cyan);
  color: #fff;
  border-radius: 14px 14px 4px 14px;
}

.sc-typing {
  align-self: flex-start;
  display: inline-flex;
  gap: 4px;
  background: var(--sc-bubble-bg);
  padding: 10px 13px;
  border-radius: 14px 14px 14px 4px;
}
.sc-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--sc-muted);
  animation: sc-blink 1.2s infinite ease-in-out;
}
.sc-typing span:nth-child(2) { animation-delay: .2s; }
.sc-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes sc-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .sc-typing span { animation: none; opacity: .6; }
}

.sc-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 10px;
  flex-shrink: 0;
}
.sc-quick-btn {
  background: transparent;
  border: 1.5px solid var(--sc-blue);
  color: var(--sc-blue);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--sc-font);
  transition: background-color .15s ease, color .15s ease;
}
.sc-quick-btn:hover { background: var(--sc-blue); color: #fff; }
.sc-quick-btn:disabled { opacity: .5; cursor: default; }

.sc-retry-btn {
  background: var(--sc-orange);
  border: none;
  color: #1F2630;
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--sc-font);
  align-self: flex-start;
}

.sc-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--sc-border);
  flex-shrink: 0;
}
.sc-input {
  flex: 1;
  resize: none;
  border: 1px solid var(--sc-border);
  border-radius: 12px;
  padding: 10px 12px;
  font-family: var(--sc-font);
  font-size: 14px;
  line-height: 1.4;
  max-height: 100px;
  color: var(--sc-text);
  background: #fff;
}
.sc-input:focus { outline: 2px solid var(--sc-blue); outline-offset: 1px; }
.sc-input:disabled { background: #F3F4F6; }

.sc-send {
  background: var(--sc-orange);
  border: none;
  color: #1F2630;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.sc-send svg { width: 18px; height: 18px; }
.sc-send:disabled { opacity: .5; cursor: default; }

.sc-footer {
  font-size: 10.5px;
  color: var(--sc-muted);
  text-align: center;
  padding: 6px 12px 10px;
  flex-shrink: 0;
}

.sc-honeypot {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

@media (max-width: 480px) {
  .sc-window {
    right: 0;
    bottom: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    border: none;
  }
  .sc-close { padding: 8px; }
  .sc-close svg { width: 24px; height: 24px; }
  .sc-launcher { right: 16px; bottom: 84px; }
}

.sc-launcher:focus-visible, .sc-close:focus-visible, .sc-quick-btn:focus-visible, .sc-send:focus-visible, .sc-retry-btn:focus-visible { outline: 3px solid #1D6FE8; outline-offset: 3px; }
.sc-header { background: var(--sc-blue-dark); }
