﻿.t2000-ai-qa-widget {
  --t2000-qa-bg: #ffffff;
  --t2000-qa-fg: #15263a;
  --t2000-qa-primary: #2e3192;
  --t2000-qa-primary-2: #0f4c81;
  --t2000-qa-border: #d8dfeb;
  --t2000-qa-soft: #f4f7fb;
  --t2000-qa-user: #e9f1ff;
  --t2000-qa-bot: #f2f5f9;
  --t2000-qa-shadow: 0 22px 48px rgba(12, 32, 68, 0.22);
  --t2000-qa-font: var(--e-global-typography-text-font-family, var(--e-global-typography-primary-font-family, "Montserrat", "Segoe UI", Arial, sans-serif));
  font-family: var(--t2000-qa-font);
}

.t2000-ai-qa-widget * {
  box-sizing: border-box;
}

.t2000-ai-qa-panel {
  background: var(--t2000-qa-bg);
  color: var(--t2000-qa-fg);
  border: 1px solid var(--t2000-qa-border);
  border-radius: 18px;
  box-shadow: var(--t2000-qa-shadow);
  overflow: hidden;
  backdrop-filter: blur(4px);
}

.t2000-ai-qa-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--t2000-qa-border);
  background: linear-gradient(135deg, #f8faff 0%, #eef3fb 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.t2000-ai-qa-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.t2000-ai-qa-brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #33b469;
  box-shadow: 0 0 0 6px rgba(51, 180, 105, 0.15);
  flex: 0 0 auto;
}

.t2000-ai-qa-header h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: #192d55;
  font-weight: 700;
}

.t2000-ai-qa-header p {
  margin: 2px 0 0;
  font-size: 12px;
  color: #4e6b8e;
}

.t2000-ai-qa-close {
  border: 1px solid #d1dced;
  background: #fff;
  color: #345;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1;
  font-size: 20px;
  padding: 0;
}

.t2000-ai-qa-close:hover {
  border-color: #b5c7e2;
  background: #f4f8ff;
}

.t2000-ai-qa-messages {
  max-height: 360px;
  overflow: auto;
  padding: 14px;
  display: grid;
  gap: 10px;
  background: #fff;
}

.t2000-ai-qa-msg {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.48;
  white-space: pre-wrap;
  max-width: 92%;
}

.t2000-ai-qa-msg a {
  color: #1f4ea3;
  text-decoration: underline;
  word-break: break-all;
}

.t2000-ai-qa-msg--bot {
  background: var(--t2000-qa-bot);
  border: 1px solid #e6ebf2;
}

.t2000-ai-qa-msg--user {
  background: var(--t2000-qa-user);
  border: 1px solid #d3e2ff;
  justify-self: end;
}

.t2000-ai-qa-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--t2000-qa-border);
  background: var(--t2000-qa-soft);
}

.t2000-ai-qa-form textarea {
  resize: none;
  min-height: 46px;
  max-height: 130px;
  border: 1px solid #c9d7ea;
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
  color: #19304b;
  background: #fff;
}

.t2000-ai-qa-form textarea:focus {
  outline: none;
  border-color: #8fa9d4;
  box-shadow: 0 0 0 3px rgba(46, 49, 146, 0.14);
}

.t2000-ai-qa-form button {
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--t2000-qa-primary) 0%, var(--t2000-qa-primary-2) 100%);
  color: #fff;
  border-radius: 10px;
  padding: 0 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  min-height: 46px;
}

.t2000-ai-qa-form button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.t2000-ai-qa-widget--inline {
  max-width: 440px;
}

.t2000-ai-qa-widget--floating {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2147483000;
  width: auto;
}

.t2000-ai-qa-widget--floating .t2000-ai-qa-toggle {
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 999px;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 30%, #3f5ff2 0%, #2e3192 65%, #1a1f6d 100%);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 14px 32px rgba(46, 49, 146, 0.42);
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.t2000-ai-qa-widget--floating .t2000-ai-qa-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(46, 49, 146, 0.5);
}

.t2000-ai-qa-toggle-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
}

.t2000-ai-qa-toggle-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.t2000-ai-qa-toggle-text {
  position: absolute;
  right: 76px;
  white-space: nowrap;
  background: #1b2f57;
  color: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  letter-spacing: 0.01em;
  opacity: 0;
  transform: translateX(6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.t2000-ai-qa-widget--floating .t2000-ai-qa-toggle:hover .t2000-ai-qa-toggle-text {
  opacity: 1;
  transform: translateX(0);
}

.t2000-ai-qa-toggle-pulse {
  position: absolute;
  inset: -5px;
  border-radius: 999px;
  border: 2px solid rgba(46, 49, 146, 0.28);
  animation: t2000QaPulse 2.2s ease-out infinite;
}

.t2000-ai-qa-widget--floating .t2000-ai-qa-panel {
  display: none !important;
  position: absolute;
  right: 0;
  bottom: 78px;
  width: min(390px, calc(100vw - 20px));
  height: min(540px, 72vh);
  flex-direction: column;
}

.t2000-ai-qa-widget--floating.is-open .t2000-ai-qa-panel {
  display: flex !important;
  animation: t2000QaUp 0.2s ease-out;
}

.t2000-ai-qa-widget--floating .t2000-ai-qa-messages {
  flex: 1 1 auto;
  max-height: none;
  min-height: 240px;
}

.t2000-ai-qa-widget--floating.is-open .t2000-ai-qa-toggle {
  transform: scale(0.96);
}

@keyframes t2000QaPulse {
  0% { transform: scale(0.92); opacity: 0.7; }
  70% { transform: scale(1.06); opacity: 0; }
  100% { transform: scale(1.06); opacity: 0; }
}

@keyframes t2000QaUp {
  from { opacity: 0; transform: translateY(6px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 640px) {
  .t2000-ai-qa-widget--floating {
    right: 10px;
    bottom: 10px;
    width: auto;
  }

  .t2000-ai-qa-widget--floating .t2000-ai-qa-toggle {
    width: 58px;
    height: 58px;
  }

  .t2000-ai-qa-toggle-text {
    display: none;
  }

  .t2000-ai-qa-messages {
    max-height: 44vh;
  }

  .t2000-ai-qa-widget--floating .t2000-ai-qa-panel {
    width: calc(100vw - 20px);
    height: min(68vh, 520px);
    bottom: 70px;
  }
}
