


body {
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
    font-family: 'serif;
    align-items: center;
    background: linear-gradient(90deg , #ccc 50% , #ddd 50% );
}

input {
    display: none;
}

img {
    width: 100%;
    
}
img { 
  vertical-align: middle;
}

.book {
    display: flex;
}

#cover {
    width: 250px;
    height: 400px;
}

.flip-book {
    width: 250px;
    height: 360px;
    position: relative;
    perspective: 1500px;
}

.flip {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: left;
    transform-style: preserve-3d;
    transform: rotateY(0deg);
    transition: .5s;
    color: #000;
}

p {
    font-size: 18px;
    line-height: 24px;
}

.front {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-color: #fafafa;
    box-sizing: border-box;
    padding: 0 13px;
    /* box-shadow: inset 20px 0 50px r; */
}

.back {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 99;
    transform: rotateY(180deg);
    backface-visibility: hidden;
    background-color: #fff;
}

.next-btn {
    position: absolute;
    bottom: 13px;
    right: 13px;
    cursor: pointer;
    color: #000;
	background:#fff;
 
}

.back-btn {
    position: absolute;
    bottom: 13px;
    right: 13px;
    cursor: pointer;
    color: #fff;
	background:#000;
}

#p1 {
    z-index: 8;
}
#p2 {
    z-index: 7;
}
#p3 {
    z-index: 6;
}
#p4 {
    z-index: 5;
}
#p5 {
    z-index: 4;
}
#p6 {
    z-index: 3;
}
#p7 {
    z-index: 2;
}

#p8 {
    z-index: 1;
}


#c1:checked ~ .flip-book #p1 {
    transform: rotateY(-180deg);
    z-index: 1;
}
#c2:checked ~ .flip-book #p2 {
    transform: rotateY(-180deg);
    z-index: 2;
}
#c3:checked ~ .flip-book #p3 {
    transform: rotateY(-180deg);
    z-index: 3;
}
#c4:checked ~ .flip-book #p4 {
    transform: rotateY(-180deg);
    z-index: 4;
}
#c5:checked ~ .flip-book #p5 {
    transform: rotateY(-180deg);
    z-index: 5;
}
#c6:checked ~ .flip-book #p6 {
    transform: rotateY(-180deg);
    z-index: 6;
}
#c7:checked ~ .flip-book #p7 {
    transform: rotateY(-180deg);
    z-index: 7;
}
#c8:checked ~ .flip-book #p8 {
    transform: rotateY(-180deg);
    z-index: 8;
}