/* ==========================================================================
   Crossover Marketing Solutions — Ultra-Premium AI Concierge Widget
   Design System: Midnight Obsidian (#0B1220) + Crisp Alabaster + Warm Orange Accent (#FF6B2C)
   ========================================================================== */

/* Shift existing back-to-top button slightly upward so it never overlaps the bot */
.back-to-top {
  bottom: 96px !important;
  right: 28px !important;
}

#cms-ai-bot-root,
#cms-ai-bot-root * {
  box-sizing: border-box;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

#cms-ai-bot-root {
  position: fixed;
  right: 24px;
  bottom: 22px;
  z-index: 10050;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
}

#cms-ai-bot-root > * {
  pointer-events: auto;
}

/* ---------- Proactive Greeting Nudge Bubble ---------- */
.cms-bot-nudge {
  position: absolute;
  right: 0;
  bottom: 70px;
  width: 284px;
  max-width: calc(100vw - 40px);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(15, 23, 42, 0.09);
  border-radius: 18px 18px 4px 18px;
  padding: 13px 34px 13px 15px;
  box-shadow:
    0 20px 40px -12px rgba(11, 18, 32, 0.2),
    0 2px 6px rgba(11, 18, 32, 0.06);
  color: #0f172a;
  cursor: pointer;
  transform-origin: bottom right;
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.35s;
}

.cms-bot-nudge.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
  pointer-events: auto;
}

.cms-bot-nudge:hover {
  border-color: rgba(255, 107, 44, 0.45);
  transform: translateY(-2px);
}

.cms-bot-nudge-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ff6b2c;
  margin-bottom: 4px;
}

.cms-bot-nudge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.22);
}

.cms-bot-nudge-text {
  font-size: 13px;
  line-height: 1.45;
  color: #1e293b;
  font-weight: 500;
  margin: 0;
}

.cms-bot-nudge-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.06);
  color: #64748b;
  font-size: 13px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.cms-bot-nudge-close:hover {
  background: rgba(15, 23, 42, 0.12);
  color: #0f172a;
}

/* ---------- Floating Launcher Button (Midnight Obsidian + Orange Accent) ---------- */
.cms-bot-launcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  height: 56px;
  padding: 5px 19px 5px 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(135deg, #0b1220 0%, #162033 100%);
  color: #ffffff;
  cursor: pointer;
  box-shadow:
    0 18px 38px -10px rgba(11, 18, 32, 0.55),
    0 6px 16px -4px rgba(255, 107, 44, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.28s ease,
    border-color 0.28s ease;
  outline: none;
}

.cms-bot-launcher::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 107, 44, 0.55), rgba(15, 23, 42, 0.1));
  z-index: -1;
  opacity: 0.65;
  animation: cmsBotPulseRing 3.2s ease-in-out infinite;
}

.cms-bot-launcher:hover {
  transform: translateY(-2px) scale(1.015);
  border-color: rgba(255, 107, 44, 0.5);
  box-shadow:
    0 22px 44px -10px rgba(11, 18, 32, 0.65),
    0 8px 22px -4px rgba(255, 107, 44, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.cms-bot-launcher:active {
  transform: translateY(0) scale(0.99);
}

.cms-bot-launcher.is-open {
  padding: 0;
  width: 52px;
  height: 52px;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-color: rgba(255, 255, 255, 0.16);
}

.cms-bot-launcher.is-open:hover {
  background: linear-gradient(135deg, #ff6b2c 0%, #f97316 100%);
  border-color: transparent;
}

.cms-bot-launcher.is-open::before {
  animation: none;
  opacity: 0;
}

.cms-bot-launcher-avatar {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #ff6b2c;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(255, 107, 44, 0.25);
}

.cms-bot-launcher-avatar img {
  width: 25px;
  height: 25px;
  object-fit: contain;
  display: block;
}

.cms-bot-launcher-status {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #0b1220;
}

.cms-bot-launcher-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  line-height: 1.2;
}

.cms-bot-launcher-title {
  font-family: "Outfit", "Inter", sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.01em;
}

.cms-bot-launcher-sub {
  font-size: 11px;
  font-weight: 500;
  color: #ffb088;
  margin-top: 2px;
}

.cms-bot-launcher.is-open .cms-bot-launcher-avatar,
.cms-bot-launcher.is-open .cms-bot-launcher-label {
  display: none;
}

.cms-bot-launcher-close-icon {
  display: none;
  width: 21px;
  height: 21px;
  color: #ffffff;
}

.cms-bot-launcher.is-open .cms-bot-launcher-close-icon {
  display: block;
}

@keyframes cmsBotPulseRing {
  0%, 100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.055);
    opacity: 0.12;
  }
}

/* ---------- Main Chat Window ---------- */
.cms-bot-window {
  width: 382px;
  max-width: calc(100vw - 32px);
  height: 528px;
  max-height: calc(100vh - 116px);
  margin-bottom: 12px;
  border-radius: 22px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow:
    0 28px 64px -16px rgba(11, 18, 32, 0.34),
    0 8px 20px -6px rgba(11, 18, 32, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  opacity: 0;
  transform: translateY(14px) scale(0.95);
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.26s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.26s;
}

.cms-bot-window.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
  pointer-events: auto;
}

/* ---------- Chat Header (Midnight Luxury + Warm Orange Aurora) ---------- */
.cms-bot-header {
  position: relative;
  padding: 15px 16px;
  background: linear-gradient(135deg, #0b1220 0%, #131e32 62%, #1d283a 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  overflow: hidden;
}

.cms-bot-header::before {
  content: "";
  position: absolute;
  top: -45px;
  left: -30px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 107, 44, 0.28) 0%, transparent 70%);
  pointer-events: none;
}

.cms-bot-header::after {
  content: "";
  position: absolute;
  bottom: -55px;
  right: -25px;
  width: 165px;
  height: 165px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 138, 76, 0.22) 0%, transparent 70%);
  pointer-events: none;
}

.cms-bot-header-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.cms-bot-header-avatar {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.28),
    0 0 0 1.5px rgba(255, 107, 44, 0.65);
}

.cms-bot-header-avatar img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.cms-bot-header-avatar .cms-bot-online-dot {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #0b1220;
}

.cms-bot-header-info {
  min-width: 0;
}

.cms-bot-header-title {
  font-family: "Outfit", "Inter", sans-serif;
  font-size: 15.5px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 7px;
  letter-spacing: -0.01em;
}

.cms-bot-ai-pill {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff6b2c 0%, #ff8c42 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(255, 107, 44, 0.4);
}

.cms-bot-header-sub {
  font-size: 11.75px;
  color: #94a3b8;
  margin: 3px 0 0;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cms-bot-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 1;
}

.cms-bot-icon-btn {
  width: 31px;
  height: 31px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.cms-bot-icon-btn:hover {
  background: rgba(255, 107, 44, 0.2);
  border-color: rgba(255, 107, 44, 0.45);
  color: #ffffff;
}

.cms-bot-icon-btn svg {
  width: 15px;
  height: 15px;
}

/* ---------- Progress Bar ---------- */
.cms-bot-progress-track {
  width: 100%;
  height: 2.5px;
  background: #f1f5f9;
  flex-shrink: 0;
  overflow: hidden;
}

.cms-bot-progress-fill {
  height: 100%;
  width: 12%;
  background: linear-gradient(90deg, #ff6b2c 0%, #ff9248 100%);
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Messages Feed ---------- */
.cms-bot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 15px 15px 10px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

.cms-bot-messages::-webkit-scrollbar {
  width: 4px;
}

.cms-bot-messages::-webkit-scrollbar-track {
  background: transparent;
}

.cms-bot-messages::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.14);
  border-radius: 999px;
}

.cms-bot-msg-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  animation: cmsBotFadeUp 0.26s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.cms-bot-msg-row.is-user {
  justify-content: flex-end;
}

.cms-bot-msg-row.is-bot {
  justify-content: flex-start;
}

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

.cms-bot-mini-avatar {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.cms-bot-mini-avatar img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.cms-bot-bubble {
  max-width: 84%;
  padding: 10px 13px;
  font-size: 13.25px;
  line-height: 1.5;
  word-wrap: break-word;
}

.cms-bot-msg-row.is-bot .cms-bot-bubble {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 16px 16px 16px 4px;
  box-shadow: 0 2px 10px -2px rgba(15, 23, 42, 0.06);
}

.cms-bot-msg-row.is-user .cms-bot-bubble {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  border-radius: 16px 16px 4px 16px;
  box-shadow: 0 6px 16px -6px rgba(15, 23, 42, 0.35);
}

.cms-bot-bubble strong {
  font-weight: 600;
  color: #0f172a;
}

.cms-bot-msg-row.is-user .cms-bot-bubble strong {
  color: #ffffff;
}

.cms-bot-bubble a {
  color: #ff6b2c;
  text-decoration: underline;
  font-weight: 500;
}

.cms-bot-msg-row.is-user .cms-bot-bubble a {
  color: #ffb088;
}

.cms-bot-time {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 4px;
  display: block;
}

.cms-bot-msg-row.is-user .cms-bot-time {
  text-align: right;
  color: rgba(255, 255, 255, 0.62);
}

/* ---------- Typing Indicator ---------- */
.cms-bot-typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 11px 14px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 16px 16px 16px 4px;
  box-shadow: 0 2px 10px -2px rgba(15, 23, 42, 0.06);
}

.cms-bot-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff6b2c;
  opacity: 0.4;
  animation: cmsBotTypingBounce 1.2s infinite ease-in-out;
}

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

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

@keyframes cmsBotTypingBounce {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.35;
  }
  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

/* ---------- Quick Reply Chips ---------- */
.cms-bot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 0 4px 34px;
  animation: cmsBotFadeUp 0.26s ease forwards;
}

.cms-bot-chip {
  padding: 6.5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.13);
  background: #ffffff;
  color: #0f172a;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s,
    border-color 0.2s,
    transform 0.18s,
    box-shadow 0.2s;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.cms-bot-chip:hover {
  background: linear-gradient(135deg, #ff6b2c 0%, #ff8547 100%);
  color: #ffffff;
  border-color: transparent;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px -4px rgba(255, 107, 44, 0.42);
}

/* ---------- Lead Summary Card ---------- */
.cms-bot-summary-card {
  margin-top: 8px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 13px;
  padding: 11px 12px;
  font-size: 12.25px;
  color: #1e293b;
}

.cms-bot-summary-title {
  font-family: "Outfit", "Inter", sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cms-bot-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(15, 23, 42, 0.1);
}

.cms-bot-summary-row:last-child {
  border-bottom: none;
}

.cms-bot-summary-key {
  color: #64748b;
  font-weight: 500;
  flex-shrink: 0;
}

.cms-bot-summary-val {
  color: #0f172a;
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}

.cms-bot-email-status {
  margin-top: 9px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 11.75px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
}

.cms-bot-email-status.is-sending {
  background: rgba(255, 107, 44, 0.1);
  color: #c2410c;
}

.cms-bot-email-status.is-sent {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.cms-bot-email-status.is-fallback {
  background: rgba(255, 107, 44, 0.1);
  color: #9a3412;
  flex-direction: column;
  align-items: flex-start;
}

.cms-bot-mailto-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff !important;
  text-decoration: none !important;
  font-size: 11.75px;
  font-weight: 600;
  transition: background 0.2s;
}

.cms-bot-mailto-btn:hover {
  background: linear-gradient(135deg, #ff6b2c 0%, #f97316 100%);
}

/* ---------- Input Composer ---------- */
.cms-bot-composer {
  padding: 10px 13px 9px;
  background: #ffffff;
  border-top: 1px solid rgba(15, 23, 42, 0.07);
  flex-shrink: 0;
}

.cms-bot-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1.5px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  padding: 4px 5px 4px 13px;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.cms-bot-input-wrap:focus-within {
  background: #ffffff;
  border-color: #ff6b2c;
  box-shadow: 0 0 0 3px rgba(255, 107, 44, 0.14);
}

#cms-ai-bot-root .cms-bot-input {
  flex: 1;
  border: none !important;
  background: transparent !important;
  color: #0f172a !important;
  font-size: 13.25px !important;
  line-height: 1.4 !important;
  padding: 7px 0 !important;
  outline: none !important;
  min-width: 0;
}

#cms-ai-bot-root .cms-bot-input::placeholder {
  color: #94a3b8 !important;
  opacity: 1;
}

.cms-bot-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  border: none;
  background: linear-gradient(135deg, #ff6b2c 0%, #ff8547 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.18s, box-shadow 0.2s, opacity 0.2s;
  box-shadow: 0 4px 12px rgba(255, 107, 44, 0.34);
}

.cms-bot-send-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(255, 107, 44, 0.46);
}

.cms-bot-send-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.cms-bot-send-btn svg {
  width: 16px;
  height: 16px;
}

.cms-bot-footer-note {
  margin-top: 7px;
  text-align: center;
  font-size: 10.5px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.cms-bot-footer-note span {
  color: #0f172a;
  font-weight: 600;
}

/* ---------- Mobile Responsive ---------- */
@media (max-width: 520px) {
  #cms-ai-bot-root {
    right: 14px;
    bottom: 14px;
  }

  .back-to-top {
    bottom: 84px !important;
    right: 16px !important;
  }

  .cms-bot-window {
    width: calc(100vw - 28px);
    height: min(510px, calc(100vh - 96px));
    border-radius: 20px;
  }

  .cms-bot-launcher {
    height: 52px;
    padding: 4px 16px 4px 5px;
  }

  .cms-bot-launcher.is-open {
    width: 50px;
    height: 50px;
  }

  .cms-bot-launcher-avatar {
    width: 40px;
    height: 40px;
  }

  .cms-bot-launcher-title {
    font-size: 13.5px;
  }
}

/* SEO Semantic H1 parity in inner page breadcrumb headings */
.page-heading h1 {
  color: #fff;
  font-size: 48px;
  font-weight: 600;
  text-transform: capitalize;
  margin-bottom: 0;
}
@media (max-width: 575px) {
  .page-heading h1 {
    font-size: 40px;
  }
  .breadcrumb-section .page-heading h1 {
    font-size: 28px !important;
    line-height: 1.22;
  }
}
