/* =========================================================
   CSBC26 — Chat Page Stylesheet
   Imersiva, focada, mobile-first, responsiva para desktop
   ========================================================= */

/* ---------------------------------------------------------
   BODY OVERRIDES — real chat-app shell: header fixed, messages
   scroll internally, input bar fixed. Applies at every size.
   --------------------------------------------------------- */
html:has(.chat-page) {
  height: 100%;
  overflow: hidden;
}

.chat-page {
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ---------------------------------------------------------
   AMBIENT PARTICLES — page-level decorative texture
   Covers most of the viewport height (fixed, behind chat
   content but above the .bg-orbs layer). Particles are spawned
   and animated via GSAP (see chat.js): they drift upward and
   fade out on an infinite loop, using the brand palette.
   A top-edge mask fades the whole layer to transparent so
   particles never appear to "pop" in/out mid-air. The layer
   fades away for good once the chat becomes active.
   --------------------------------------------------------- */
.ambient-particles {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 60%;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.55;
  /* Soft blur so the particles read as a hazy ambient texture
     rather than sharp dots */
  filter: blur(1.5px);
  /* Fade the top edge so particles rising out of view (or newly
     spawned near the top of the band) dissolve smoothly instead
     of cutting off abruptly */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 35%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 35%);
  transition: opacity var(--duration-slow) var(--ease-out);
}

.ambient-particles.is-inactive {
  opacity: 0;
}

.ambient-particle {
  position: absolute;
  border-radius: 50%;
  will-change: transform, opacity;
}

/* ---------------------------------------------------------
   CHAT HEADER
   --------------------------------------------------------- */
.chat-header {
  position: sticky;
  top: 0;
  z-index: 20;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-md) var(--sp-md);
  border-bottom: 1px solid var(--glass-border);
  background: rgba(11, 15, 59, 0.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.chat-header__back,
.chat-header__clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--glass-highlight);
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.chat-header__back:hover,
.chat-header__clear:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  transform: scale(1.05);
}

.chat-header__back:active,
.chat-header__clear:active {
  transform: scale(0.95);
}

.chat-header__back svg,
.chat-header__clear svg {
  width: 18px;
  height: 18px;
}

.chat-header__center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}

.chat-header__title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.chat-header__status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--verde);
}

/* ---------------------------------------------------------
   CHAT SHELL — flex-1 container, own scroll context.
   Header above and input bar below stay fixed in place;
   only this area scrolls (empty-state OR messages log).
   --------------------------------------------------------- */
.chat-shell {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  /* Native scrollbar is fully hidden — .chat-scrollbar (glass, GSAP) replaces it */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.chat-shell::-webkit-scrollbar {
  display: none;
}

/* ---------------------------------------------------------
   BETA DISCLAIMER BANNER
   Sticky at the top of .chat-shell so it stays visible while
   the message log scrolls underneath it. Two visual modes,
   toggled by the .is-empty modifier on .chat-shell:

   1. Empty state (.chat-shell.is-empty) — the banner is NOT
      sticky; it's a regular flex item pushed toward the bottom
      of the viewport by the expanding empty-state, so it reads
      as a footnote rather than a header.
   2. Chat mode (default) — sticky at top:0, so it pins to the
      top of the scroll viewport while messages scroll behind.
      .chat-messages gets a matching top padding so the first
      message is never hidden behind the banner.
   --------------------------------------------------------- */
.beta-banner {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: 8px var(--sp-md);
  margin: var(--sp-xs) var(--sp-md) var(--sp-sm);
  border-radius: var(--radius-md);
  border: 1px solid rgba(251, 126, 77, 0.32);
  background:
    linear-gradient(135deg, rgba(251, 126, 77, 0.14) 0%, rgba(59, 78, 226, 0.12) 100%);
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.45;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 2px 14px rgba(251, 126, 77, 0.08);
  flex-shrink: 0;
  z-index: 5;
  pointer-events: auto;
}

.beta-banner__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(251, 126, 77, 0.18);
  border: 1px solid rgba(251, 126, 77, 0.4);
  color: var(--laranja);
}

.beta-banner__icon svg {
  width: 14px;
  height: 14px;
}

.beta-banner__text strong {
  color: var(--laranja);
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ── Empty state: banner sits near the bottom of the empty
   viewport, after the greeting/avatar (high flex-order), with
   margin-top:auto to absorb remaining space. ── */
.chat-shell.is-empty .beta-banner {
  position: static;
  order: 99;
  margin-top: auto;
  margin-bottom: var(--sp-xs);
}

/* ── Chat mode: banner pins to the top of the scroll viewport.
   Margins are zeroed here: vertical spacing below the banner is
   controlled entirely by .chat-messages' padding-top, which is
   tied to --beta-banner-height so it always matches regardless
   of how many lines the banner wraps to. Reset the empty-state
   flex order so it doesn't push chat-messages in front of it. */
.chat-shell:not(.is-empty) .beta-banner {
  position: sticky;
  top: 0;
  order: 0;
  margin: 0 var(--sp-md);
  /* Banner must stay above the message bubbles as they scroll. */
  z-index: 6;
}

/* When banner is sticky at the top, chat-messages needs top
   padding equal to the banner's height + a small gap so the
   first message starts below it (not behind it). The actual
   value is computed in JS (see applyBetaBannerOffset() in
   chat.js) and stored on --beta-banner-height on .chat-shell,
   so the padding reacts to font-size / width changes. */
.chat-shell:not(.is-empty) {
  /* Banner horizontal margins in sticky mode; vertical comes
     from the gap below it. */
  --beta-banner-hpad: var(--sp-md);
}

.chat-shell:not(.is-empty) .chat-messages {
  padding-top: calc(var(--beta-banner-height) + var(--sp-sm));
}

/* ---------------------------------------------------------
   SECONDARY BANNER — STATIC, ABOVE THE INPUT BAR
   Lives inside .chat-input-bar (above the suggestions/textarea)
   so it sits in the non-scrolling footer of the page, just like
   the input itself. Hidden by default; chat.js adds .is-revealed
   to .chat-page once the user enters chat mode (sends the first
   message), and removes it again on clear. The primary
   `#beta-banner` keeps its own sticky-at-top behavior in the
   scrollable shell.
   --------------------------------------------------------- */
.beta-banner--static {
  display: none;
  /* Match the visual language of the primary beta-banner; tuned
     margins so it reads as a header for the input group rather
     than floating in space. */
  margin: 0 var(--sp-md) var(--sp-sm);
}

.chat-page.is-revealed .beta-banner--static {
  display: flex;
  /* A short entrance animation so the second warning feels like
     a deliberate answer to "what's next" once the user crosses
     into chat mode. */
  animation: static-banner-in 0.45s var(--ease-out) both;
}

@keyframes static-banner-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* The scrollbar track must start BELOW the sticky banner so it
   doesn't overlap. Done in JS via updateScrollbarGeometry — the
   banner's offsetHeight is subtracted from the track height. */

/* ---------------------------------------------------------
   CUSTOM SCROLLBAR — glass morphism track + GSAP-driven thumb.
   Sits fixed to the right edge of the chat column, spanning the
   scrollable area between header and input bar. Visibility and
   thumb size/position are handled entirely by chat.js (GSAP).
   --------------------------------------------------------- */
.chat-scrollbar {
  /* top & height are computed in JS to always match the current
     bounding box of .chat-shell (which changes as the input bar
     grows/shrinks) — see updateScrollbarGeometry() in chat.js */
  position: fixed;
  top: 0;
  height: 0;
  right: 6px;
  width: 8px;
  z-index: 15;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-base) var(--ease-out),
    background var(--duration-fast) var(--ease-out);
}

.chat-scrollbar.is-visible {
  pointer-events: auto;
}

.chat-scrollbar:hover,
.chat-scrollbar.is-dragging {
  background: rgba(255, 255, 255, 0.09);
}

.chat-scrollbar__thumb {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  border-radius: 100px;
  background: linear-gradient(180deg,
      rgba(59, 78, 226, 0.75) 0%,
      rgba(69, 214, 121, 0.55) 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 12px rgba(59, 78, 226, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  cursor: grab;
  will-change: transform, height;
}

.chat-scrollbar__thumb:active {
  cursor: grabbing;
}

.chat-scrollbar.is-dragging .chat-scrollbar__thumb {
  box-shadow: 0 0 18px rgba(59, 78, 226, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

@media (min-width: 900px) {
  .chat-scrollbar {
    right: calc((100% - 760px) / 2 + 6px);
  }
}

.site-header {
  flex-shrink: 0;
}

/* ---------------------------------------------------------
   EMPTY STATE — avatar + greeting + suggestions
   --------------------------------------------------------- */
/* BUGFIX (hero fantasma): o switchToChatMode() esconde o estado vazio com o
   atributo HTML `hidden`, mas `display: flex` declarado aqui tem
   especificidade maior que o `[hidden] { display: none }` do user-agent —
   o hero ficava invisível (opacity 0 via GSAP) porém AINDA no layout com
   flex: 1, criando o grande espaçamento em branco acima das mensagens.
   O !important abaixo garante que `hidden` sempre remova o elemento do
   fluxo, para .chat-empty e .chat-messages (mesma classe de conflito). */
.chat-empty[hidden],
.chat-messages[hidden] {
  display: none !important;
}

.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-xl);
  padding: var(--sp-lg) var(--sp-md) var(--sp-xs);
}

/* ── BOT AVATAR ── */
.bot-avatar-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  flex-shrink: 0;
  margin-top: var(--sp-md);
}

.bot-avatar__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(59, 78, 226, 0.35);
}

.bot-avatar__ring--outer {
  inset: -16px;
  border-color: rgba(59, 78, 226, 0.15);
  animation: ring-pulse-outer 3.5s ease-in-out infinite;
}

.bot-avatar__ring--mid {
  inset: -6px;
  border-color: rgba(59, 78, 226, 0.28);
  animation: ring-pulse-mid 3.5s ease-in-out infinite 0.4s;
}

@keyframes ring-pulse-outer {

  0%,
  100% {
    opacity: 0.4;
    transform: scale(1);
  }

  50% {
    opacity: 0.9;
    transform: scale(1.04);
  }
}

@keyframes ring-pulse-mid {

  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.02);
  }
}

.bot-avatar__core {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(59, 78, 226, 0.55) 0%, rgba(20, 25, 100, 0.8) 100%);
  border: 1px solid rgba(59, 78, 226, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 40px rgba(59, 78, 226, 0.35),
    0 0 80px rgba(59, 78, 226, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow: hidden;
  animation: avatar-breathe 4s ease-in-out infinite;
}

@keyframes avatar-breathe {

  0%,
  100% {
    box-shadow: 0 0 40px rgba(59, 78, 226, 0.35), 0 0 80px rgba(59, 78, 226, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }

  50% {
    box-shadow: 0 0 60px rgba(59, 78, 226, 0.55), 0 0 120px rgba(59, 78, 226, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  }
}

.bot-avatar__img {
  width: 78%;
  height: 78%;
  object-fit: contain;
  border-radius: 50%;
  filter: drop-shadow(0 0 12px rgba(59, 78, 226, 0.6));
}

/* Orbiting particles */
.bot-avatar__particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.p1 {
  width: 8px;
  height: 8px;
  background: var(--azul-claro);
  box-shadow: 0 0 10px var(--azul-claro);
  top: 0;
  left: 50%;
  transform-origin: 0 70px;
  animation: orbit-1 6s linear infinite;
}

.p2 {
  width: 5px;
  height: 5px;
  background: var(--verde);
  box-shadow: 0 0 8px var(--verde);
  top: 50%;
  right: -2px;
  transform-origin: -70px 0;
  animation: orbit-2 9s linear infinite reverse;
}

.p3 {
  width: 6px;
  height: 6px;
  background: var(--laranja);
  box-shadow: 0 0 8px var(--laranja);
  bottom: 4px;
  left: 20%;
  transform-origin: 30px -60px;
  animation: orbit-3 7s linear infinite;
}

@keyframes orbit-1 {
  to {
    transform: rotate(360deg);
  }
}

@keyframes orbit-2 {
  to {
    transform: rotate(360deg);
  }
}

@keyframes orbit-3 {
  to {
    transform: rotate(360deg);
  }
}

/* ── GREETING TEXT ── */
.chat-empty__text {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}

.chat-empty__title {
  font-size: clamp(1.5rem, 6vw, 2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.chat-empty__brand {
  background: linear-gradient(135deg, var(--azul-claro) 0%, var(--verde) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.chat-empty__brand-num {
  font-weight: 300;
}

.chat-empty__sub {
  font-size: 0.9rem;
  color: var(--text-secondary);
  min-height: 1.4em;
  line-height: 1.5;
}

/* ── SUGGESTIONS CAROUSEL — lives inside the input bar, above the field ── */
.suggestions-carousel {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-sm);
  transition: opacity var(--duration-base) var(--ease-out);
}

.suggestions-carousel[hidden] {
  display: none;
}

.suggestions-carousel__label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 var(--sp-xs);
}

.chips-carousel__track {
  display: flex;
  gap: var(--sp-sm);
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px var(--sp-xs) 6px;
  margin: 0 calc(var(--sp-xs) * -1);
  scroll-snap-type: x proximity;
  cursor: grab;
  /* Drag is fully handled via JS pointer events (see chat.js) so the
     browser's own touch-panning doesn't fight with it and feel "stuck" */
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  /* Fallback mask (right-edge fade only) before JS computes the real
     scroll position; chat.js updates this dynamically on both edges
     as chips scroll past — see updateChipsEdgeFade() */
  -webkit-mask-image: linear-gradient(to right, black 92%, transparent 100%);
  mask-image: linear-gradient(to right, black 92%, transparent 100%);
  /* Hide scrollbar */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}
.chips-carousel__track::-webkit-scrollbar {
  display: none;
}

.chips-carousel__track.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

/* Chip style matches the homepage .suggestion-pill (brand blue glass) */
.suggestion-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(59, 78, 226, 0.18);
  border: 1px solid rgba(59, 78, 226, 0.35);
  border-radius: 100px;
  padding: 8px 16px;
  white-space: nowrap;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  scroll-snap-align: start;
  transition:
    background var(--duration-base) var(--ease-out),
    border-color var(--duration-base) var(--ease-out),
    color var(--duration-base) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.suggestion-chip::before {
  content: '✦';
  font-size: 0.6rem;
  color: var(--azul-claro);
  flex-shrink: 0;
}

.suggestion-chip:hover {
  background: rgba(59, 78, 226, 0.28);
  border-color: rgba(59, 78, 226, 0.6);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.suggestion-chip:active {
  transform: translateY(0) scale(0.97);
}

/* ---------------------------------------------------------
   CHAT MESSAGES LOG
   --------------------------------------------------------- */
.chat-messages {
  flex: 1;
  padding: var(--sp-lg) var(--sp-md);
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}

/* ── Message bubble ── */
.msg {
  display: flex;
  gap: var(--sp-sm);
  max-width: 88%;
  animation: msg-in 0.35s var(--ease-out) both;
}

@keyframes msg-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* User message — right aligned */
.msg--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

/* Bot message — left aligned */
.msg--bot {
  align-self: flex-start;
}

.msg__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--glass-border);
}

.msg__avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: linear-gradient(145deg, rgba(59, 78, 226, 0.7) 0%, rgba(20, 25, 100, 0.9) 100%);
}

.msg__avatar-user {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--azul-claro) 0%, var(--verde) 100%);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--branco);
}

.msg__bubble {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.55;
  max-width: 100%;
  word-break: break-word;
}

.msg--user .msg__bubble {
  background: linear-gradient(135deg, var(--azul-claro) 0%, rgba(59, 78, 226, 0.8) 100%);
  color: var(--branco);
  border-radius: var(--radius-md) var(--radius-md) 4px var(--radius-md);
}

.msg--bot .msg__bubble {
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  border-radius: var(--radius-md) var(--radius-md) var(--radius-md) 4px;
  backdrop-filter: blur(12px);
}

/* ── Typing indicator ── */
.msg--typing .msg__bubble {
  padding: 14px 18px;
}

.typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
}

.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--azul-claro);
  animation: typing-bounce 1.2s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing-bounce {

  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }

  30% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

/* ── Timestamp ── */
.msg__time {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 3px;
  padding: 0 4px;
  align-self: flex-end;
}

.msg--user .msg__time {
  text-align: right;
}

/* ---------------------------------------------------------
   INPUT BAR
   --------------------------------------------------------- */
.chat-input-bar {
  position: sticky;
  bottom: 0;
  z-index: 10;
  flex-shrink: 0;
  padding: var(--sp-sm) var(--sp-md) var(--sp-md);
  -webkit-backdrop-filter: blur(24px);
  overflow: visible;
}

.chat-input-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-sm) var(--sp-sm) var(--sp-md);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(20px);
  transition:
    border-color var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out);
}

.chat-input-wrap:focus-within {
  border-color: rgba(59, 78, 226, 0.55);
  box-shadow: 0 0 0 3px rgba(59, 78, 226, 0.12);
}

.chat-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--text-primary);
  line-height: 1.5;
  max-height: 160px;
  overflow-y: auto;
  padding: 2px 0;
  scrollbar-width: none;
}

.chat-input::placeholder {
  color: var(--text-muted);
}

.chat-input::-webkit-scrollbar {
  display: none;
}

.chat-input-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.input-action-btn,
.input-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out),
    opacity var(--duration-fast) var(--ease-out);
}

/* Voice button */
.input-action-btn {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
}

.input-action-btn:hover {
  background: var(--glass-highlight);
  color: var(--text-primary);
}

.input-action-btn.is-listening {
  background: rgba(251, 126, 77, 0.25);
  border-color: rgba(251, 126, 77, 0.5);
  color: var(--laranja);
  animation: voice-pulse 1.2s ease-in-out infinite;
}

@keyframes voice-pulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(251, 126, 77, 0.4);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(251, 126, 77, 0);
  }
}

.input-action-btn svg,
.input-send-btn svg {
  width: 17px;
  height: 17px;
}

/* Send button */
.input-send-btn {
  background: var(--azul-claro);
  border: none;
  color: var(--branco);
  box-shadow: 0 4px 16px rgba(59, 78, 226, 0.35);
}

.input-send-btn:hover:not(:disabled) {
  background: #4f62f0;
  transform: scale(1.08);
  box-shadow: 0 6px 22px rgba(59, 78, 226, 0.5);
}

.input-send-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.input-send-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}

/* ---------------------------------------------------------
   CHAT FOOTER
   --------------------------------------------------------- */
.chat-footer {
  padding: 8px var(--sp-md);
  flex-shrink: 0;
}

/* ---------------------------------------------------------
   DESKTOP LAYOUT — wider, side-by-side feel
   --------------------------------------------------------- */
@media (min-width: 600px) {
  .bot-avatar-wrap {
    width: 160px;
    height: 160px;
  }

  .bot-avatar__img {
    width: 75%;
    height: 75%;
  }

  .suggestions-carousel__track {
    grid-template-columns: repeat(3, 1fr);
  }

  .chat-empty__title {
    font-size: 2.2rem;
  }
}

@media (min-width: 900px) {
  .chat-header {
    padding: var(--sp-md) var(--sp-xl);
  }

  .chat-shell {
    max-width: 760px;
    width: 100%;
    margin: 0 auto;
  }

  .chat-input-bar {
    padding: var(--sp-sm) calc((100% - 760px) / 2 + var(--sp-xl));
  }

  .chat-messages {
    padding: var(--sp-lg) var(--sp-xl);
  }

  .chat-empty {
    padding: var(--sp-xl) var(--sp-xl);
    max-width: 760px;
    margin: 0 auto;
    width: 100%;
  }

  .msg {
    max-width: 78%;
  }

  .bot-avatar-wrap {
    width: 180px;
    height: 180px;
  }

  .suggestions-carousel__track {
    grid-template-columns: repeat(3, 1fr);
  }
}


/* ---------------------------------------------------------
   1. HEADER TWEAKS
   --------------------------------------------------------- */
.header-inner--gamificacao {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  padding: 8px 16px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.back-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}