/* Trade Wings Capital — chatbot widget styles */

.twc-chat {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  font-family: "Poppins", "Roboto", Arial, sans-serif;
}

/* floating button */
.twc-chat-fab {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  background: #0490e7;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(8, 21, 128, 0.32);
  transition: transform 0.15s ease, background 0.15s ease;
}
.twc-chat-fab:hover { background: #0378c2; transform: translateY(-2px); }
.twc-chat-fab-hidden { display: none; }

/* panel */
.twc-chat-panel {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 44px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(8, 21, 128, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.twc-chat-panel[hidden] { display: none; }

.twc-chat-head {
  background: #212968;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
}
.twc-chat-title { font-weight: 600; font-size: 16px; }
.twc-chat-close {
  border: 0;
  background: none;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.twc-chat-close:hover { color: #c6e9ff; }

.twc-chat-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f5f9fd;
}

.twc-msg {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 14.5px;
  line-height: 1.45;
  white-space: pre-line;
  overflow-wrap: break-word;
}
.twc-msg a { color: #0378c2; text-decoration: underline; }
.twc-msg-bot {
  background: #fff;
  color: #21252b;
  border: 1px solid rgba(8, 21, 128, 0.08);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.twc-msg-user {
  background: #0490e7;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.twc-msg-typing { color: #6a7180; font-style: italic; }
.twc-msg-success { border-left: 3px solid #2e9e5b; }

.twc-msg-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
.twc-msg-actions a {
  display: block;
  text-align: center;
  background: #edf8fe;
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: 600;
  text-decoration: none;
  color: #212968;
  font-size: 13.5px;
}
.twc-msg-actions a:hover { background: #d9effc; }

.twc-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px 4px;
  background: #f5f9fd;
  flex: none;
}
.twc-chip {
  border: 1px solid #0490e7;
  color: #0378c2;
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
}
.twc-chip:hover { background: #edf8fe; }

.twc-chat-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(8, 21, 128, 0.08);
  background: #fff;
  flex: none;
}
.twc-chat-input {
  flex: 1;
  border: 1px solid rgba(8, 21, 128, 0.18);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.twc-chat-input:focus { border-color: #0490e7; }
.twc-chat-send {
  width: 42px;
  border: 0;
  border-radius: 10px;
  background: #0490e7;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.twc-chat-send:hover { background: #0378c2; }
.twc-chat-send:disabled { opacity: 0.5; cursor: default; }

.twc-chat-note {
  font-size: 10.5px;
  color: #8a91a0;
  text-align: center;
  padding: 0 12px 8px;
  background: #fff;
  flex: none;
}

/* mobile: keep clear of the sticky apply bar (68px) */
@media (max-width: 700px) {
  .twc-chat { right: 14px; bottom: 84px; }
  .twc-chat-panel {
    right: 8px;
    left: 8px;
    bottom: 78px;
    width: auto;
    height: min(560px, calc(100dvh - 96px));
  }
}

/* secure upload bar */
.twc-chat-uploadbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 12px 0;
  background: #fff;
  border-top: 1px solid rgba(8, 21, 128, 0.08);
  flex: none;
}
.twc-chat-uploadbar[hidden] { display: none; }
.twc-chat-uploadbtn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px dashed #0490e7;
  color: #0378c2;
  background: #f2faff;
  border-radius: 9px;
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.twc-chat-uploadbtn:hover { background: #e3f4ff; }
.twc-chat-uploadbtn:disabled { opacity: 0.5; cursor: default; }
.twc-chat-uploadrules { font-size: 10.5px; color: #8a91a0; }
