@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700;800&display=swap");

.mgf-hybrid-chatbot {
  --mgf-chat-deep: #294b8f;
  --mgf-chat-deep-soft: #365aa3;
  --mgf-chat-cyan: #18b5e3;
  --mgf-chat-paper: #edf4fb;
  --mgf-chat-line: #d5e1ef;
  --mgf-chat-copy: #5e7391;
  --mgf-chat-card: #ffffff;
  --mgf-chat-shadow: rgba(25, 64, 126, 0.16);
  font-family: "Montserrat", "Segoe UI", sans-serif;
}

.mgf-hybrid-chatbot *,
.mgf-hybrid-chatbot *::before,
.mgf-hybrid-chatbot *::after {
  box-sizing: border-box;
}

.mgf-hybrid-chatbot [hidden] {
  display: none !important;
}

.mgf-hybrid-chatbot--floating {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 999999;
  width: min(calc(100vw - 32px), 390px);
}

.mgf-hybrid-chatbot--embedded {
  width: min(100%, 420px);
}

.mgf-hybrid-chatbot__launcher {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 58px;
  padding: 0.95rem 1.3rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--mgf-chat-deep), var(--mgf-chat-cyan));
  color: #ffffff;
  font: inherit;
  font-size: 0.96rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 18px 34px var(--mgf-chat-shadow);
}

.mgf-hybrid-chatbot--floating .mgf-hybrid-chatbot__launcher {
  margin-left: auto;
}

.mgf-hybrid-chatbot__launcher-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.18);
}

.mgf-hybrid-chatbot__panel {
  display: flex;
  flex-direction: column;
  width: min(92vw, 390px);
  border: 1px solid var(--mgf-chat-line);
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(24, 181, 227, 0.16), transparent 30%),
    linear-gradient(180deg, #ffffff, #f6faff 68%, #eef5fb);
  box-shadow: 0 28px 58px var(--mgf-chat-shadow);
  overflow: hidden;
}

.mgf-hybrid-chatbot--floating .mgf-hybrid-chatbot__panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 14px);
  width: min(calc(100vw - 32px), 390px);
  max-height: min(78svh, 680px);
}

.mgf-hybrid-chatbot--embedded .mgf-hybrid-chatbot__panel {
  width: 100%;
  margin-top: 0;
}

.mgf-hybrid-chatbot--floating.mgf-hybrid-chatbot--open .mgf-hybrid-chatbot__launcher {
  display: none !important;
}

.mgf-hybrid-chatbot__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.2rem 1.2rem 1rem;
  background: linear-gradient(135deg, rgba(41, 75, 143, 0.98), rgba(24, 181, 227, 0.98));
  color: #ffffff;
}

.mgf-hybrid-chatbot__eyebrow {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}

.mgf-hybrid-chatbot__title {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.1;
  color: #effcff;
  text-shadow: 0 1px 0 rgba(20, 58, 111, 0.16);
}

.mgf-hybrid-chatbot__subtitle {
  margin: 0.45rem 0 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.84);
}

.mgf-hybrid-chatbot__close {
  min-height: 38px;
  padding: 0.55rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.mgf-hybrid-chatbot__messages {
  flex: 1 1 auto;
  display: grid;
  gap: 0.8rem;
  min-height: 0;
  padding: 1rem 1rem 0.3rem;
  overflow-y: auto;
}

.mgf-hybrid-chatbot__message {
  max-width: 88%;
  padding: 0.85rem 0.95rem;
  border-radius: 20px;
  line-height: 1.6;
  font-size: 0.94rem;
  word-break: break-word;
}

.mgf-hybrid-chatbot__message--assistant {
  justify-self: start;
  border: 1px solid var(--mgf-chat-line);
  background: #ffffff;
  color: var(--mgf-chat-deep);
}

.mgf-hybrid-chatbot__message--user {
  justify-self: end;
  background: linear-gradient(135deg, var(--mgf-chat-deep), var(--mgf-chat-deep-soft));
  color: #ffffff;
}

.mgf-hybrid-chatbot__suggestions {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  padding: 0.7rem 1rem 0.15rem;
  overflow: hidden;
}

.mgf-hybrid-chatbot__suggestion {
  width: 100%;
  min-height: 42px;
  padding: 0.45rem 0.8rem;
  border: 1px solid rgba(24, 181, 227, 0.2);
  border-radius: 18px;
  background: rgba(240, 249, 253, 0.9);
  color: var(--mgf-chat-deep);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: normal;
  text-align: left;
  cursor: pointer;
}

.mgf-hybrid-chatbot__composer {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: end;
  padding: 1rem;
}

.mgf-hybrid-chatbot__input {
  width: 100%;
  min-height: 58px;
  padding: 0.9rem 1rem;
  border: 1px solid var(--mgf-chat-line);
  border-radius: 18px;
  background: #ffffff;
  color: var(--mgf-chat-deep);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  resize: vertical;
}

.mgf-hybrid-chatbot__input:focus {
  outline: 2px solid rgba(24, 181, 227, 0.18);
  border-color: var(--mgf-chat-cyan);
}

.mgf-hybrid-chatbot__send {
  min-height: 54px;
  padding: 0.85rem 1rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--mgf-chat-cyan), #0f9ec8);
  color: #ffffff;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(24, 181, 227, 0.22);
}

.mgf-hybrid-chatbot__send:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  box-shadow: none;
}

@media (max-width: 640px) {
  .mgf-hybrid-chatbot--floating {
    right: 10px;
    left: auto;
    bottom: 10px;
    width: min(calc(100vw - 20px), 316px);
  }

  .mgf-hybrid-chatbot--floating .mgf-hybrid-chatbot__panel {
    width: min(calc(100vw - 20px), 316px);
    max-height: min(66svh, 500px);
    bottom: calc(100% + 8px);
    border-radius: 22px;
  }

  .mgf-hybrid-chatbot__launcher {
    min-height: 52px;
    padding: 0.8rem 1.05rem;
    font-size: 0.9rem;
  }

  .mgf-hybrid-chatbot__header {
    padding: 1rem 1rem 0.85rem;
  }

  .mgf-hybrid-chatbot__title {
    font-size: 1.1rem;
  }

  .mgf-hybrid-chatbot__close {
    min-height: 34px;
    padding: 0.45rem 0.7rem;
    font-size: 0.8rem;
  }

  .mgf-hybrid-chatbot__messages {
    gap: 0.65rem;
    padding: 0.75rem 0.75rem 0.15rem;
  }

  .mgf-hybrid-chatbot__message {
    max-width: 92%;
    padding: 0.7rem 0.78rem;
    font-size: 0.86rem;
    line-height: 1.45;
  }

  .mgf-hybrid-chatbot__suggestions {
    gap: 0.4rem;
    padding: 0.6rem 0.85rem 0.05rem;
  }

  .mgf-hybrid-chatbot__suggestion {
    min-height: 38px;
    padding: 0.35rem 0.62rem;
    font-size: 0.76rem;
  }

  .mgf-hybrid-chatbot__composer {
    grid-template-columns: 1fr;
    gap: 0.55rem;
    padding: 0.75rem;
  }

  .mgf-hybrid-chatbot__input {
    min-height: 46px;
    padding: 0.72rem 0.82rem;
    font-size: 0.86rem;
  }

  .mgf-hybrid-chatbot__send {
    min-height: 44px;
    padding: 0.72rem 0.9rem;
    font-size: 0.84rem;
  }
}

@media (max-width: 420px) {
  .mgf-hybrid-chatbot--floating {
    right: 8px;
    bottom: 8px;
    width: min(calc(100vw - 16px), 300px);
  }

  .mgf-hybrid-chatbot--floating .mgf-hybrid-chatbot__panel {
    width: min(calc(100vw - 16px), 300px);
    max-height: min(62svh, 460px);
  }

  .mgf-hybrid-chatbot__suggestions {
    grid-template-columns: 1fr;
  }

  .mgf-hybrid-chatbot__launcher {
    min-height: 48px;
    padding: 0.72rem 0.95rem;
    font-size: 0.84rem;
  }
}
