﻿:root {
  --sky: #9ec9e7;
  --sky-dark: #7fb3da;
  --cream: #f7f4ef;
  --ink: #2b2b2b;
  --muted: #5f6b72;
  --white: #ffffff;
  --accent: #2f5d86;
  --accent-soft: #d9ecf8;
  --user-bubble: #e9f5ff;
  --bot-bubble: #ffffff;
  --border: rgba(47, 93, 134, 0.18);
  --shadow: 0 16px 40px rgba(28, 60, 84, 0.18);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --transition: 0.2s ease;
}

.lpf-chat,
.lpf-chat * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.lpf-chat {
  font-family: "Montserrat", sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, #f8fbff 0%, #f1f6fb 40%, #eaf2f8 100%);
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px 40px;
  position: relative;
  overflow: hidden;
}

.lpf-chat--embed {
  min-height: auto;
  padding: 0;
  background: transparent;
  display: block;
}

.lpf-chat::before,
.lpf-chat::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  opacity: 0.5;
  z-index: 0;
}

.lpf-chat::before {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle at top, #d6e9f7 0%, transparent 70%);
  top: -120px;
  right: -120px;
}

.lpf-chat::after {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle at bottom, #dfeef9 0%, transparent 70%);
  bottom: -140px;
  left: -120px;
}

.lpf-chat.lpf-chat--embed::before,
.lpf-chat.lpf-chat--embed::after {
  display: none;
}

.chat-shell {
  width: min(960px, 100%);
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid rgba(127, 179, 218, 0.2);
  backdrop-filter: blur(8px);
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  gap: 16px;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--sky) 0%, #c8e3f7 100%);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  text-transform: uppercase;
  border: 2px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 8px 20px rgba(44, 86, 120, 0.2);
}

.brand-title {
  font-family: "Playfair Display", serif;
  font-size: 1.4rem;
  font-weight: 600;
}

.brand-subtitle {
  font-size: 0.9rem;
  color: var(--muted);
}

.header-actions {
  display: flex;
  gap: 8px;
}

.tour-prompt {
  background: linear-gradient(180deg, #f9fcff 0%, #eff6fc 100%);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  border: 1px solid rgba(127, 179, 218, 0.35);
  box-shadow: 0 6px 16px rgba(47, 93, 134, 0.08);
  display: grid;
  gap: 10px;
}

.tour-question {
  font-family: "Playfair Display", serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
}

.tour-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tour-btn {
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  min-height: 34px;
}

.tour-btn--primary {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: var(--white);
}

.tour-btn--primary:hover {
  background: #244a6c;
}

.tour-btn--secondary {
  background: var(--accent-soft);
  border: 1px solid rgba(47, 93, 134, 0.3);
  color: var(--accent);
}

.tour-btn--secondary:hover {
  background: #cfe3f4;
}

.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--accent);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.ghost:hover {
  background: var(--accent-soft);
}

.chat-body {
  background: linear-gradient(180deg, #f7fbff 0%, #f2f7fb 100%);
  border-radius: var(--radius-md);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 360px;
  max-height: 520px;
  overflow-y: auto;
  border: 1px solid rgba(127, 179, 218, 0.2);
}

.day-separator {
  align-self: center;
  font-size: 0.8rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.9);
  padding: 4px 14px;
  border-radius: 999px;
  border: 1px solid rgba(127, 179, 218, 0.2);
}

.message {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.message .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--sky);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.8rem;
  display: grid;
  place-items: center;
  text-transform: uppercase;
  flex-shrink: 0;
}

.message .bubble {
  background: var(--bot-bubble);
  padding: 14px 16px;
  border-radius: 16px 16px 16px 4px;
  max-width: 68%;
  box-shadow: 0 10px 18px rgba(28, 60, 84, 0.08);
  border: 1px solid rgba(127, 179, 218, 0.2);
  position: relative;
}

.message .bubble p {
  line-height: 1.5;
  font-size: 0.95rem;
}

.message .meta {
  display: block;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--muted);
}

.message.user {
  justify-content: flex-end;
}

.message.user .avatar {
  order: 2;
  background: #f6e9d8;
  color: #8a6b3e;
}

.message.user .bubble {
  background: var(--user-bubble);
  border-radius: 16px 16px 4px 16px;
  border: 1px solid rgba(127, 179, 218, 0.25);
}

.quick-replies {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid rgba(127, 179, 218, 0.35);
  background: var(--white);
  color: var(--accent);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.chip:hover {
  background: var(--accent-soft);
}

.chat-input {
  display: grid;
  gap: 8px;
}

.input-label {
  font-size: 0.85rem;
  color: var(--muted);
}

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

.input-row input {
  flex: 1;
  border-radius: 999px;
  border: 1px solid rgba(127, 179, 218, 0.4);
  padding: 14px 18px;
  font-size: 0.95rem;
  font-family: "Montserrat", sans-serif;
  outline: none;
  transition: var(--transition);
  background: var(--white);
}

.input-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(127, 179, 218, 0.2);
}

.send {
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: 999px;
  padding: 0 22px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  min-width: 110px;
}

.send:hover {
  background: #244a6c;
}

.input-hint {
  font-size: 0.78rem;
  color: var(--muted);
}

.typing {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sky-dark);
  animation: pulse 1s infinite ease-in-out;
}

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

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

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

@media (max-width: 760px) {
  .chat-shell {
    padding: 18px;
  }

  .chat-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .tour-prompt {
    padding: 14px;
  }

  .tour-options {
    grid-template-columns: 1fr;
  }

  .message .bubble {
    max-width: 88%;
  }

  .input-row {
    flex-direction: column;
  }

  .send {
    width: 100%;
    padding: 12px 0;
  }
}
