/* =========================================================
   FROSTPULSE WEBSITE CHATBOT
   ========================================================= */

.fp-chatbot,
.fp-chatbot * {
  box-sizing: border-box;
}

.fp-chatbot {
  --fp-chat-navy: #0d2235;
  --fp-chat-blue: #008bc4;
  --fp-chat-blue-dark: #006f9c;
  --fp-chat-text: #11283a;
  --fp-chat-muted: #63788a;
  --fp-chat-line: #d9e4eb;
  --fp-chat-soft: #f4f8fb;
  --fp-chat-white: #ffffff;

  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

/* Floating launch button */
.fp-chat-launcher {
  width: 62px;
  height: 62px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--fp-chat-blue);
  color: var(--fp-chat-white);
  cursor: pointer;
  box-shadow: 0 14px 36px rgba(13, 34, 53, 0.24);
  display: grid;
  place-items: center;
  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

.fp-chat-launcher:hover {
  background: var(--fp-chat-blue-dark);
  transform: translateY(-2px);
}

.fp-chat-launcher svg {
  width: 29px;
  height: 29px;
}

/* Main chat window */
.fp-chat-window {
  position: absolute;
  right: 0;
  bottom: 76px;
  width: min(390px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 130px));
  display: none;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  background: var(--fp-chat-white);
  border: 1px solid var(--fp-chat-line);
  border-radius: 20px;
  box-shadow: 0 22px 60px rgba(13, 34, 53, 0.2);
}

.fp-chat-window.is-open {
  display: grid;
}

/* Header */
.fp-chat-header {
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(
    145deg,
    var(--fp-chat-navy),
    #173a55
  );
  color: var(--fp-chat-white);
}

.fp-chat-logo {
  width: 42px;
  height: 42px;
  padding: 7px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--fp-chat-white);
  border-radius: 12px;
}

.fp-chat-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.fp-chat-heading {
  flex: 1;
  min-width: 0;
}

.fp-chat-heading strong {
  display: block;
  margin-bottom: 2px;
  font-size: 15px;
}

.fp-chat-heading span {
  display: block;
  color: #c9dce6;
  font-size: 12px;
}

.fp-chat-close {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--fp-chat-white);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.fp-chat-close:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* Message area */
.fp-chat-messages {
  min-height: 0;
  padding: 18px;
  overflow-y: auto;
  background:
    linear-gradient(
      180deg,
      #f8fbfd 0%,
      var(--fp-chat-white) 100%
    );
}

.fp-chat-message {
  max-width: 86%;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-line;
}

.fp-chat-message.bot {
  margin-right: auto;
  background: var(--fp-chat-soft);
  color: var(--fp-chat-text);
  border-bottom-left-radius: 4px;
}

.fp-chat-message.user {
  margin-left: auto;
  background: var(--fp-chat-blue);
  color: var(--fp-chat-white);
  border-bottom-right-radius: 4px;
}

.fp-chat-message a {
  color: var(--fp-chat-blue-dark);
  font-weight: 800;
  text-decoration: underline;
}

.fp-chat-message.user a {
  color: var(--fp-chat-white);
}

/* Quick reply buttons */
.fp-chat-quick-replies {
  display: grid;
  gap: 8px;
  margin: 4px 0 16px;
}

.fp-chat-quick-reply {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--fp-chat-line);
  border-radius: 11px;
  background: var(--fp-chat-white);
  color: var(--fp-chat-text);
  text-align: left;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}

.fp-chat-quick-reply:hover {
  border-color: var(--fp-chat-blue);
  background: #f2fbfe;
}

/* Input area */
.fp-chat-input-area {
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
  background: var(--fp-chat-white);
  border-top: 1px solid var(--fp-chat-line);
}

.fp-chat-input {
  width: 100%;
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid var(--fp-chat-line);
  border-radius: 12px;
  color: var(--fp-chat-text);
  background: var(--fp-chat-white);
  font-size: 14px;
}

.fp-chat-input:focus {
  outline: 3px solid rgba(0, 139, 196, 0.11);
  border-color: var(--fp-chat-blue);
}

.fp-chat-send {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--fp-chat-blue);
  color: var(--fp-chat-white);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.fp-chat-send:hover {
  background: var(--fp-chat-blue-dark);
}

.fp-chat-send svg {
  width: 21px;
  height: 21px;
}

/* Mobile */
@media (max-width: 600px) {
  .fp-chatbot {
    right: 14px;
    bottom: 14px;
  }

  .fp-chat-window {
    position: fixed;
    inset: 10px;
    width: auto;
    height: auto;
    max-height: none;
    border-radius: 18px;
  }

  .fp-chat-launcher {
    width: 58px;
    height: 58px;
  }
}