:root {
  --bg: #0a0a0a;
  --header-bg: #141414;
  --chat-bg: #000000;
  --msg-bot: #1a1a1a;
  --msg-user: #c9a96e;
  --text: #ffffff;
  --text-muted: #a0a0a0;
  --gold: #c9a96e;
  --border: #222;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: 'DM Sans', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: fixed;
  inset: 0;
}

.chat-container {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background-color: var(--chat-bg);
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.chat-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  /* Respeita safe-area do topo (notch) */
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  background-color: var(--header-bg);
  border-bottom: 1px solid var(--border);
  z-index: 10;
  flex-shrink: 0;
}

.back-btn {
  background: none;
  border: none;
  color: var(--text);
  margin-right: 12px;
  cursor: pointer;
}

.chat-avatar {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 12px;
}

.chat-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.status-indicator {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background-color: #4CAF50;
  border-radius: 50%;
  border: 2px solid var(--header-bg);
}

.chat-info h2 {
  font-size: 16px;
  font-weight: 600;
}

.status-text {
  font-size: 12px;
  color: var(--gold);
}

.chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background-image: radial-gradient(circle at center, #111 0%, #000 100%);
}

.timestamp {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.1);
  padding: 4px 12px;
  border-radius: 12px;
  align-self: center;
  margin-bottom: 10px;
}

.msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.4;
  position: relative;
  animation: popIn 0.3s ease forwards;
  opacity: 0;
  transform: translateY(10px);
}

@keyframes popIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.msg-bot {
  align-self: flex-start;
  background-color: var(--msg-bot);
  border-bottom-left-radius: 4px;
  color: #fff;
}

.msg-user {
  align-self: flex-end;
  background-color: var(--msg-user);
  border-bottom-right-radius: 4px;
  color: #000;
  font-weight: 500;
}

.msg-image {
  padding: 4px;
  background-color: var(--msg-bot);
}

.msg-image img {
  width: 100%;
  border-radius: 14px;
  display: block;
}

.blur-preview {
  filter: blur(15px);
  transition: filter 0.3s ease;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background-color: var(--msg-bot);
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  width: fit-content;
}

.dot {
  width: 6px;
  height: 6px;
  background-color: var(--text-muted);
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

.chat-input-area {
  padding: 12px 16px;
  /* Respeita a safe-area do iPhone/Android (home bar, gestos) */
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  background-color: var(--header-bg);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 4px;
}

.reply-chip {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  max-width: 100%;
}

.reply-chip:hover {
  background: var(--gold);
  color: #000;
}

.input-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.input-fake {
  flex: 1;
  background-color: #222;
  border-radius: 20px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-muted);
}

.send-btn {
  background-color: var(--gold);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  cursor: pointer;
  transition: transform 0.2s;
}

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

.cta-checkout {
  display: block;
  text-align: center;
  background: linear-gradient(45deg, #c9a96e, #e0c38c);
  color: #000;
  text-decoration: none;
  padding: 14px;
  border-radius: 12px;
  font-weight: 700;
  margin-top: 10px;
  transition: transform 0.2s;
}

.cta-checkout:active { transform: scale(0.97); }

.cta-guarantee {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

@keyframes heartbeat {
  0%   { transform: scale(1); }
  10%  { transform: scale(1.03); }
  20%  { transform: scale(1); }
}
