* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.font {
  font-family: sans-serif;
  font-weight: 600;
}

:root {
  --mainWhite: #f2f3f7;
  --buttonWhite: -2px -2px 5px rgba(255, 255, 255, 1),
    3px 3px 5px rgba(0, 0, 0, 0.07);
  --buttonWhiteActive: inset -2px -2px 5px rgba(255, 255, 255, 1),
    inset 3px 3px 5px rgba(0, 0, 0, 0.07);
  --iconWhiteVer: #6a9bd8;
  --mainDark: #222;
  --buttonDark: inset -2px -2px 5px rgba(0, 0, 0, 0.5),
    inset 3px 3px 5px rgba(255, 255, 255, 0.07);
  --buttonDarkActive: -2px -2px 5px rgba(0, 0, 0, 0.5),
    3px 3px 5px rgba(255, 255, 255, 0.07);
  --iconDarkVer: #3e3e3e;
  --iconDarkVerActive: 0 0 10px rgba(33, 156, 243, 1),
    0 0 10px rgba(33, 156, 243, 1);
  --iconDarkLine: 0 0 10px rgba(33, 156, 243, 0.5),
    0 0 20px rgba(33, 156, 243, 0.5), 0 0 30px rgba(33, 156, 243, 0.5),
    inset 0 0 10px rgba(33, 156, 243, 0.5);
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column-reverse;
  min-height: 100vh;
  transition: 0.5s;
}

body.neumorphism {
  background: var(--mainWhite);
}

body.neumorphism .switch {
  background: var(--mainWhite);
  box-shadow: var(--buttonWhite);
}

body.neumorphism .switch input[type="checkbox"] ~ .icon-box {
  background: var(--mainWhite);
  box-shadow: var(--buttonWhite);
}

body.neumorphism .switch input[type="checkbox"] ~ .icon-box i {
  color: var(--iconWhiteVer);
}

body.neumorphism .switch input[type="checkbox"]:checked ~ .icon-box {
  box-shadow: var(--buttonWhiteActive);
}

body.dark {
  background: var(--mainDark);
}

body.dark .switch {
  background: var(--mainDark);
  box-shadow: var(--buttonDark);
}

body.dark .switch input[type="checkbox"] ~ .icon-box {
  background: var(--mainDark);
  box-shadow: var(--buttonDark);
}

body.dark .switch input[type="checkbox"] ~ .icon-box i {
  color: var(--iconDarkVer);
}

body.dark .switch input[type="checkbox"]:checked ~ .icon-box {
  box-shadow: var(--buttonDarkActive);
}

body.dark .switch input[type="checkbox"]:checked ~ .icon-box i {
  text-shadow: var(--iconDarkVerActive);
  color: #fff;
}

.switch {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  border-radius: 10px;
  padding: 20px;
}

.switch-box {
  position: relative;
  list-style: none;
  text-align: center;
  margin: 15px;
}

.switch-box label {
  position: relative;
}

.switch-box label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.switch-box label input[type="checkbox"] ~ .icon-box {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.switch-box label input[type="checkbox"] ~ .icon-box i {
  font-size: 20px;
}

.switch-box label input[type="checkbox"]:checked ~ .icon-box i {
  transform: scale(0.95);
}

.colormode {
  transform-style: preserve-3d;
  perspective: 200px;
  height: 40px;
  border-radius: 40px;
  margin-bottom: 20px;
}

.colormode input[type="checkbox"] {
  position: relative;
  width: 100px;
  height: 40px;
  margin: 0;
  transition: 0.5s ease;
  cursor: pointer;
}

.colormode input[type="checkbox"] ~ span {
  position: absolute;
  top: 0;
  width: 50%;
  height: 40px;
  line-height: 40px;
  text-align: center;
  text-transform: uppercase;
  font-weight: bold;
  pointer-events: none;
  transform-style: preserve-3d;
}

.colormode input[type="checkbox"] ~ span:nth-of-type(1) {
  left: 0;
  border-top-left-radius: 40px;
  border-bottom-left-radius: 40px;
  background: var(--mainWhite);
}

.colormode input[type="checkbox"] ~ span:nth-of-type(1)::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #464343, #17181b);
  border-top-left-radius: 40px;
  border-bottom-left-radius: 40px;
  transform-origin: right;
  transition: 1s;
  backface-visibility: hidden;
}

.colormode input[type="checkbox"] ~ span:nth-of-type(2) {
  color: var(--mainWhite);
  right: 0;
  border-top-right-radius: 40px;
  border-bottom-right-radius: 40px;
  background: var(--mainDark);
}

.colormode input[type="checkbox"] ~ span:nth-of-type(2)::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #fefefe, #f2f2f2);
  border-top-right-radius: 40px;
  border-bottom-right-radius: 40px;
  transform-origin: left;
  transition: 1s;
  backface-visibility: hidden;
  transform: rotateY(180deg);
}

.colormode input[type="checkbox"]:checked ~ span:nth-of-type(1)::before {
  transform: rotateY(180deg);
}

.colormode input[type="checkbox"]:checked ~ span:nth-of-type(2)::before {
  transform: rotateY(360deg);
}
