body{
    font-family: "Poppin", sans-serif;
    background-color: #2e3537;
    height: 100vh;
    display:flex;
    align-items: center;
    justify-content: center;
   
}

.book{
    width: 350px;
    height: 450px;
    position: relative;
    transition-duration: 0.5s;
    perspective: 1500px;
}

input {
   display: none;
}
.cover, .back-cover{
    background-color: #4173a5;
    width: 100%;
    height: 100%;
    border-radius: 0 15px 15px 0;
    box-shadow: 0 0 5px rgb(41, 41, 41);
    display: flex;
    align-items: center;
    justify-content: center;
}
.cover{
    position: absolute;
    z-index: 11;
    transform-origin: center left;
    transition: transform 0.5s;
}
.cover label {
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.back-cover{
    position: relative;
    z-index: -1;
}
.page {
    position: absolute;
    background-color: lightblue;
    width: 330px;
    height: 430px;
    border-radius: 0px 15px 15px 0px;
    margin-top: 10px;
    transform-origin: left;
    transform-style: preserve-3d;
    transform: rotateY(0deg);
    transition-duration: 0.5s;
    
}

.page img{
    width: 100%;
    height: 100%;
    margin-top: 0px;
    margin-bottom: 0px;
    border-radius: 5px 5px 5px 5px;    
}

.front-page{
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    box-sizing: border-box;
    padding: 1rem;
}

.back-page{
    transform: rotateY(180deg);
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    z-index: 99;
}

.next,.prev{
    position: absolute;
    bottom: 1rem;
    cursor: pointer;
}

.next{
    right: 1rem;
}

.prev{
    left: 1rem;
}
#p1{
    z-index: 13;
}
#p2{
    z-index: 12;
}
#p3{
    z-index: 11;
}
#p4{
    z-index: 10;
}
#p5{
    z-index: 9;
}
#p6{
    z-index: 8;
}
#p7{
    z-index: 7;
}
#p8{
    z-index: 6;
}
#p9{
    z-index: 5;
}
#p10{
    z-index: 4;
}
#p11{
    z-index: 3;
}
#p12{
    z-index: 2;
}
#p13{
    z-index: 1;
}

#checkbox-cover:checked ~ .book {
    transform: translateX(200px);
}
#checkbox-cover:checked ~ .book .cover{
    transition: transform 0.5s, z-index 0.5s 0.5s;
    transform: rotateY(-180deg);
    z-index: 1;
}
#checkbox-cover:checked ~ .book .page{
    box-shadow: 0 0 3px rgb(99,98, 98);
}
#checkbox-p1:checked ~ .book {
    transform: translateX(200px);
}
#checkbox-p1:checked ~ .book #p1{
    transform: rotateY(-180deg);
    z-index: 2;
}
#checkbox-p2:checked ~ .book #p2{
    transform: rotateY(-180deg);
    z-index: 3;
}
#checkbox-p3:checked ~ .book #p3{
    transform: rotateY(-180deg);
    z-index: 4;
}
#checkbox-p4:checked ~ .book #p4{
    transform: rotateY(-180deg);
    z-index: 5;
}
#checkbox-p5:checked ~ .book #p5{
    transform: rotateY(-180deg);
    z-index: 6;
}
#checkbox-p6:checked ~ .book #p6{
    transform: rotateY(-180deg);
    z-index: 7;
}
#checkbox-p7:checked ~ .book #p7{
    transform: rotateY(-180deg);
    z-index: 8;
}
#checkbox-p8:checked ~ .book #p8{
    transform: rotateY(-180deg);
    z-index: 9;
}
#checkbox-p9:checked ~ .book #p9{
    transform: rotateY(-180deg);
    z-index: 10;
}
#checkbox-p10:checked ~ .book #p10{
    transform: rotateY(-180deg);
    z-index: 11;
}
#checkbox-p11:checked ~ .book #p11{
    transform: rotateY(-180deg);
    z-index: 12;
}
#checkbox-p12:checked ~ .book #p12{
    transform: rotateY(-180deg);
    z-index: 13;
}
#checkbox-p13:checked ~ .book #p13{
    transform: rotateY(-180deg);
    z-index: 14;
}

