:root {
  --brand: #2b7de9;
  --brand-dark: #1d4f94;
  --bg: #f5f8ff; /* mesma cor de fundo do logo.png, para ele se fundir à página */
  --text: #1b2a41;
  --muted: #5f6f86;
  --bot-bubble: #eef3fb;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px;
}

header { text-align: center; margin-bottom: 14px; }
header img { width: 180px; max-width: 60vw; height: auto; display: block; margin: 0 auto 4px; }
header h1 { font-size: 1.25rem; margin: 0 0 4px; color: var(--brand-dark); }
header p { margin: 0; font-size: .95rem; color: var(--muted); }
footer { margin-top: 12px; font-size: .75rem; color: var(--muted); }

.chat {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 780px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(29, 79, 148, .12);
  overflow: hidden;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  line-height: 1.45;
  font-size: .97rem;
  overflow-wrap: anywhere;
}
.msg.bot { align-self: flex-start; background: var(--bot-bubble); border-bottom-left-radius: 4px; }
.msg.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg.error { align-self: flex-start; background: #fff3f3; color: #8a1f1f; border: 1px solid #f3b4b4; }
.msg a { color: inherit; text-decoration: underline; }
.msg ul { margin: 6px 0; padding-left: 20px; }
.msg p { margin: 0; }
.msg p + p, .msg p + ul, .msg ul + p { margin-top: 8px; }

.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted); opacity: .5;
  animation: blink 1.2s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.composer {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e6ecf5;
}
.composer input {
  flex: 1;
  min-width: 0;
  border: 1px solid #d5deec;
  border-radius: 22px;
  padding: 11px 16px;
  font: inherit;
  outline: none;
}
.composer input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(43, 125, 233, .15); }
.composer button {
  flex: none;
  width: 44px; height: 44px;
  border: 0; border-radius: 50%;
  background: var(--brand); color: #fff;
  cursor: pointer;
  display: grid; place-items: center;
}
.composer button:hover { background: var(--brand-dark); }
.composer button:disabled { opacity: .5; cursor: default; }

[hidden] { display: none !important; }

body.center { justify-content: center; }
.landing-logo { width: 220px; max-width: 70vw; }

.chat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #e6ecf5;
}
.chat-name { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--brand-dark); min-width: 0; }
.chat-name .dot { width: 9px; height: 9px; border-radius: 50%; background: #2fb86b; flex: none; }
.reset {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid #d5deec; background: #fff; color: var(--muted);
  border-radius: 18px; padding: 6px 12px;
  font: inherit; font-size: .82rem; cursor: pointer;
  flex: none;
}
.reset:hover { color: var(--brand-dark); border-color: var(--brand); }
