#chatbot-widget {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 72;
    display: grid;
    justify-items: end;
    gap: 14px;
}

#chatbot-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, #17386d 0%, #244c8f 100%);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 20px 36px rgba(23, 56, 109, 0.24);
    cursor: pointer;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

#chatbot-toggle:hover {
    transform: translateY(-3px);
    box-shadow: 0 26px 42px rgba(23, 56, 109, 0.28);
}

.chatbot-toggle__icon {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
}

.chatbot-toggle__icon svg {
    width: 22px;
    height: 22px;
}

#chatbot-window {
    display: none;
    width: min(390px, calc(100vw - 28px));
    border: 1px solid rgba(17, 50, 95, 0.1);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 28px 60px rgba(18, 46, 88, 0.2);
    overflow: hidden;
}

#chatbot-widget.is-open #chatbot-window {
    display: grid;
}

.chatbot-window__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 18px 14px;
    background: linear-gradient(180deg, #17386d 0%, #234a8c 100%);
    color: #fff;
}

.chatbot-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-brand__logo {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.14);
}

.chatbot-brand__logo svg {
    width: 20px;
    height: 20px;
}

.chatbot-brand strong,
.chatbot-brand small {
    display: block;
}

.chatbot-brand strong {
    font-size: 1rem;
}

.chatbot-brand small {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.82rem;
}

#chatbot-close {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
    transition: background 0.28s ease, transform 0.28s ease;
}

#chatbot-close:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: rotate(90deg);
}

#chatbot-close svg {
    width: 18px;
    height: 18px;
}

.chatbot-window__intro {
    padding: 14px 18px 0;
    color: #4f6484;
    font-size: 0.92rem;
    line-height: 1.6;
}

#chatbot-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 320px;
    overflow-y: auto;
    padding: 18px;
}

.chat-message {
    max-width: 88%;
    padding: 13px 15px;
    border-radius: 18px;
    line-height: 1.6;
}

.chat-message p {
    margin: 0;
}

.chat-message.bot {
    align-self: flex-start;
    background: #edf2fb;
    color: #11325f;
}

.chat-message.user {
    align-self: flex-end;
    background: linear-gradient(180deg, #17386d 0%, #244c8f 100%);
    color: #fff;
}

.chat-message.typing {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chat-message.typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(17, 50, 95, 0.45);
    animation: chatbotPulse 1s ease-in-out infinite;
}

.chat-message.typing span:nth-child(2) {
    animation-delay: 0.12s;
}

.chat-message.typing span:nth-child(3) {
    animation-delay: 0.24s;
}

.chatbot-window__composer {
    display: grid;
    grid-template-columns: 1fr 54px;
    gap: 10px;
    padding: 0 18px 18px;
}

#chatbot-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(17, 50, 95, 0.12);
    border-radius: 16px;
    background: #f9fbff;
    color: #11325f;
    outline: 0;
}

#chatbot-input:focus {
    border-color: rgba(35, 74, 140, 0.28);
    box-shadow: 0 0 0 4px rgba(35, 74, 140, 0.08);
}

#chatbot-send {
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(180deg, #17386d 0%, #244c8f 100%);
    color: #fff;
    cursor: pointer;
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

#chatbot-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 24px rgba(23, 56, 109, 0.22);
}

#chatbot-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#chatbot-send svg {
    width: 18px;
    height: 18px;
}

@keyframes chatbotPulse {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.45;
    }
    50% {
        transform: translateY(-2px);
        opacity: 1;
    }
}

@media (max-width: 760px) {
    #chatbot-widget {
        right: 12px;
        bottom: 12px;
    }

    #chatbot-window {
        width: min(100vw - 24px, 390px);
    }
}
