/* GoTech Chat — minimal premium widget */

.gotech-chatbot-root {
  --gotech-chat-primary: #0B3A6E;
  --gotech-chat-ink: #142033;
  --gotech-chat-muted: #6b7685;
  --gotech-chat-line: #e8ecf1;
  --gotech-chat-soft: #f7f8fa;
  --gotech-chat-surface: #ffffff;
  --gotech-chat-shadow: 0 8px 30px rgba(20, 32, 51, 0.1);
  --gotech-chat-radius: 12px;
  --gotech-chat-z: 99999;

  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: var(--gotech-chat-z);
  font-family: "Outfit", "Segoe UI", sans-serif;
  color: var(--gotech-chat-ink);
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  .gotech-chatbot-root *,
  .gotech-chatbot-root *::before,
  .gotech-chatbot-root *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Launcher */
.gotech-chatbot-launcher {
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 16px;
  background: transparent;
  color: var(--gotech-chat-primary);
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(10, 51, 95, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.2s ease;
}

.gotech-chatbot-launcher:hover,
.gotech-chatbot-launcher:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(10, 51, 95, 0.28);
  outline: none;
}

.gotech-chatbot-launcher-avatar {
  width: 56px;
  height: 56px;
  display: block;
  border-radius: 16px;
}

.gotech-chatbot-launcher svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gotech-chatbot-root.is-open .gotech-chatbot-launcher {
  opacity: 0.92;
}

/* Panel */
.gotech-chatbot-panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  width: min(360px, calc(100vw - 32px));
  height: min(520px, calc(100vh - 110px));
  background: var(--gotech-chat-surface);
  border-radius: var(--gotech-chat-radius);
  box-shadow: var(--gotech-chat-shadow);
  border: 1px solid var(--gotech-chat-line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.gotech-chatbot-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Header */
.gotech-chatbot-header {
  background: var(--gotech-chat-surface);
  color: var(--gotech-chat-ink);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--gotech-chat-line);
}

.gotech-chatbot-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.gotech-chatbot-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: block;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(10, 51, 95, 0.12);
}

.gotech-chatbot-bubble-avatar {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  flex-shrink: 0;
  margin-bottom: 2px;
  box-shadow: 0 1px 4px rgba(10, 51, 95, 0.1);
}

.gotech-chatbot-header-titles {
  min-width: 0;
}

.gotech-chatbot-header-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gotech-chatbot-header-sub {
  margin: 1px 0 0;
  font-size: 11.5px;
  font-weight: 450;
  color: var(--gotech-chat-muted);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gotech-chatbot-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.gotech-chatbot-text-btn {
  background: transparent;
  border: none;
  color: var(--gotech-chat-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 6px 8px;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.gotech-chatbot-text-btn:hover,
.gotech-chatbot-text-btn:focus-visible {
  color: var(--gotech-chat-primary);
  background: var(--gotech-chat-soft);
  outline: none;
}

.gotech-chatbot-icon-btn {
  background: transparent;
  border: none;
  color: var(--gotech-chat-muted);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}

.gotech-chatbot-icon-btn:hover,
.gotech-chatbot-icon-btn:focus-visible {
  color: var(--gotech-chat-ink);
  background: var(--gotech-chat-soft);
  outline: none;
}

/* Messages */
.gotech-chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 18px;
  background: var(--gotech-chat-surface);
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--gotech-chat-line) transparent;
}

.gotech-chatbot-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 100%;
}

.gotech-chatbot-row--assistant {
  align-self: flex-start;
  max-width: 92%;
}

.gotech-chatbot-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 400;
  letter-spacing: 0.01em;
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.55;
}

.gotech-chatbot-row--assistant .gotech-chatbot-bubble {
  max-width: none;
  flex: 1;
}

.gotech-chatbot-bubble--assistant {
  align-self: flex-start;
  background: var(--gotech-chat-soft);
  color: var(--gotech-chat-ink);
  border-bottom-left-radius: 3px;
}

.gotech-chatbot-bubble--user {
  align-self: flex-end;
  background: var(--gotech-chat-primary);
  color: #fff;
  border-bottom-right-radius: 3px;
}

.gotech-chatbot-bubble--error {
  align-self: center;
  background: transparent;
  color: #9b3b3b;
  border: 1px solid #efd5d5;
  font-size: 12.5px;
  max-width: 100%;
  text-align: center;
}

/* Typing */
.gotech-chatbot-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  background: var(--gotech-chat-soft);
  border-radius: 10px;
  border-bottom-left-radius: 3px;
}

.gotech-chatbot-typing span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gotech-chat-muted);
  opacity: 0.45;
  animation: gotech-dot 1.2s ease-in-out infinite;
}

.gotech-chatbot-typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.gotech-chatbot-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes gotech-dot {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

/* Quick replies */
.gotech-chatbot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 18px 14px;
  background: var(--gotech-chat-surface);
}

.gotech-chatbot-chip {
  border: 1px solid var(--gotech-chat-line);
  background: transparent;
  color: var(--gotech-chat-ink);
  border-radius: 6px;
  padding: 7px 11px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.gotech-chatbot-chip:hover,
.gotech-chatbot-chip:focus-visible {
  border-color: var(--gotech-chat-primary);
  color: var(--gotech-chat-primary);
  background: var(--gotech-chat-soft);
  outline: none;
}

/* Composer */
.gotech-chatbot-composer {
  border-top: 1px solid var(--gotech-chat-line);
  padding: 12px 14px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--gotech-chat-surface);
}

.gotech-chatbot-input {
  flex: 1;
  border: none;
  background: var(--gotech-chat-soft);
  border-radius: 8px;
  padding: 11px 12px;
  font-size: 13.5px;
  resize: none;
  min-height: 42px;
  max-height: 100px;
  font-family: inherit;
  color: var(--gotech-chat-ink);
  line-height: 1.4;
}

.gotech-chatbot-input::placeholder {
  color: #9aa3af;
}

.gotech-chatbot-input:focus {
  outline: none;
  box-shadow: inset 0 0 0 1px var(--gotech-chat-primary);
}

.gotech-chatbot-send {
  width: 42px;
  height: 42px;
  border: none;
  background: var(--gotech-chat-primary);
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.gotech-chatbot-send svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gotech-chatbot-send:hover:not(:disabled),
.gotech-chatbot-send:focus-visible:not(:disabled) {
  background: #082848;
  outline: none;
}

.gotech-chatbot-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Lead form */
.gotech-chatbot-lead {
  padding: 14px 18px 16px;
  background: var(--gotech-chat-surface);
  border-top: 1px solid var(--gotech-chat-line);
  display: none;
  flex-direction: column;
  gap: 8px;
}

.gotech-chatbot-lead.is-visible {
  display: flex;
}

.gotech-chatbot-lead h3 {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.gotech-chatbot-lead input,
.gotech-chatbot-lead textarea {
  width: 100%;
  border: 1px solid var(--gotech-chat-line);
  border-radius: 6px;
  padding: 9px 11px;
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
  background: var(--gotech-chat-surface);
  color: var(--gotech-chat-ink);
}

.gotech-chatbot-lead input:focus,
.gotech-chatbot-lead textarea:focus {
  outline: none;
  border-color: var(--gotech-chat-primary);
}

.gotech-chatbot-lead-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}

.gotech-chatbot-lead-actions button {
  border-radius: 6px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}

.gotech-chatbot-btn-primary {
  background: var(--gotech-chat-primary);
  color: #fff;
  border: none;
}

.gotech-chatbot-btn-primary:hover {
  background: #082848;
}

.gotech-chatbot-btn-secondary {
  background: transparent;
  border: 1px solid var(--gotech-chat-line);
  color: var(--gotech-chat-muted);
}

.gotech-chatbot-btn-secondary:hover {
  color: var(--gotech-chat-ink);
  border-color: #d0d6de;
}

@media (max-width: 480px) {
  .gotech-chatbot-root {
    right: 14px;
    bottom: 14px;
  }

  .gotech-chatbot-panel {
    width: calc(100vw - 28px);
    height: min(68vh, 520px);
  }
}
