/* ============================================
   AI MANAGER — CTA BLOCK + FLOATING BUTTON + WIDGET
   ============================================ */

/* ---------- BIG CTA BLOCK ---------- */
.ai-cta-section {
  background: linear-gradient(135deg, #0d0f10 0%, #1a1d1f 50%, #0d0f10 100%);
  padding: 100px 0;
  position: relative;
  overflow: hidden;
  border-top: 1px solid rgba(126, 168, 2, 0.15);
  border-bottom: 1px solid rgba(126, 168, 2, 0.15);
}
.ai-cta-section::before {
  content: '';
  position: absolute;
  top: -50%; left: -10%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(126, 168, 2, 0.12) 0%, transparent 70%);
  pointer-events: none;
  filter: blur(40px);
}
.ai-cta-section::after {
  content: '';
  position: absolute;
  bottom: -50%; right: -10%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(126, 168, 2, 0.08) 0%, transparent 70%);
  pointer-events: none;
  filter: blur(40px);
}
.ai-cta-wrap {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 64px;
  align-items: center;
}
.ai-cta-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(126, 168, 2, 0.12);
  border: 1px solid rgba(126, 168, 2, 0.3);
  color: var(--lime-bright);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 24px;
  text-transform: uppercase;
}
.ai-cta-badge .pulse-dot {
  width: 8px; height: 8px;
  background: var(--lime-bright);
  border-radius: 50%;
  box-shadow: 0 0 0 0 var(--lime-bright);
  animation: aiPulse 2s infinite;
}
@keyframes aiPulse {
  0% { box-shadow: 0 0 0 0 rgba(126, 168, 2, 0.7); }
  70% { box-shadow: 0 0 0 12px rgba(126, 168, 2, 0); }
  100% { box-shadow: 0 0 0 0 rgba(126, 168, 2, 0); }
}
.ai-cta-title {
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.05;
  font-weight: 800;
  color: #fff;
  margin: 0 0 24px;
  letter-spacing: -0.02em;
}
.ai-cta-title .accent {
  color: var(--lime-bright);
  display: inline-block;
}
.ai-cta-sub {
  font-size: 19px;
  line-height: 1.5;
  color: var(--grey-300);
  margin: 0 0 32px;
  max-width: 580px;
}
.ai-cta-features {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 32px;
  margin: 0 0 36px;
}
.ai-cta-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--grey-200);
  font-size: 15px;
}
.ai-cta-feature svg {
  width: 20px; height: 20px;
  color: var(--lime-bright);
  flex-shrink: 0;
}
.ai-cta-button-big {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: var(--lime-bright);
  color: #0d0f10;
  padding: 22px 38px;
  font-size: 22px;
  font-weight: 800;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s ease;
  box-shadow: 0 10px 40px -10px rgba(126, 168, 2, 0.5);
  letter-spacing: -0.01em;
}
.ai-cta-button-big:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 50px -10px rgba(126, 168, 2, 0.7);
  background: #93c004;
}
.ai-cta-button-big svg {
  width: 28px; height: 28px;
}
.ai-cta-note {
  margin-top: 18px;
  color: var(--grey-500);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ai-cta-note svg {
  width: 16px; height: 16px;
  color: var(--lime-bright);
}

/* Mock chat preview справа */
.ai-cta-preview {
  background: #16181a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
  position: relative;
}
.ai-cta-preview-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 16px;
}
.ai-cta-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--lime-bright), #5a7a01);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0d0f10;
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
}
.ai-cta-preview-name {
  font-weight: 700;
  color: #fff;
  font-size: 15px;
  margin: 0;
}
.ai-cta-preview-status {
  color: var(--lime-bright);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.ai-cta-preview-status::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--lime-bright);
  border-radius: 50%;
  display: inline-block;
}
.ai-cta-msg {
  background: #1f2224;
  color: var(--grey-200);
  padding: 12px 14px;
  border-radius: 14px 14px 14px 4px;
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 10px;
  max-width: 90%;
  opacity: 1;
}
.ai-cta-msg.user {
  background: rgba(126, 168, 2, 0.15);
  color: #fff;
  margin-left: auto;
  border-radius: 14px 14px 4px 14px;
  border: 1px solid rgba(126, 168, 2, 0.3);
}
.ai-cta-msg:nth-child(2) { animation-delay: 0.3s; }
.ai-cta-msg:nth-child(3) { animation-delay: 0.7s; }
.ai-cta-msg:nth-child(4) { animation-delay: 1.1s; }
@keyframes msgFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.ai-cta-typing {
  display: inline-flex;
  gap: 4px;
  padding: 12px 14px;
  background: #1f2224;
  border-radius: 14px;
  align-items: center;
}
.ai-cta-typing span {
  width: 7px; height: 7px;
  background: var(--lime-bright);
  border-radius: 50%;
  animation: typing 1.4s infinite;
  opacity: 0.4;
}
.ai-cta-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-cta-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* Responsive CTA */
@media (max-width: 980px) {
  .ai-cta-wrap { grid-template-columns: 1fr; gap: 40px; }
  .ai-cta-preview { max-width: 420px; margin: 0 auto; }
  .ai-cta-section { padding: 70px 0; }
}
@media (max-width: 600px) {
  .ai-cta-button-big {
    font-size: 18px;
    padding: 18px 28px;
    width: 100%;
    justify-content: center;
  }
  .ai-cta-features { gap: 12px 20px; }
  .ai-cta-feature { font-size: 14px; }
}

/* ---------- FLOATING CHAT BUTTON ---------- */
.chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--lime-bright);
  color: #0d0f10;
  padding: 14px 22px 14px 16px;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 10px 30px -8px rgba(126, 168, 2, 0.55), 0 4px 12px rgba(0,0,0,0.2);
  transition: all 0.25s ease;
  animation: fabIn 0.5s ease 1s both;
}
@keyframes fabIn {
  from { transform: translateY(80px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.chat-fab:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px -8px rgba(126, 168, 2, 0.7), 0 6px 16px rgba(0,0,0,0.25);
}
.chat-fab-icon {
  width: 36px; height: 36px;
  background: #0d0f10;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.chat-fab-icon svg { width: 18px; height: 18px; color: var(--lime-bright); }
.chat-fab-icon::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 10px; height: 10px;
  background: #ff4444;
  border-radius: 50%;
  border: 2px solid var(--lime-bright);
}
.chat-fab.hidden { display: none; }

@media (max-width: 600px) {
  .chat-fab { bottom: 16px; right: 16px; padding: 12px 18px 12px 12px; font-size: 14px; }
  .chat-fab-label { display: none; }
  .chat-fab { padding: 14px; }
}

/* ---------- CHAT WIDGET ---------- */
.chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 400px;
  height: 640px;
  max-height: calc(100vh - 48px);
  background: #16181a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  z-index: 9999;
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 30px 80px -10px rgba(0, 0, 0, 0.6), 0 10px 30px -5px rgba(0,0,0,0.3);
  animation: widgetIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.chat-widget.open { display: flex; }
@keyframes widgetIn {
  from { transform: translateY(40px) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

@media (max-width: 600px) {
  .chat-widget {
    bottom: 0; right: 0; left: 0; top: 0;
    width: 100%; height: 100%;
    max-height: 100%;
    border-radius: 0;
  }
}

.chat-header {
  background: linear-gradient(135deg, #1a1d1f, #16181a);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.chat-header-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--lime-bright), #5a7a01);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #0d0f10;
  font-size: 16px;
  flex-shrink: 0;
}
.chat-header-info { flex: 1; min-width: 0; }
.chat-header-name {
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  margin: 0;
}
.chat-header-status {
  color: var(--lime-bright);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.chat-header-status::before {
  content: '';
  width: 7px; height: 7px;
  background: var(--lime-bright);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--lime-bright);
}
.chat-close {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: #fff;
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.chat-close:hover { background: rgba(255, 255, 255, 0.12); }
.chat-close svg { width: 16px; height: 16px; }

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #0f1112;
  scrollbar-width: thin;
  scrollbar-color: rgba(126, 168, 2, 0.3) transparent;
}
.chat-body::-webkit-scrollbar { width: 6px; }
.chat-body::-webkit-scrollbar-thumb { background: rgba(126, 168, 2, 0.3); border-radius: 10px; }

.chat-msg {
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  animation: msgIn 0.3s ease both;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-msg.bot {
  background: #1f2224;
  color: var(--grey-200);
  border-radius: 16px 16px 16px 4px;
  align-self: flex-start;
}
.chat-msg.user {
  background: var(--lime-bright);
  color: #0d0f10;
  border-radius: 16px 16px 4px 16px;
  align-self: flex-end;
  font-weight: 500;
}
.chat-msg a { color: inherit; text-decoration: underline; }
.chat-msg p { margin: 0 0 8px; }
.chat-msg p:last-child { margin-bottom: 0; }
.chat-msg ul, .chat-msg ol { margin: 8px 0; padding-left: 20px; }
.chat-msg li { margin: 2px 0; }

.chat-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 14px;
  background: #1f2224;
  border-radius: 16px 16px 16px 4px;
}
.chat-typing span {
  width: 8px; height: 8px;
  background: var(--lime-bright);
  border-radius: 50%;
  animation: typing 1.4s infinite;
  opacity: 0.4;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

.chat-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 4px;
  margin-top: 4px;
  animation: msgIn 0.3s ease 0.2s both;
}
.chat-quick {
  background: rgba(126, 168, 2, 0.1);
  border: 1px solid rgba(126, 168, 2, 0.3);
  color: var(--lime-bright);
  padding: 8px 14px;
  border-radius: 100px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
}
.chat-quick:hover {
  background: rgba(126, 168, 2, 0.2);
  transform: translateY(-1px);
}

.chat-footer {
  padding: 14px;
  background: #16181a;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.chat-input-wrap {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  background: #1f2224;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 8px 8px 8px 14px;
  transition: border-color 0.2s;
}
.chat-input-wrap:focus-within {
  border-color: rgba(126, 168, 2, 0.4);
}
.chat-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  outline: none;
  min-height: 24px;
  max-height: 100px;
  line-height: 1.4;
  padding: 6px 0;
}
.chat-input::placeholder { color: var(--grey-500); }
.chat-send {
  background: var(--lime-bright);
  color: #0d0f10;
  border: none;
  width: 36px; height: 36px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.chat-send:hover { transform: scale(1.05); background: #93c004; }
.chat-send:disabled { opacity: 0.4; cursor: not-allowed; }
.chat-send svg { width: 18px; height: 18px; }
.chat-disclaimer {
  text-align: center;
  font-size: 11px;
  color: var(--grey-500);
  margin-top: 8px;
}
.chat-disclaimer a { color: var(--lime-bright); }

/* Lead form inside chat */
.chat-lead-form {
  background: #1a1d1f;
  border: 1px solid rgba(126, 168, 2, 0.2);
  border-radius: 14px;
  padding: 16px;
  margin: 8px 0;
  animation: msgIn 0.3s ease both;
}
.chat-lead-form h4 {
  color: #fff;
  margin: 0 0 12px;
  font-size: 15px;
}
.chat-lead-form input {
  width: 100%;
  background: #0f1112;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 14px;
  font-family: inherit;
}
.chat-lead-form input:focus {
  outline: none;
  border-color: var(--lime-bright);
}
.chat-lead-form button {
  width: 100%;
  background: var(--lime-bright);
  color: #0d0f10;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
}
.chat-lead-form button:hover { background: #93c004; }
