:root {
  --navy-deep: #1D2C4D;
  --navy-dark: #16213F;
  --bg-warm: #FBFBF8;
  --bg-warm-2: #F2F1EA;
  --accent: #4FA8D8;
  --accent-strong: #3690C2;

  /* tema escuro fixo, independente da preferência do sistema/navegador */
  color-scheme: dark;

  --bg: #10182C;
  --bg-panel: #16213F;
  --bg-input-area: #131C31;
  --text-primary: #F2F1EA;
  --text-on-accent: #0E1626;
  --bot-bubble-bg: #1D2C4D;
  --bot-bubble-text: #F2F1EA;
  --bot-bubble-border: #2A3B63;
  --user-bubble-bg: var(--accent);
  --user-bubble-text: #0E1626;
  --option-bg: #1D2C4D;
  --option-border: #2A3B63;
  --option-text: #F2F1EA;
  --option-hover-bg: #223a5c;
  --option-hover-border: var(--accent);
  --track-bg: #223a5c;
  --typing-dot: #6E7A96;
  --review-bg: #1D2C4D;
  --review-border: #2A3B63;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text-primary);
}

body {
  font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  overflow: hidden;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 640px;
  margin: 0 auto;
  background: var(--bg);
}

.topbar {
  flex-shrink: 0;
  padding: 14px 16px 10px;
  background: var(--bg);
}

.progress-track {
  height: 4px;
  border-radius: 4px;
  background: var(--track-bg);
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  border-radius: 4px;
  transition: width 0.5s ease;
}

.brand {
  font-family: 'Fraunces', serif;
  font-size: 18px;
  letter-spacing: 0.2px;
}

.brand-mark { color: var(--accent); font-weight: 600; }
.brand-mark-2 { color: var(--text-primary); font-weight: 400; opacity: 0.85; }

.chat-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px 16px;
  -webkit-overflow-scrolling: touch;
}

.chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 8px;
}

.bubble-row {
  display: flex;
  width: 100%;
  animation: rise 0.35s ease both;
}

.bubble-row.bot { justify-content: flex-start; }
.bubble-row.user { justify-content: flex-end; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.bubble {
  max-width: 82%;
  padding: 12px 15px;
  border-radius: 18px;
  font-size: 15.5px;
  line-height: 1.45;
  word-wrap: break-word;
}

.bubble.bot {
  background: var(--bot-bubble-bg);
  color: var(--bot-bubble-text);
  border: 1px solid var(--bot-bubble-border);
  border-bottom-left-radius: 6px;
}

.bubble.user {
  background: var(--user-bubble-bg);
  color: var(--user-bubble-text);
  border-bottom-right-radius: 6px;
}

.typing-row { display: flex; justify-content: flex-start; }

.typing-bubble {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bot-bubble-bg);
  border: 1px solid var(--bot-bubble-border);
  padding: 13px 16px;
  border-radius: 18px;
  border-bottom-left-radius: 6px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--typing-dot);
  animation: bounce 1.1s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.controls {
  flex-shrink: 0;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  background: var(--bg-input-area);
  border-top: 1px solid var(--bot-bubble-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 13px 16px;
  border-radius: 14px;
  border: 1.5px solid var(--option-border);
  background: var(--option-bg);
  color: var(--option-text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
  animation: rise 0.3s ease both;
}

.option-btn:hover {
  border-color: var(--option-hover-border);
  background: var(--option-hover-bg);
}

.option-btn:active {
  transform: scale(0.98);
}

.text-input-row {
  display: flex;
  gap: 8px;
}

.text-input-row input {
  flex: 1;
  padding: 13px 16px;
  border-radius: 14px;
  border: 1.5px solid var(--option-border);
  background: var(--option-bg);
  color: var(--option-text);
  font-family: inherit;
  font-size: 15px;
  outline: none;
}

.text-input-row input:focus {
  border-color: var(--accent);
}

.send-btn {
  padding: 13px 20px;
  border-radius: 14px;
  border: none;
  background: var(--accent);
  color: var(--text-on-accent);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.send-btn:hover { background: var(--accent-strong); }
.send-btn:active { transform: scale(0.97); }
.send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.review-box {
  background: var(--review-bg);
  border: 1.5px solid var(--review-border);
  border-radius: 16px;
  padding: 16px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-primary);
  margin-top: 4px;
  animation: rise 0.35s ease both;
}

.review-label {
  font-family: 'Fraunces', serif;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-strong);
  margin-bottom: 8px;
  font-weight: 600;
}

.whatsapp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 20px;
  border-radius: 14px;
  border: none;
  background: var(--accent);
  color: var(--text-on-accent);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  box-shadow: 0 6px 20px rgba(79, 168, 216, 0.35);
}

.whatsapp-btn:hover { background: var(--accent-strong); }
.whatsapp-btn:active { transform: scale(0.98); }

.hint-title {
  font-family: 'Fraunces', serif;
  font-weight: 600;
}

@media (max-width: 380px) {
  .bubble { font-size: 15px; padding: 11px 14px; }
  .option-btn { font-size: 14.5px; padding: 12px 14px; }
}
