/* AI-консультант FLEXYPRO — общий виджет для всех страниц */

.consultant-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 70;
  width: 60px; height: 60px; border-radius: 50%;
  background: #FD6143; color: #080707;
  border: 0; cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 24px 56px -12px rgba(253,97,67,0.5), inset 0 1px 0 rgba(255,255,255,0.18);
  transition: all .4s cubic-bezier(.22,1,.36,1);
  font-family: 'Manrope', system-ui, sans-serif;
}
.consultant-fab:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 32px 80px -16px rgba(253,97,67,0.7); }
.consultant-fab svg { width: 24px; height: 24px; stroke-width: 1.8; }
.consultant-fab__pulse { position: absolute; top: -4px; right: -4px; width: 14px; height: 14px; border-radius: 50%; background: #4ADE80; border: 2px solid #080707; box-shadow: 0 0 0 0 rgba(74,222,128,0.6); animation: consultant-pulse 2s infinite; }
@keyframes consultant-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(74,222,128,0.6); } 50% { box-shadow: 0 0 0 8px rgba(74,222,128,0); } }

.consultant-panel {
  position: fixed; right: 24px; bottom: 100px; z-index: 70;
  width: min(420px, calc(100vw - 48px));
  height: min(620px, calc(100vh - 140px));
  background: #0f0e0e;
  border: 1px solid rgba(245,241,237,0.08);
  border-radius: 16px;
  box-shadow: 0 48px 120px -24px rgba(0,0,0,0.8), inset 0 1px 0 rgba(245,241,237,0.04);
  display: flex; flex-direction: column;
  opacity: 0; pointer-events: none;
  transform: translateY(16px) scale(0.96);
  transform-origin: bottom right;
  transition: all .35s cubic-bezier(.22,1,.36,1);
  overflow: hidden;
  font-family: 'Manrope', system-ui, sans-serif;
  color: #f5f1ed;
}
.consultant-panel.open { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); }
.consultant-panel__head { padding: 18px 22px; border-bottom: 1px solid rgba(245,241,237,0.08); display: flex; align-items: center; gap: 12px; }
.consultant-panel__avatar { width: 36px; height: 36px; border-radius: 50%; background: #FD6143; color: #080707; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.consultant-panel__title { font-size: 14px; font-weight: 600; letter-spacing: -0.005em; }
.consultant-panel__sub { font-size: 11px; color: rgba(245,241,237,0.62); margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.consultant-panel__sub::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #4ADE80; }
.consultant-panel__close { margin-left: auto; background: transparent; color: rgba(245,241,237,0.62); border: 0; cursor: pointer; padding: 8px; border-radius: 50%; transition: all .2s; }
.consultant-panel__close:hover { background: rgba(245,241,237,0.08); color: #f5f1ed; }

.consultant-body { flex: 1; overflow-y: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; scrollbar-width: thin; }
.consultant-body::-webkit-scrollbar { width: 6px; }
.consultant-body::-webkit-scrollbar-thumb { background: rgba(245,241,237,0.08); border-radius: 3px; }
.consultant-msg { max-width: 86%; padding: 12px 16px; border-radius: 14px; font-size: 14px; line-height: 1.55; letter-spacing: -0.005em; white-space: pre-wrap; word-wrap: break-word; }
.consultant-msg--bot { align-self: flex-start; background: rgba(245,241,237,0.04); border: 1px solid rgba(245,241,237,0.08); color: #f5f1ed; border-bottom-left-radius: 4px; }
.consultant-msg--user { align-self: flex-end; background: #FD6143; color: #080707; font-weight: 500; border-bottom-right-radius: 4px; }
.consultant-msg-wrap { display: flex; flex-direction: column; gap: 6px; max-width: 86%; }
.consultant-msg-wrap--user { align-self: flex-end; }
.consultant-msg-wrap--bot { align-self: flex-start; }
.consultant-msg-wrap .consultant-msg { max-width: 100%; }
.consultant-fb { display: flex; gap: 6px; padding: 0 4px; opacity: 0.6; transition: opacity .2s; }
.consultant-msg-wrap--bot:hover .consultant-fb { opacity: 1; }
.consultant-fb__btn { padding: 4px 10px; background: transparent; color: rgba(245,241,237,0.45); border: 1px solid rgba(245,241,237,0.08); border-radius: 999px; font-size: 11px; cursor: pointer; transition: all .2s; font-family: inherit; }
.consultant-fb__btn:hover:not(:disabled) { color: #FD6143; border-color: rgba(253,97,67,0.4); }
.consultant-fb__btn--active { background: rgba(253,97,67,0.12); color: #FD6143; border-color: #FD6143; }
.consultant-fb__btn:disabled { opacity: 0.3; cursor: not-allowed; }
.consultant-msg--typing { align-self: flex-start; padding: 14px 18px; background: rgba(245,241,237,0.04); border: 1px solid rgba(245,241,237,0.08); border-radius: 14px; border-bottom-left-radius: 4px; display: inline-flex; gap: 4px; align-items: center; }
.consultant-msg--typing span { width: 6px; height: 6px; border-radius: 50%; background: rgba(245,241,237,0.62); animation: consultant-typing 1.4s infinite; }
.consultant-msg--typing span:nth-child(2) { animation-delay: .2s; }
.consultant-msg--typing span:nth-child(3) { animation-delay: .4s; }
@keyframes consultant-typing { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.consultant-suggests { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 22px 12px; }
.consultant-suggest { padding: 7px 12px; background: transparent; color: rgba(245,241,237,0.62); border: 1px solid rgba(245,241,237,0.08); border-radius: 999px; font-size: 11.5px; cursor: pointer; transition: all .2s; font-family: inherit; }
.consultant-suggest:hover { color: #FD6143; border-color: rgba(253,97,67,0.4); }

.consultant-input { padding: 14px 18px; border-top: 1px solid rgba(245,241,237,0.08); display: flex; gap: 10px; align-items: flex-end; background: rgba(8,7,7,0.4); }
.consultant-input textarea { flex: 1; background: transparent; color: #f5f1ed; border: 0; resize: none; font-family: inherit; font-size: 14px; line-height: 1.5; padding: 8px 0; max-height: 100px; outline: none; }
.consultant-input textarea::placeholder { color: rgba(245,241,237,0.38); }
.consultant-input__send { width: 36px; height: 36px; border-radius: 50%; background: #FD6143; color: #080707; border: 0; cursor: pointer; display: grid; place-items: center; transition: all .25s; flex-shrink: 0; }
.consultant-input__send:hover:not(:disabled) { transform: scale(1.05); }
.consultant-input__send:disabled { opacity: .4; cursor: not-allowed; }
.consultant-input__send svg { width: 16px; height: 16px; stroke-width: 2.2; }

@media (max-width: 600px) {
  .consultant-panel { right: 12px; left: 12px; bottom: 90px; width: auto; height: min(70vh, 540px); }
  .consultant-fab { right: 16px; bottom: 16px; }
}
