@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
}

body {
    height: 100vh;
    width: 100%;
    background: #ff6760;
    display: flex;
    align-items: center;
    justify-content: center;
}

.box {
    max-width: 400px;
    width: 100%;
}

.box .search-box {
    position: relative;
    height: 50px;
    max-width: 50px;
    margin: auto;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.25);
    border-radius: 25px;
    transition: all 0.3s ease;
}

#check:checked~.search-box {
    max-width: 380px;
}

.search-box input {
    position: absolute;
    height: 100%;
    width: 100%;
    border-radius: 25px;
    background: #fff;
    outline: none;
    border: none;
    padding-left: 20px;
    font-size: 18px;
}

.search-box .icon {
    position: absolute;
    right: -2px;
    top: 0;
    width: 50px;
    background: #fff;
    height: 100%;
    text-align: center;
    line-height: 50px;
    color: #ff6760;
    font-size: 20px;
    border-radius: 25px;
}

#check:checked~.search-box .icon {
    background: #ff6760;
    color: #fff;
    width: 60px;
    border-radius: 0 23px 25px 0
}

#check {
    display: none;
}

/* responsiveness */

@media (max-width: 440px) {

    #check:checked~.search-box {
        max-width: 340px;
    }
}

@media (max-width: 380px) {

    #check:checked~.search-box {
        max-width: 300px;
    }
}