﻿.pr-chatbot {
  --pr-chat-bg: #070d1c;
  --pr-chat-surface: #0c152b;
  --pr-chat-border: rgba(111, 139, 252, 0.28);
  --pr-chat-soft-border: rgba(148, 163, 184, 0.24);
  --pr-chat-text: #e7ecff;
  --pr-chat-muted: #9fb0d8;
  --pr-chat-primary: #4f7bff;
  --pr-chat-primary-2: #8a5bff;
  --pr-chat-user: linear-gradient(135deg, #3f61e9, #5f4eea);
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 3000;
  font-family: Inter, sans-serif;
}

.pr-chatbot * {
  box-sizing: border-box;
}

.pr-chatbot__launcher {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  border: 1px solid rgba(173, 194, 255, 0.45);
  background: radial-gradient(circle at 20% 20%, #6f7dff 0%, #3f56d7 45%, #283374 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 20px 46px -18px rgba(70, 99, 255, 0.82), inset 0 1px 0 rgba(255, 255, 255, 0.26);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.pr-chatbot__launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 56px -20px rgba(70, 99, 255, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.pr-chatbot__launcher:focus-visible,
.pr-chatbot__input-field:focus-visible,
.pr-chatbot__send:focus-visible,
.pr-chatbot__lead-submit:focus-visible,
.pr-chatbot__chip:focus-visible,
.pr-chatbot__close:focus-visible {
  outline: 2px solid rgba(154, 182, 255, 0.85);
  outline-offset: 2px;
}

.pr-chatbot__panel {
  width: min(390px, calc(100vw - 24px));
  height: min(620px, calc(100vh - 100px));
  margin-bottom: 14px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(8, 16, 36, 0.96) 0%, rgba(6, 12, 26, 0.96) 100%);
  border: 1px solid var(--pr-chat-border);
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 36px 76px -40px rgba(37, 88, 255, 0.95), 0 18px 30px -24px rgba(9, 19, 48, 0.92);
  backdrop-filter: blur(12px);
}

.pr-chatbot--open .pr-chatbot__panel {
  display: flex;
}

.pr-chatbot__header {
  padding: 14px 16px;
  background: linear-gradient(120deg, #22388f 0%, #4e45cb 48%, #4a78f4 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pr-chatbot__header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.pr-chatbot__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.26);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pr-chatbot__title-wrap {
  min-width: 0;
}

.pr-chatbot__title {
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.1;
}

.pr-chatbot__subtitle {
  color: rgba(233, 240, 255, 0.9);
  font-size: 12px;
  line-height: 1.2;
  margin-top: 2px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.pr-chatbot__close {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  background: rgba(5, 10, 24, 0.26);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.pr-chatbot__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: radial-gradient(circle at 20% -20%, rgba(92, 115, 255, 0.18) 0%, transparent 45%), var(--pr-chat-bg);
}

.pr-chatbot__messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pr-chatbot__message-row {
  display: flex;
}

.pr-chatbot__message-row--bot {
  justify-content: flex-start;
}

.pr-chatbot__message-row--user {
  justify-content: flex-end;
}

.pr-chatbot__message-block {
  max-width: 90%;
}

.pr-chatbot__bubble {
  max-width: 100%;
  border-radius: 16px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-line;
}

.pr-chatbot__bubble--bot {
  color: var(--pr-chat-text);
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.pr-chatbot__bubble--user {
  color: #fff;
  background: var(--pr-chat-user);
  border: 1px solid rgba(173, 194, 255, 0.26);
}

.pr-chatbot__followups {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pr-chatbot__followup-chip {
  border: 1px solid rgba(140, 122, 255, 0.38);
  color: #e5ddff;
  background: linear-gradient(135deg, rgba(85, 72, 172, 0.5), rgba(61, 85, 184, 0.44));
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  padding: 7px 10px;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.pr-chatbot__followup-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(166, 151, 255, 0.55);
  background: linear-gradient(135deg, rgba(97, 83, 191, 0.62), rgba(72, 99, 208, 0.58));
}

.pr-chatbot__typing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(148, 163, 184, 0.08);
}

.pr-chatbot__typing-text {
  margin-left: 2px;
  color: #b9c7ea;
  font-size: 11px;
  font-weight: 500;
}

.pr-chatbot__typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d5def7;
  animation: pr-chatbot-dot 1s infinite ease-in-out;
}

.pr-chatbot__typing-dot:nth-child(2) { animation-delay: 0.12s; }
.pr-chatbot__typing-dot:nth-child(3) { animation-delay: 0.24s; }

@keyframes pr-chatbot-dot {
  0%, 80%, 100% { opacity: 0.2; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

.pr-chatbot__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pr-chatbot__chip-row-break {
  flex-basis: 100%;
  height: 0;
  pointer-events: none;
}

.pr-chatbot__chip {
  border: 1px solid rgba(121, 149, 255, 0.34);
  color: #dbe5ff;
  background: rgba(79, 123, 255, 0.1);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  padding: 8px 10px;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.pr-chatbot__chip--teampulse {
  margin-right: auto;
}

.pr-chatbot__chip:hover {
  background: rgba(90, 128, 255, 0.18);
  border-color: rgba(151, 174, 255, 0.56);
  transform: translateY(-1px);
}

.pr-chatbot__bubble--lead {
  width: 100%;
  max-width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(121, 149, 255, 0.3);
  background: rgba(8, 16, 36, 0.64);
  padding: 12px;
}

.pr-chatbot__lead-title {
  margin: 0 0 8px;
  color: #f5f7ff;
  font-size: 13px;
  font-weight: 600;
}

.pr-chatbot__lead-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.pr-chatbot__field label {
  display: block;
  margin-bottom: 4px;
  color: var(--pr-chat-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.pr-chatbot__field input,
.pr-chatbot__field textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--pr-chat-soft-border);
  background: rgba(15, 23, 42, 0.82);
  color: #f8fbff;
  padding: 10px 11px;
  font-size: 13px;
}

.pr-chatbot__field textarea {
  min-height: 72px;
  resize: vertical;
}

.pr-chatbot__lead-hint {
  margin-top: 7px;
  font-size: 11px;
  color: var(--pr-chat-muted);
}

.pr-chatbot__lead-error {
  margin-top: 8px;
  border-radius: 9px;
  border: 1px solid rgba(244, 114, 182, 0.38);
  background: rgba(190, 24, 93, 0.16);
  color: #fbcfe8;
  font-size: 11px;
  padding: 7px 9px;
  display: none;
}

.pr-chatbot__lead-error--show {
  display: block;
}

.pr-chatbot__lead-submit {
  margin-top: 10px;
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(137, 169, 255, 0.46);
  background: linear-gradient(135deg, #355de6 0%, #4f58db 50%, #4f7bff 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 11px 12px;
  cursor: pointer;
  transition: opacity 160ms ease;
}

.pr-chatbot__lead-submit[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.pr-chatbot__input {
  display: flex;
  gap: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(8, 13, 26, 0.96);
  padding: 10px 12px;
}

.pr-chatbot__input-field {
  flex: 1;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  border-radius: 999px;
  padding: 11px 14px;
  font-size: 13px;
}

.pr-chatbot__send {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(137, 169, 255, 0.4);
  background: linear-gradient(135deg, #355de6 0%, #4f58db 55%, #4f7bff 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

@media (max-width: 640px) {
  .pr-chatbot {
    right: 12px;
    bottom: 12px;
  }

  .pr-chatbot__panel {
    width: min(100vw - 16px, 390px);
    height: min(590px, calc(100vh - 92px));
    margin-bottom: 10px;
    border-radius: 20px;
  }

  .pr-chatbot__launcher {
    width: 58px;
    height: 58px;
  }

  .pr-chatbot__bubble {
    max-width: 94%;
  }

  .pr-chatbot__message-block {
    max-width: 94%;
  }

  .pr-chatbot__followup-chip {
    font-size: 10px;
    padding: 7px 9px;
  }
}
