/* BIO SEPT Digital Assistant — isolated widget */

#bs-assistant,
#bs-assistant * {
    box-sizing: border-box;
}

#bs-assistant {
    --bs-blue: #075da8;
    --bs-blue2: #0b78ce;
    --bs-dark: #071426;
    --bs-green: #75b82a;
    --bs-white: #ffffff;

    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 99999;
    font-family: Arial, Helvetica, sans-serif;
}

/* Подсказка */
#bs-assistant .bs-bubble {
    position: absolute;
    right: 72px;
    bottom: 18px;
    width: 225px;
    padding: 13px 15px;
    background: #fff;
    color: #172033;
    border-radius: 16px 16px 4px 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,.18);
    font-size: 14px;
    line-height: 1.35;
    animation: bsBubbleIn .55s ease both;
}

/* Кнопка-кабинка */
#bs-assistant .bs-cabin-button {
    width: 66px;
    height: 82px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    filter: drop-shadow(0 8px 8px rgba(0,0,0,.28));
    animation: bsFloat 3s ease-in-out infinite;
}

#bs-assistant .bs-cabin {
    position: relative;
    width: 58px;
    height: 76px;
    margin: auto;
    border-radius: 8px 8px 5px 5px;
    background: linear-gradient(135deg,var(--bs-blue2),var(--bs-blue));
    border: 3px solid #064b85;
    overflow: hidden;
}

#bs-assistant .bs-cabin-roof {
    position: absolute;
    top: 0;
    left: -4px;
    width: 60px;
    height: 10px;
    background: #064b85;
    border-radius: 8px 8px 2px 2px;
}

#bs-assistant .bs-cabin-sign {
    position: absolute;
    top: 14px;
    left: 7px;
    right: 7px;
    color: #fff;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .5px;
    text-align: center;
}

#bs-assistant .bs-door {
    position: absolute;
    left: 12px;
    bottom: 0;
    width: 30px;
    height: 51px;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(90deg,#0868b6,#0b80d8);
    border: 2px solid rgba(255,255,255,.35);
    transform-origin: left center;
    transition: transform .55s ease;
}

#bs-assistant .bs-handle {
    position: absolute;
    right: 4px;
    top: 25px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #fff;
}

#bs-assistant .bs-cabin-button:hover .bs-door {
    transform: perspective(90px) rotateY(-28deg);
}

/* Окно ассистента */
#bs-assistant .bs-panel {
    position: absolute;
    right: 0;
    bottom: 96px;
    width: min(365px, calc(100vw - 28px));
    max-height: min(620px, calc(100vh - 130px));
    overflow: hidden;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 20px 65px rgba(0,0,0,.28);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(.96);
    transform-origin: bottom right;
    transition: .3s ease;
}

#bs-assistant.bs-open .bs-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

#bs-assistant.bs-open .bs-bubble {
    display: none;
}

#bs-assistant.bs-open .bs-door {
    transform: perspective(90px) rotateY(-40deg);
}

#bs-assistant .bs-header {
    position: relative;
    padding: 20px 50px 18px 20px;
    color: #fff;
    background:
        radial-gradient(circle at 85% 20%,rgba(117,184,42,.35),transparent 30%),
        linear-gradient(135deg,#071426,#0a3760);
}

#bs-assistant .bs-header strong {
    display: block;
    font-size: 18px;
}

#bs-assistant .bs-header span {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    opacity: .8;
}

#bs-assistant .bs-close {
    position: absolute;
    right: 15px;
    top: 15px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(255,255,255,.12);
    cursor: pointer;
    font-size: 20px;
}

#bs-assistant .bs-progress {
    height: 4px;
    background: #e8edf2;
}

#bs-assistant .bs-progress > div {
    width: 12%;
    height: 100%;
    background: linear-gradient(90deg,var(--bs-green),#9bd83c);
    transition: width .35s ease;
}

#bs-assistant .bs-body {
    min-height: 260px;
    max-height: 440px;
    overflow-y: auto;
    padding: 20px;
    background: #f5f8fb;
}

#bs-assistant .bs-message {
    max-width: 88%;
    margin-bottom: 12px;
    padding: 12px 14px;
    color: #172033;
    background: #fff;
    border-radius: 5px 16px 16px 16px;
    box-shadow: 0 3px 12px rgba(0,0,0,.06);
    font-size: 14px;
    line-height: 1.45;
    animation: bsMessage .3s ease both;
}

#bs-assistant .bs-message strong {
    color: var(--bs-blue);
}

#bs-assistant .bs-start {
    width: 100%;
    margin-top: 12px;
    padding: 13px;
    border: 0;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg,var(--bs-blue),var(--bs-blue2));
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

@keyframes bsFloat {
    0%,100% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(-7px) rotate(1deg); }
}

@keyframes bsBubbleIn {
    from { opacity:0; transform:translateX(12px); }
    to { opacity:1; transform:translateX(0); }
}

@keyframes bsMessage {
    from { opacity:0; transform:translateY(7px); }
    to { opacity:1; transform:translateY(0); }
}

@media (max-width:600px) {
    #bs-assistant {
        right: 12px;
        bottom: 12px;
    }

    #bs-assistant .bs-bubble {
        width: 190px;
        right: 67px;
    }

    #bs-assistant .bs-panel {
        position: fixed;
        right: 12px;
        bottom: 104px;
        width: calc(100vw - 24px);
        max-height: calc(100vh - 125px);
    }
}

@media (prefers-reduced-motion:reduce) {
    #bs-assistant *,
    #bs-assistant *::before,
    #bs-assistant *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* ===== BIO SEPT CABIN v2 ===== */

#bs-assistant .bs-cabin-button {
    width: 82px;
    height: 104px;
    position: relative;
    overflow: visible;
    filter: drop-shadow(0 12px 12px rgba(0,0,0,.30));
}

/* мягкое свечение */
#bs-assistant .bs-cabin-button::before {
    content: "";
    position: absolute;
    width: 72px;
    height: 28px;
    left: 5px;
    bottom: 2px;
    border-radius: 50%;
    background: rgba(74,174,255,.28);
    filter: blur(12px);
    animation: bsCabinGlow 2.4s ease-in-out infinite;
}

/* корпус */
#bs-assistant .bs-cabin {
    width: 68px;
    height: 92px;
    border: 0;
    border-radius: 11px 11px 7px 7px;
    overflow: visible;
    position: relative;

    background:
      linear-gradient(90deg,
        #064d87 0%,
        #0877c9 16%,
        #1596ec 48%,
        #0876c5 78%,
        #043e70 100%);

    box-shadow:
      inset 4px 0 6px rgba(255,255,255,.20),
      inset -6px 0 9px rgba(0,0,0,.20),
      0 9px 18px rgba(0,0,0,.28);
}

/* крыша */
#bs-assistant .bs-cabin-roof {
    top: -5px;
    left: -4px;
    width: 76px;
    height: 13px;
    border-radius: 9px 9px 4px 4px;

    background:
      linear-gradient(180deg,#1599ed,#075b9c);

    box-shadow:
      inset 0 2px 2px rgba(255,255,255,.35),
      0 2px 4px rgba(0,0,0,.25);
}

/* фирменная табличка */
#bs-assistant .bs-cabin-sign {
    top: 13px;
    left: 8px;
    right: 8px;
    padding: 3px 1px;

    color: white;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .8px;

    background: rgba(1,34,61,.72);
    border-radius: 4px;

    text-shadow: 0 1px 2px rgba(0,0,0,.5);
}

/* вентиляционные полоски */
#bs-assistant .bs-cabin::before {
    content: "";
    position: absolute;
    top: 28px;
    left: 8px;
    width: 7px;
    height: 24px;

    background:
      repeating-linear-gradient(
        to bottom,
        rgba(0,31,57,.65) 0px,
        rgba(0,31,57,.65) 2px,
        transparent 2px,
        transparent 5px
      );

    border-radius: 2px;
}

/* индикатор онлайн */
#bs-assistant .bs-cabin::after {
    content: "";
    position: absolute;
    right: 5px;
    top: 28px;

    width: 8px;
    height: 8px;

    border-radius: 50%;
    background: #91dc3c;

    border: 2px solid rgba(255,255,255,.9);

    box-shadow:
      0 0 0 3px rgba(145,220,60,.18),
      0 0 10px rgba(145,220,60,.85);

    animation: bsOnlinePulse 1.8s ease-in-out infinite;
}

/* дверь */
#bs-assistant .bs-door {
    left: 18px;
    bottom: 5px;

    width: 40px;
    height: 58px;

    border-radius: 5px 5px 2px 2px;

    background:
      linear-gradient(90deg,
        #075c9f 0%,
        #0d8bdf 48%,
        #0871bb 100%);

    border:
      2px solid rgba(196,233,255,.75);

    box-shadow:
      inset 3px 0 5px rgba(255,255,255,.14),
      inset -4px 0 6px rgba(0,0,0,.16);

    transform-origin: left center;

    transition:
      transform .55s cubic-bezier(.2,.8,.2,1),
      filter .4s ease;
}

/* маленькое окно на двери */
#bs-assistant .bs-door::before {
    content: "";
    position: absolute;

    top: 8px;
    left: 8px;

    width: 20px;
    height: 13px;

    border-radius: 3px;

    background:
      linear-gradient(135deg,#bdeaff,#5ab9e9);

    border: 1px solid rgba(255,255,255,.85);

    box-shadow:
      inset 0 0 5px rgba(0,58,96,.35);
}

/* нижняя панель двери */
#bs-assistant .bs-door::after {
    content: "";
    position: absolute;

    left: 7px;
    right: 7px;
    bottom: 7px;

    height: 14px;

    border-radius: 2px;

    border: 1px solid rgba(255,255,255,.25);

    background:
      linear-gradient(
        90deg,
        rgba(255,255,255,.05),
        rgba(255,255,255,.15),
        rgba(255,255,255,.05)
      );
}

/* ручка */
#bs-assistant .bs-handle {
    right: 4px;
    top: 31px;

    width: 5px;
    height: 5px;

    background: #f4f7fa;

    box-shadow:
      0 0 4px rgba(255,255,255,.8);
}

/* при наведении */
#bs-assistant .bs-cabin-button:hover .bs-door {
    transform:
      perspective(120px)
      rotateY(-30deg);
}

/* при открытом ассистенте */
#bs-assistant.bs-open .bs-door {
    transform:
      perspective(120px)
      rotateY(-48deg);

    filter: brightness(1.12);
}

/* немного увеличиваем амплитуду движения */
#bs-assistant .bs-cabin-button {
    animation:
      bsCabinFloat 3.2s ease-in-out infinite;
}

@keyframes bsCabinFloat {
    0%,100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-8px) rotate(.8deg);
    }
}

@keyframes bsCabinGlow {
    0%,100% {
        opacity: .45;
        transform: scale(.92);
    }
    50% {
        opacity: .9;
        transform: scale(1.08);
    }
}

@keyframes bsOnlinePulse {
    0%,100% {
        transform: scale(.85);
        opacity: .8;
    }
    50% {
        transform: scale(1.12);
        opacity: 1;
    }
}

/* мобильный размер */
@media (max-width:600px) {

    #bs-assistant .bs-cabin-button {
        width: 76px;
        height: 98px;
    }

    #bs-assistant .bs-cabin {
        transform: scale(.94);
        transform-origin: bottom right;
    }
}


/* Close button for assistant greeting bubble */
.bs-bubble {
  position: relative;
}

.bs-bubble-close {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 40, 65, 0.10);
  color: #52606d;
  font-size: 20px;
  line-height: 26px;
  text-align: center;
  cursor: pointer;
  z-index: 5;
}

.bs-bubble-close:active {
  transform: scale(.9);
}
