@import url('https://fonts.googleapis.com/css2?family=Popins:wght@400;500;600display=swap');

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
}

body{
    background: white;
}

.chatbot-toggler {
    position: fixed;
    right: 40px;
    bottom: 35px;
    height: 50px;
    width: 50px;
    color: #fff;
    background: #1609d4;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    outline: none;
    cursor: pointer;
    border-radius: 50%;
}
.chatbot-toggler span{
    position: absolute;
}
.show-chatbot .chatbot-toggler span:first-child,
.chatbot-toggler span:last-child{
    opacity: 0;
}

.show-chatbot .chatbot-toggler span:last-child {
    opacity: 1;
}
.chatbot{
    position: fixed;
    right: 40px;
    bottom: 100px;
    transform: scale(0.5);
    opacity: 0;
    pointer-events: none;
    width: 420px;
    background: #fff;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 0 128px 0 rgba(0,0,0,0.1), 0 32px 64px -48px rgba(0,0,0,0.5);
}

.show-chatbot .chatbot {
    transform: scale(1);
    opacity: 1;
    pointer-events: auto;
}

.chatbot header{
    background: #1609d4;
    padding: 16px 0;
    text-align: center;
}

.chatbot header h2{
    color: #fff;
    font-size: 1.4rem;
}
.chatbot header span{
    position: absolute;
    right: 20px;
    top: 50%;
    color: #fff;
    cursor: pointer;
    display: none;
    transform: translateY(-50%);
}
.chatbot .chatbox {
    height: 510px;
    overflow-y: auto ;
    padding: 30px 20px 70px;
}

.chatbox .chat{
    display: flex;
}

.chatbox .incoming span {
    height: 32px;
    width: 32px;
    background: #1609d4;
    color: #fff;
    align-self: flex-end;
    text-align: center;
    line-height: 32px;
    border-radius: 4px;
    margin: 0 10px 7px 0;
}
.chatbox .outgoing {
    margin: 20px 0;
    justify-content: flex-end;
}

.chatbox .chat p {
    color: #fff;
    font-size: 0.95rem;
    max-width: 75%;
    padding: 12px 16px;
    background: #1609d4;
    border-radius: 10px 10px 0 10px;
}

.chatbox .incoming p{
    color: #000;
    background: #f2f2f2;
    border-radius: 10px 10px 10px 0;
}

.chatbot .chat-input {
    position: absolute;
    bottom: 0;
    display: flex;
    gap: 5px;
    border-top: 1px solid #ccc;
    background: #fff;
    padding: 5px 20px;
}

.chat-input textarea {
    height: 55px;
    width: 100%;
    border: none;
    outline: none;
    font-size: 0.95rem;
    resize: none;
    padding: 16px 15px 16px 0;
}

.chat-input span {
    align-items: flex-end;
    height: 55px;
    line-height: 55px;
    color: #1609d4;
    font-size: 1.35rem;
    cursor: pointer;
}

.chat-input textarea:valid ~ span {
 visibility: visible;   
}

@media(max-width: 490px) {
    .chatbot {
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
    }

    .chatbot .chatbox {
        height: 90%;
    }

    .chatbot header span {
        display: block;
    }
}