* {
  box-sizing: border-box;
}

.glass-door {
  position: absolute;
  top: 0px;
  left: 0px;
  height: 100%;
  width: 100%;
  border: solid 16px;
  border-color: #4F4F4F;
  box-sizing: border-box;
  cursor: pointer;
  
  transform: rotate3d( 0, 1, 0, 0deg );
  
  transition: transform 0.5s cubic-bezier(.54,-0.01,.83,1.21), border-color 0.5s cubic-bezier(.54,-0.01,.83,1.21);
  
  backface-visibility: visible;
  will-change: transform;
  transform-style: preserve-3d;
}

.glass-door.left {
  transform-origin: left;
}
.glass-door.right {
  transform-origin: right; 
}

.glass-door div:nth-of-type( 1 ),
.glass-door div:nth-of-type( 2 ),
.glass-door div:nth-of-type( 3 ),
.glass-door div:nth-of-type( 4 ),
.glass-door div:nth-of-type( 5 ),
.glass-door div:nth-of-type( 6 ){
  display: block;
  position: absolute;
  pointer-events: none;
}
.glass-door div:nth-of-type( 1 ){
  top: 0px;
  left: 0px;
  height: calc( 100% );
  width: calc( 100% );
  background: #007FFF3F;
  transform: translate3d( 0, 0, 8px );
}
.glass-door div:nth-of-type( 2 ){
  top: 0px;
  left: 0px;
  margin: -16px;
  height: calc( 100% + 32px );
  width: calc( 100% + 32px );
  border: solid 16px;
  border-color: #BFBFBF;
  box-sizing: border-box;
  transform: translate3d( 0, 0, 16px );
  transition: border-color 0.5s cubic-bezier(.54,-0.01,.83,1.21);
}
.glass-door div:nth-of-type( 3 ){
  top: 0px;
  left: -16px;
  height: 16px;
  width: calc( 100% + 32px );
  background: #5F5F5F;
  transform: rotate3d( 1, 0, 0, 90deg );
  transform-origin: top;
  /*transition: background 0.5s cubic-bezier(.54,-0.01,.83,1.21);*/
}
.glass-door div:nth-of-type( 4 ){
  bottom: -16px;
  left: -16px;
  height: 16px;
  width: calc( 100% + 32px );
  background: #CFCFCF;
  transform: rotate3d( 1, 0, 0, 90deg );
  transform-origin: top;
  /*transition: background 0.5s cubic-bezier(.54,-0.01,.83,1.21);*/
}
.glass-door.left div:nth-of-type( 5 ){
  top: -16px;
  right: -16px;
  height: calc( 100% + 32px );
  width: 16px;
  background: #7F7F7F;
  transform: rotate3d( 0, 1, 0, 90deg );
  transform-origin: right;
  transition: background 0.5s cubic-bezier(.54,-0.01,.83,1.21);
}
.glass-door.left div:nth-of-type( 6 ){
  top: -16px;
  left: -16px;
  height: calc( 100% + 32px );
  width: 16px;
  background: #7F7F7F;
  transform: rotate3d( 0, 1, 0, 90deg );
  transform-origin: right;
  transition: background 0.5s cubic-bezier(.54,-0.01,.83,1.21);
}
.glass-door.right div:nth-of-type( 5 ){
  top: -16px;
  right: 0px;
  height: calc( 100% + 32px );
  width: 16px;
  background: #7F7F7F;
  transform: rotate3d( 0, 1, 0, 90deg );
  transform-origin: right;
  transition: background 0.5s cubic-bezier(.54,-0.01,.83,1.21);
}
.glass-door.right div:nth-of-type( 6 ){
  top: -16px;
  left: -32px;
  height: calc( 100% + 32px );
  width: 16px;
  background: #7F7F7F;
  transform: rotate3d( 0, 1, 0, 90deg );
  transform-origin: right;
  transition: background 0.5s cubic-bezier(.54,-0.01,.83,1.21);
}


.glass-door input {
  position: absolute;
  top: 0px;
  left: 0px;
  height: calc( 100% + 32px );
  width: calc( 100% + 32px );
  opacity: 0;
  cursor: pointer;
  margin: -16px;
}

.glass-door.left:has(input:checked){
  transition: transform 1.2s cubic-bezier(.55,.89,.15,1.4), border-color 1.2s cubic-bezier(.55,.89,.15,1.4);
  transform: rotate3d( 0, 1, 0, -100deg );
  border-color: #7F7F7F;
}
.glass-door.left:has(input:checked) div:nth-of-type( 2 ){
  transition: border-color 1.2s cubic-bezier(.55,.89,.15,1.4);
  border-color: #6F6F6F;
}

.glass-door.right:has(input:checked){
  transition: transform 1.2s cubic-bezier(.55,.89,.15,1.4), border-color 1.2s cubic-bezier(.55,.89,.15,1.4);
  transform: rotate3d( 0, 1, 0, 100deg );
  border-color: #7F7F7F;
}
.glass-door.right:has(input:checked) div:nth-of-type( 2 ){
  transition: border-color 1.2s cubic-bezier(.55,.89,.15,1.4);
  border-color: #6F6F6F;
}

.glass-door.left:has(input:checked) div:nth-of-type( 6 ),
.glass-door.right:has(input:checked) div:nth-of-type( 5 ){
  transition: background 1.2s cubic-bezier(.55,.89,.15,1.4);
  background: #9F9F9F;
}
.glass-door.left:has(input:checked) div:nth-of-type( 5 ),
.glass-door.right:has(input:checked) div:nth-of-type( 6 ){
  transition: background 1.2s cubic-bezier(.55,.89,.15,1.4);
  background: #BFBFBF;
}