:root {
  --chat-bg: #ffffff;
  --chat-text: #1e1e1e;
  --chat-muted: #6f6f79;
  --chat-accent: #c9a24d;
  --chat-accent-dark: #b58f3e;
  --chat-border: rgba(0, 0, 0, 0.12);
  --chat-shadow: 0 20px 42px rgba(0, 0, 0, 0.2);
}

.lang-switcher {
  display: inline-flex;
  gap: 6px;
  margin-left: 12px;
}

.lang-switcher button {
  border: 1px solid rgba(0, 0, 0, 0.16);
  background: #ffffff;
  color: #1e1e1e;
  border-radius: 8px;
  min-width: 42px;
  height: 34px;
  padding: 0 10px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.lang-switcher button.active {
  background: #1e1e1e;
  color: #ffffff;
  border-color: #1e1e1e;
}

.chatbot-launcher {
  display: none;
}

.chatbot-launcher:hover {
  background: var(--chat-accent-dark);
}

.chatbot-panel {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 20px;
  width: min(1080px, calc(100vw - 24px));
  min-height: 172px;
  max-height: min(72vh, 620px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(201, 162, 77, 0.35);
  border-radius: 24px;
  background: linear-gradient(165deg, #fffdf7 0%, #f7f3e8 100%);
  box-shadow: var(--chat-shadow);
  overflow: hidden;
  z-index: 1200;
}

.chatbot-panel.open {
  display: flex;
}

.chatbot-panel.chatbot-hidden {
  display: none !important;
}

.chatbot-header {
  background: linear-gradient(110deg, #1f1a12, #4f3b1f);
  color: #f5e9ca;
  padding: 14px 18px;
  display: flex;
  justify-content: flex-start;
  align-items: baseline;
  gap: 12px;
}

.chatbot-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
}

.chatbot-close {
  display: none;
}

.chatbot-messages {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.78);
  flex: 1;
  min-height: 86px;
}

.chatbot-message {
  max-width: 92%;
  border-radius: 12px;
  padding: 10px 13px;
  font-size: 0.95rem;
  line-height: 1.4;
  white-space: pre-wrap;
}

.chatbot-message.bot {
  align-self: flex-start;
  background: #ffffff;
  border: 1px solid var(--chat-border);
  color: var(--chat-text);
}

.chatbot-message.user {
  align-self: flex-end;
  background: var(--chat-accent);
  color: #ffffff;
}

.chatbot-message.state {
  align-self: center;
  color: var(--chat-muted);
  font-size: 0.85rem;
  padding: 0;
}

.chatbot-form {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding: 14px;
  background: #fffcf2;
}

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

.chatbot-input {
  flex: 1;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 14px;
  padding: 16px 18px;
  font: inherit;
  font-size: 1rem;
  min-height: 58px;
  background: #ffffff;
}

.chatbot-send {
  border: 0;
  border-radius: 14px;
  padding: 0 20px;
  min-height: 58px;
  background: var(--chat-accent);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.chatbot-send:hover {
  background: var(--chat-accent-dark);
}

.chatbot-send:disabled,
.chatbot-input:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.chatbot-footnote {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--chat-muted);
}

@media (max-width: 640px) {
  .chatbot-panel {
    left: 12px;
    transform: none;
    bottom: 10px;
    width: calc(100vw - 24px);
    min-height: 156px;
    max-height: min(74vh, 620px);
  }

  .chatbot-launcher {
    right: 12px;
    bottom: 12px;
  }

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

  .chatbot-send {
    width: 100%;
  }
}

.lead-popup {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1300;
}

.lead-popup.open {
  display: flex;
}

.lead-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.lead-popup-card {
  position: relative;
  z-index: 1;
  width: min(640px, calc(100vw - 24px));
  background: #fffdf9;
  border-radius: 18px;
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.28);
  padding: 34px 28px;
  text-align: center;
}

.lead-popup-close {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.07);
  color: #1e1e1e;
  font-size: 22px;
  cursor: pointer;
}

.lead-step h2 {
  font-family: "Playfair Display", serif;
  font-size: clamp(1.8rem, 3vw, 3.2rem);
  color: #212844;
}

.lead-step p {
  color: #6f5a4c;
  margin: 12px auto 0;
  max-width: 460px;
  font-size: 1.05rem;
}

#lead-form {
  margin-top: 18px;
}

#lead-email {
  width: min(460px, 100%);
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 12px;
  padding: 13px 14px;
  font: inherit;
}

.lead-error {
  color: #b23a2a;
  margin-top: 8px;
  font-size: 0.9rem;
}

.lead-popup-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .lead-popup-card {
    padding: 24px 16px;
  }

  .lead-step h2 {
    font-size: 2rem;
  }
}
