:root {
  color-scheme: light;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --background: #e8ebe6;
  --ink: #151716;
  --muted: #777b79;
  --assistant-bubble: #f0f1ef;
  --visitor-bubble: #e7eae7;
  --border: #e1e4e0;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--background); }
body { color: var(--ink); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid #4d6254;
  outline-offset: 2px;
}
.page {
  width: 100%;
  min-height: 100dvh;
  background-color: var(--background);
  background-image: url("/wallpaper.svg");
  background-position: center top;
  background-repeat: repeat;
  background-size: 440px 440px;
}
.chat {
  display: flex;
  flex-direction: column;
  width: min(100%, 720px);
  height: 100dvh;
  min-height: 350px;
  margin: 0 auto;
  padding: 0 clamp(18px, 3.6vw, 38px);
}
.messages {
  display: flex;
  flex-direction: column;
  gap: 21px;
  align-items: flex-start;
  flex: 1;
  min-height: 0;
  padding: 40px 0 28px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #e0e2dd transparent;
}
.messages::before {
  content: "";
  margin-top: auto;
  flex-shrink: 0;
}
.msg {
  display: flex;
  max-width: min(88%, 530px);
  align-self: flex-start;
  min-width: 0;
  animation: show-message 260ms ease-out both;
}
.msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.msg-avatar, .date-label, .stamp { display: none; }
.msg-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.bubble {
  padding: 13px 18px;
  border: none;
  border-radius: 18px 18px 18px 5px;
  background: #183651;
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.58;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  letter-spacing: -0.1px;
}
.user .bubble {
  background: #244968;
  color: #ffffff;
  text-align: left;
  border-radius: 18px 18px 5px 18px;
}
.typing {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 46px;
  padding: 0;
}
.typing i {
  display: block;
  height: 6px;
  width: 6px;
  background: #d4e4ef;
  border-radius: 50%;
  animation: typing-dots 1s ease-in-out infinite;
}
.typing i:nth-child(2) { animation-delay: 130ms; }
.typing i:nth-child(3) { animation-delay: 260ms; }
.composer {
  flex-shrink: 0;
  padding: 12px 0 calc(30px + env(safe-area-inset-bottom, 0px));
  background: transparent;
}
.composer[hidden], #answerForm[hidden], input[hidden], textarea[hidden], [hidden] {
  display: none !important;
}
.choices {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding-bottom: 3px;
}
.choice {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 52px;
  gap: 12px;
  padding: 13px 18px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 13px;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  transition: background-color 150ms, border-color 150ms, transform 150ms;
}
.choice::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid #c3c8c3;
  flex-shrink: 0;
}
.choice:hover {
  background: #f3f5f2;
  border-color: #bfc8bd;
  transform: translateY(-1px);
}
.choice:active { transform: translateY(0); }
#answerForm {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 64px;
  padding: 8px 9px 8px 19px;
  border: 1px solid #dddfdc;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 14px #121b1206;
}
#answerInput, #answerTextarea {
  flex: 1;
  display: block;
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
  color: var(--ink);
  line-height: 1.5;
  resize: none;
}
#answerInput::placeholder, #answerTextarea::placeholder { color: #9a9d99; }
#answerTextarea { max-height: 140px; }
.send {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  background: #202422;
  color: #fff;
  border: none;
  border-radius: 12px;
  transition: background 150ms, transform 150ms;
}
.send:hover { background: #404942; }
.send:active { transform: scale(.97); }
.feedback {
  color: #af433b;
  font-size: 12px;
  margin: 10px 3px 0;
  line-height: 1.4;
}
.feedback:empty { display: none; }
.end-actions {
  align-self: flex-start;
}
.end-actions button {
  padding: 12px 17px;
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
}
.end-actions button:hover { background: var(--assistant-bubble); }
.dialog {
  width: min(390px, calc(100vw - 36px));
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 18px 72px #151b1530;
}
.dialog::backdrop { background: #191e1bb3; }
.dialog h2 {
  font-size: 19px;
  letter-spacing: -.5px;
  margin: 0 0 12px;
}
.dialog p {
  color: #666d67;
  font-size: 13px;
  line-height: 1.7;
}
.dialog form {
  margin-top: 24px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.dialog button {
  background: #f2f3f1;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 10px 14px;
  color: var(--ink);
  font-size: 13px;
}
.dialog button.confirm { background: #232824; color: white; }
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}
@keyframes show-message {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes typing-dots {
  0%, 65%, 100% { opacity: .45; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-4px); }
}
@media (max-width: 600px) {
  .chat { padding-inline: 16px; }
  .messages { padding-top: 23px; padding-bottom: 18px; gap: 19px; }
  .msg { max-width: 92%; }
  .bubble { font-size: 16px; padding: 12px 16px; line-height: 1.55; }
  .composer { padding-top: 10px; padding-bottom: calc(15px + env(safe-area-inset-bottom, 0px)); }
  .choice { font-size: 14px; min-height: 50px; }
  #answerForm { min-height: 59px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}


/* Visual do formulário de qualificação — conversa inspirada em aplicativo de mensagens. */
:root {
  --background: #e9ded5;
  --ink: #19252d;
  --assistant-bubble: #193c59;
  --visitor-bubble: #285778;
  --border: #d9d1cb;
}
html, body { background: #dcd0c5; }
.page {
  display: flex;
  justify-content: center;
  min-height: 100dvh;
  background: #dcd0c5;
  background-image: none;
}
.chat {
  width: min(100%, 770px);
  max-width: 770px;
  min-height: 380px;
  height: 100dvh;
  padding: 0;
  background: var(--background);
  box-shadow: 0 0 35px #523f3317;
  border-inline: 1px solid #cfbfb323;
  overflow: hidden;
}
.chat-header {
  display: flex;
  gap: 13px;
  align-items: center;
  flex-shrink: 0;
  min-height: 83px;
  padding: 13px 21px;
  background: #19384f;
  color: #fff;
  box-shadow: 0 2px 8px #261b1c14;
  z-index: 2;
}
.contact-avatar {
  width: 49px;
  height: 49px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e1e8e7;
  color: #8a999a;
  box-shadow: 0 0 0 1px #fff4;
  overflow: hidden;
}
.contact-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.contact-details { min-width: 0; flex: 1; }
.contact-details h1 {
  color: white;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.25px;
  line-height: 1.32;
  margin: 0 0 5px;
}
.contact-details h1 span { opacity: .74; font-weight: 500; }
.contact-details p {
  margin: 0;
  color: #b8cbd3;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
}
.header-action {
  display: grid;
  place-items: center;
  width: 28px;
  height: 38px;
  opacity: .75;
  flex-shrink: 0;
}
.chat-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background-color: #e9ded5;
  background-image: url("/wallpaper.svg");
  background-size: 440px 440px;
  background-repeat: repeat;
  background-position: center top;
}
.messages {
  flex: 1;
  min-height: 0;
  gap: 11px;
  padding: 29px 21px 20px;
  scrollbar-color: #c9bdb3 transparent;
}
.date-label {
  display: block;
  align-self: center;
  padding: 5px 12px;
  margin: 4px auto 9px;
  border-radius: 8px;
  background: #faf6f1d9;
  color: #766d66;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
  box-shadow: 0 1px 3px #37231b0b;
}
.msg {
  max-width: min(86%, 540px);
  position: relative;
}
.msg-wrap {
  position: relative;
  align-items: flex-start;
}
.msg.user .msg-wrap { align-items: flex-end; }
.msg .bubble {
  position: relative;
  padding: 11px 15px;
  background: var(--assistant-bubble);
  color: white;
  font-size: 15px;
  line-height: 1.52;
  font-weight: 500;
  border-radius: 4px 14px 14px 14px;
  box-shadow: 0 2px 3px #37282013;
}
.msg.user .bubble {
  background: var(--visitor-bubble);
  color: white;
  border-radius: 14px 4px 14px 14px;
  text-align: left;
}
.msg:not(.user) .bubble:not(.typing)::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 0;
  width: 10px;
  height: 14px;
  background: var(--assistant-bubble);
  clip-path: polygon(100% 0,100% 100%,0 0);
}
.msg.user .bubble::before {
  content: "";
  position: absolute;
  right: -7px;
  top: 0;
  width: 10px;
  height: 14px;
  background: var(--visitor-bubble);
  clip-path: polygon(0 0,100% 0,0 100%);
}
.stamp {
  display: block;
  margin: 3px 4px 0;
  color: #877d75;
  font-size: 9px;
  letter-spacing: .1px;
  align-self: flex-end;
}
.typing {
  min-height: 38px;
  padding: 0 15px !important;
  display: flex;
  gap: 5px;
  background: var(--assistant-bubble);
  border-radius: 4px 14px 14px 14px;
}
.typing i { background: #d8e9f1; }
.composer {
  flex-shrink: 0;
  background: #e9ded5e8;
  padding: 11px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #b7a99f16;
}
.choices { gap: 9px; padding: 0 0 5px; }
.choice {
  background: #fffaf4;
  border: 1px solid #cbbfb5;
  color: #273946;
  font-size: 14px;
  font-weight: 600;
  border-radius: 12px;
  min-height: 48px;
}
.choice::before { border-color: #7b929c; }
.choice:hover { background: #f1ece7; border-color: #91a7b1; }
#answerForm {
  border-radius: 25px;
  min-height: 55px;
  box-shadow: 0 2px 7px #513b3214;
  background: #fffdfa;
  padding: 6px 6px 6px 18px;
}
.send {
  border-radius: 50%;
  height: 43px;
  width: 43px;
  flex-basis: 43px;
  background: #193c59;
}
.send:hover { background: #285778; }
#answerInput, #answerTextarea { font-size: 15px; color: #2c353a; }
.feedback { background: #fff8f1d9; padding: 8px 10px; border-radius: 8px; color: #a23c32; }
.end-actions button { background: #fffaf4; color: #203d53; border-color: #cbbfb5; }
@media (max-width: 600px) {
  .chat { border-inline: 0; }
  .chat-header { padding: 12px 13px; gap: 10px; min-height: 76px; }
  .contact-avatar { width: 44px; height: 44px; }
  .contact-details h1 { font-size: 13px; }
  .contact-details p { font-size: 10px; }
  .header-action { width: 18px; }
  .messages { padding: 18px 15px 17px; gap: 10px; }
  .msg { max-width: 90%; }
  .msg .bubble { font-size: 14px; padding: 10px 13px; line-height: 1.52; }
  .composer { padding: 10px 12px calc(11px + env(safe-area-inset-bottom, 0px)); }
  #answerForm { min-height: 53px; }
  .choice { font-size: 13px; min-height: 47px; }
}
