@font-face {
  font-family: Poppins;
  src: url('/fontes/poppins-600-italic-latin.woff2') format('woff2');
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Poppins;
  src: url('/fontes/poppins-600-italic-latin-ext.woff2') format('woff2');
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;
  --cyan: #38c8ff;
  --blue: #0568e7;
  --glass: rgba(91, 153, 220, .47);
  font-family: Poppins, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }
body {
  color: #fff;
  background: #03163a url('/bcgd/background.webp') center / cover fixed no-repeat;
}

.chat-shell {
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-rows: clamp(104px, 15vh, 158px) minmax(0, 1fr) auto;
  gap: 10px;
  padding: env(safe-area-inset-top) max(clamp(14px, 2.2vw, 34px), env(safe-area-inset-right)) max(clamp(16px, 2.5vh, 38px), env(safe-area-inset-bottom)) max(clamp(14px, 2.2vw, 34px), env(safe-area-inset-left));
  background: linear-gradient(180deg, rgba(0, 16, 50, .08), rgba(0, 17, 54, .10) 50%, rgba(0, 12, 42, .23));
}

.chat-header { display: flex; align-items: flex-start; min-height: 0; }
.brand {
  display: block;
  width: min(380px, 72vw);
  height: clamp(190px, 21vh, 215px);
  object-fit: contain;
  object-position: left top;
  filter: drop-shadow(0 2px 8px #001238);
}

.conversation {
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  padding: 0 clamp(0px, 1vw, 16px);
}
.message-list {
  width: 100%;
  max-width: 1390px;
  margin: auto auto 0;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.6vh, 18px);
}
.message-list--queued { gap: clamp(100px, 14vh, 145px); transform: translateY(clamp(18px, 3vh, 32px)); }
.message-list--queued .message--consent { margin-top: clamp(32px, 6vh, 62px); }
.message { width: 100%; display: flex; align-items: flex-end; gap: clamp(12px, 1.2vw, 20px); }
.message--agent { justify-content: flex-start; }
.message--visitor { justify-content: flex-end; }
.message-content { min-width: 0; max-width: min(78%, 940px); display: flex; flex-direction: column; gap: 4px; }
.message--queue .message-content { max-width: min(720px, 65%); }
.message--visitor .message-content { align-items: flex-end; }
.message-label {
  padding: 0 18px;
  color: #fff;
  font-size: clamp(1.05rem, 2vw, 2rem);
  line-height: 1.05;
  font-weight: 600;
  font-style: italic;
  -webkit-text-stroke: 1px rgba(0,0,0,.96);
  paint-order: stroke fill;
  text-shadow: 2px 3px 2px #000, 0 0 4px rgba(0,0,0,.92);
}
.message-avatar { flex: 0 0 auto; width: clamp(66px, 9vw, 136px); height: clamp(66px, 9vw, 136px); }
.message-avatar--agent {
  background: #062453 url('/assets/logo.png') left top / 280% auto no-repeat;
  border: 4px solid #48ee08;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 14px 4px #22e400, 0 0 30px rgba(24, 237, 0, .65);
}
.message-avatar--visitor {
  position: relative;
  overflow: hidden;
  border: 4px solid rgba(223, 242, 255, .95);
  border-radius: 50%;
  background: linear-gradient(145deg, #f5fbff, #9cc5ee);
  box-shadow: 0 0 18px rgba(124, 194, 255, .7);
}
.message-avatar--visitor::before {
  content: '';
  position: absolute;
  width: 35%;
  height: 35%;
  top: 17%;
  left: 32.5%;
  border-radius: 50%;
  background: #315b98;
}
.message-avatar--visitor::after {
  content: '';
  position: absolute;
  width: 68%;
  height: 43%;
  left: 16%;
  bottom: -5%;
  border-radius: 50% 50% 34% 34%;
  background: #315b98;
}

.bubble {
  position: relative;
  max-width: 100%;
  padding: clamp(15px, 1.6vw, 22px) clamp(20px, 2.3vw, 36px);
  border: 1.6px solid rgba(210, 245, 255, .95);
  border-radius: 36px;
  color: #fff;
  font-family: Poppins, Arial, sans-serif;
  font-size: clamp(1.08rem, 1.7vw, 1.7rem);
  font-weight: 600;
  font-style: italic;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  -webkit-text-stroke: 1.35px rgba(0,0,0,.98);
  paint-order: stroke fill;
  text-shadow: 2px 3px 2px #000, 0 0 4px rgba(0,0,0,.96);
  isolation: isolate;
}
.bubble--agent {
  background: linear-gradient(135deg,rgba(105,185,245,.46),rgba(15,104,211,.47) 45%,rgba(4,57,150,.51));
  box-shadow: 0 0 26px rgba(39,180,255,.95),0 0 42px rgba(0,150,255,.34),inset 0 1px 3px rgba(255,255,255,.96),inset 0 -16px 28px rgba(0,70,170,.3);
  backdrop-filter: blur(12px) saturate(155%);
  -webkit-backdrop-filter: blur(12px) saturate(155%);
}
.message--queue .bubble--agent {
  font-weight: 600;
}
.bubble::before {
  content: '';
  position: absolute;
  z-index: 0;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg,rgba(255,255,255,.38),rgba(255,255,255,0) 11%,transparent 84%,rgba(255,255,255,.34)),linear-gradient(90deg,rgba(255,255,255,.2),transparent 7%,transparent 94%,rgba(255,255,255,.25));
  opacity: .88;
  pointer-events: none;
}
.bubble::after {
  content: '';
  position: absolute;
  z-index: 0;
  inset: 4px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 30px;
  box-shadow: inset 0 1px 2px rgba(255,255,255,.28);
  pointer-events: none;
}
.bubble-text, .consent-bubble p, .consent-actions { position:relative; z-index:1; }
.bubble-tail { position:absolute; z-index:0; top:50%; width:34px; height:38px; transform:translateY(-50%); filter:drop-shadow(0 0 7px #4acbff); }
.bubble-tail--agent { left:-28px; background:linear-gradient(140deg,rgba(142,207,255,.85),rgba(9,87,190,.88)); clip-path:polygon(100% 0,100% 100%,0 50%); }
.bubble-tail--visitor { right:-28px; background:linear-gradient(220deg,rgba(91,210,255,.94),rgba(0,72,184,.95)); clip-path:polygon(0 0,100% 50%,0 100%); }
.consent-bubble .bubble-tail { top:50%; }
.bubble--visitor {
  background: linear-gradient(135deg,rgba(36,181,255,.64),rgba(0,92,214,.73) 48%,rgba(0,45,146,.82));
  box-shadow: 0 0 26px rgba(0,186,255,.95),0 0 42px rgba(0,115,255,.35),inset 0 1px 3px rgba(255,255,255,.96),inset 0 -16px 28px rgba(0,53,158,.38);
  backdrop-filter: blur(12px) saturate(155%);
  -webkit-backdrop-filter: blur(12px) saturate(155%);
}
.message--system { justify-content: center; }
.bubble--system {
  max-width: 92%;
  border-radius: 20px;
  background: rgba(2, 30, 83, .78);
  text-align: center;
  font-size: clamp(.95rem, 1.45vw, 1.25rem);
  font-style: normal;
}

.message--consent { align-items: flex-end; }
.consent-bubble { width: min(100%, 940px); padding-top: clamp(12px, 1.4vw, 18px); padding-bottom: clamp(12px, 1.4vw, 18px); }
.consent-bubble p {
  margin: 0 0 clamp(10px, 1vw, 14px);
  font-weight: 600;
  font-style: italic;
  -webkit-text-stroke: 1.35px rgba(0,0,0,.98);
  paint-order: stroke fill;
  text-shadow: 2px 3px 2px #000, 0 0 4px rgba(0,0,0,.96);
}
.consent-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; }
.consent-actions button {
  min-width: clamp(145px, 15vw, 190px);
  border: 3px solid #050505;
  border-radius: 18px;
  padding: 16px 22px;
  color: #fff;
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  font-family: Poppins, Arial, sans-serif;
  font-weight: 600;
  font-style: italic;
  -webkit-text-stroke: .9px rgba(0,0,0,.98);
  paint-order: stroke fill;
  text-shadow: 2px 2px 2px #000, 0 0 3px rgba(0,0,0,.95);
  cursor: pointer;
  box-shadow: 0 3px 12px #00143f;
}
.agree { background: #08ef00; }
.decline { background: #f20b12; }

.composer {
  width: 100%;
  min-height: clamp(70px, 9.5vh, 100px);
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.5vw, 22px);
  padding: 7px 12px 7px clamp(12px, 1.5vw, 25px);
  border: 2px solid #80dcff;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(3, 44, 112, .9), rgba(3, 74, 158, .83));
  box-shadow: 0 0 19px #078dff, inset 0 0 20px rgba(128, 213, 255, .25);
}
.composer input { min-width: 0; flex: 1; border: 0; outline: 0; padding: 12px 4px; color: #fff; background: transparent; font: italic clamp(1.05rem, 2vw, 1.8rem) Arial, sans-serif; }
.composer:focus-within { outline: 3px solid #fff; outline-offset: 3px; }
button:focus-visible, .rating-choice:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
.composer input::placeholder { color: #e3f4ff; opacity: .96; font-style: italic; }
.send {
  flex: none;
  width: clamp(54px, 6vw, 82px);
  height: clamp(54px, 6vw, 82px);
  display: grid;
  place-items: center;
  border: 1px solid #9deaff;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #20d5ff, #0064ee);
  box-shadow: 0 0 16px #15bfff;
  cursor: pointer;
}
.send:disabled { opacity: .48; cursor: not-allowed; }
.send svg { width: 42%; height: 42%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.typing-label { flex: 0 0 auto; align-self: flex-start; margin: 8px 0 0 clamp(78px, 10vw, 150px); color: #fff; font-size: clamp(.9rem, 1.2vw, 1.1rem); font-weight: 700; text-shadow: 0 1px 4px #001238; }
.retry-action { align-self: flex-start; margin: 8px 0 12px clamp(78px, 10vw, 150px); padding: 8px 14px; border: 2px solid #a4e8ff; border-radius: 15px; color: #fff; background: #07478f; font: 600 1rem Poppins, Arial, sans-serif; cursor: pointer; }
.typing-dots { display: inline-flex; gap: 4px; margin-left: 5px; }
.typing-dots i { width: 5px; height: 5px; border-radius: 50%; background: #fff; animation: pulse 1s infinite ease-in-out; }
.typing-dots i:nth-child(2) { animation-delay: .18s; }
.typing-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes pulse { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.visually-hidden, .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
:where(.rating-options) { display: flex; align-self: flex-start; flex-wrap: wrap; gap: 8px; max-width: min(84%, 880px); padding: 4px 0; margin-left: clamp(78px, 10vw, 150px); }
.rating-choice { border: 1px solid #91ddff; border-radius: 999px; padding: 9px 14px; color: #fff; background: rgba(0,77,170,.94); font: 600 1rem Arial,sans-serif; box-shadow: 0 0 9px #087edb; cursor: pointer; }
.rating-choice:hover, .rating-choice:focus-visible { background: #087de6; outline: 2px solid #fff; outline-offset: 2px; }
.turnstile-box { position: fixed; right: 8px; bottom: 8px; z-index: 5; }
noscript { position: fixed; z-index: 10; inset: auto 16px 16px; padding: 16px; border: 2px solid #8cdfff; border-radius: 16px; color: #fff; background: #073674; font: 600 1rem Arial, sans-serif; }
@media (prefers-reduced-motion: reduce) {
  .typing-dots i { animation: none; }
  *, *::before, *::after { scroll-behavior: auto !important; }
}

@media (max-width: 800px) {
  body { background-position: 48% center; }
  .chat-shell { padding: env(safe-area-inset-top) max(12px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); gap: 8px; grid-template-rows: 90px minmax(0, 1fr) auto; }
  .brand { width: min(245px, 57vw); height: 86px; }
  .message { gap: 9px; }
  .message-list--queued { gap: clamp(34px, 8vh, 72px); transform: translateY(clamp(12px, 2vh, 20px)); }
  .message-list--queued .message--consent { margin-top: clamp(18px, 4vh, 36px); }
  .message-content { max-width: 82%; }
  .message-avatar { width: clamp(50px, 12vw, 82px); height: clamp(50px, 12vw, 82px); }
  .message-label { padding: 0 10px; }
  .bubble { border-radius: 21px; }
  .bubble-tail { width:26px; height:30px; }
  .bubble-tail--agent { left:-21px; }
  .bubble-tail--visitor { right:-21px; }
  .composer { min-height: 62px; }
  .send { width: 50px; height: 50px; }
  .typing-label, :where(.rating-options) { margin-left: 56px; }
}
@media (max-height: 460px) {
  .chat-shell { grid-template-rows: 64px minmax(0, 1fr) auto; gap: 5px; padding-bottom: max(6px, env(safe-area-inset-bottom)); }
  .brand { height: 60px; width: min(230px, 50vw); }
  .composer { min-height: 54px; }
  .send { width: 44px; height: 44px; }
}
