/* ── Variables ── */
:root {
  --forest:     #2D5A3D;
  --sage:       #4A7C59;
  --terracotta: #B5614B;
  --cream:      #F9F5EF;
  --cream-dark: #EFE9DF;
  --gold:       #C9A84C;
  --gold-light: #E2C97E;
  --white:      #FFFFFF;
  --text-dark:  #1E3228;
  --text-mid:   #4A5E50;
  --text-light: #8A9E8F;

  --radius-card: 24px;
  --radius-bubble: 20px;
  --shadow-card: 0 20px 60px rgba(45, 90, 61, 0.12), 0 4px 16px rgba(45, 90, 61, 0.08);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Body & background ── */
body {
  font-family: 'Lato', sans-serif;
  background: var(--cream);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  overflow: hidden;
  position: relative;
}

/* Decorative blobs */
.page-bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; }

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
}

.blob-1 {
  width: 500px;
  height: 500px;
  background: var(--sage);
  top: -120px;
  left: -120px;
}

.blob-2 {
  width: 400px;
  height: 400px;
  background: var(--gold);
  bottom: -100px;
  right: -80px;
}

/* ── Wrapper ── */
.chat-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  max-width: 680px;
}

/* ── Card ── */
.chat-card {
  width: 100%;
  height: 82vh;
  background: var(--white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(201, 168, 76, 0.15);
}

/* ── Header ── */
.chat-header {
  background: linear-gradient(135deg, var(--forest) 0%, var(--sage) 100%);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.92;
}

.header-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  color: var(--cream);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.brand-name em {
  font-style: italic;
  color: var(--gold-light);
}

.brand-tagline {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(249, 245, 239, 0.7);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 0.15rem;
}

.header-dot {
  width: 10px;
  height: 10px;
  background: #6EE7B7;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(110, 231, 183, 0.3);
  animation: pulse-dot 2.5s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(110, 231, 183, 0.3); }
  50%       { box-shadow: 0 0 0 6px rgba(110, 231, 183, 0.1); }
}

/* ── Messages ── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scroll-behavior: smooth;
}

/* Scrollbar */
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--cream-dark); border-radius: 4px; }

/* Message rows */
.message {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  animation: fade-up 0.25s ease both;
}

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

.message.user {
  flex-direction: row-reverse;
}

/* Bubbles */
.bubble {
  max-width: 72%;
  padding: 0.75rem 1.1rem;
  line-height: 1.6;
  font-size: 0.95rem;
  word-break: break-word;
  font-family: 'Lato', sans-serif;
}

.message.user .bubble {
  background: linear-gradient(135deg, var(--terracotta), #C96F57);
  color: var(--white);
  border-radius: var(--radius-bubble) var(--radius-bubble) 4px var(--radius-bubble);
  box-shadow: 0 2px 12px rgba(181, 97, 75, 0.25);
}

.message.assistant .bubble {
  background: var(--cream);
  color: var(--text-dark);
  border-radius: var(--radius-bubble) var(--radius-bubble) var(--radius-bubble) 4px;
  border: 1px solid var(--cream-dark);
  box-shadow: 0 2px 8px rgba(45, 90, 61, 0.06);
}

/* Intro message slight emphasis */
.message.intro .bubble {
  background: linear-gradient(135deg, #EEF5F0, #F5EFE9);
  border-color: rgba(201, 168, 76, 0.25);
}

/* Avatar */
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--forest), var(--sage));
  color: var(--gold-light);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(45, 90, 61, 0.2);
}

/* ── Typing indicator ── */
.typing-indicator {
  display: none;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0 1.5rem 0.5rem;
  animation: fade-up 0.2s ease both;
}

.dots {
  background: var(--cream);
  border: 1px solid var(--cream-dark);
  border-radius: 20px 20px 20px 4px;
  padding: 0.65rem 1rem;
  display: flex;
  gap: 5px;
  align-items: center;
}

.dots span {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sage);
  opacity: 0.5;
  animation: bounce-dot 1.2s ease-in-out infinite;
}

.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce-dot {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40%            { transform: translateY(-5px); opacity: 1; }
}

/* ── Input area ── */
.chat-input-area {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--cream-dark);
  background: var(--white);
  flex-shrink: 0;
}

.chat-input-area input {
  flex: 1;
  border: 1.5px solid var(--cream-dark);
  border-radius: 50px;
  padding: 0.7rem 1.2rem;
  font-family: 'Lato', sans-serif;
  font-size: 0.95rem;
  color: var(--text-dark);
  background: var(--cream);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-input-area input::placeholder {
  color: var(--text-light);
  font-style: italic;
}

.chat-input-area input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.12);
  background: var(--white);
}

.chat-input-area input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.chat-input-area button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--forest), var(--sage));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  box-shadow: 0 4px 14px rgba(45, 90, 61, 0.3);
}

.chat-input-area button:hover:not(:disabled) {
  transform: scale(1.07);
  box-shadow: 0 6px 18px rgba(45, 90, 61, 0.4);
}

.chat-input-area button:active:not(:disabled) {
  transform: scale(0.96);
}

.chat-input-area button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

/* ── Footer note ── */
.footer-note {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.7rem;
  color: var(--text-light);
  letter-spacing: 0.04em;
  text-align: center;
}

.footer-note strong {
  color: var(--forest);
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .chat-card { height: 90vh; border-radius: 18px; }
  .bubble { max-width: 85%; font-size: 0.9rem; }
  .brand-name { font-size: 1.1rem; }
}
