/*=============== VARIABLES CSS ===============*/
:root {
  /*========== Colors ==========*/
  /*Color mode HSL(hue, saturation, lightness)*/
  --on-color: hsl(188, 90%, 90%);
  --off-color: hsl(188, 60%, 30%);
  --bg-off-color: linear-gradient(180deg,
                hsl(203, 100%, 16%) 0%,
                hsl(203, 65%, 36%) 100%);
  --bg-on-color: radial-gradient(30% 65% at 30% 50%,
               hsl(188, 100%, 50%) 0%,
               hsla(188, 100%, 45%, 0%) 100%);
  --body-color: linear-gradient(180deg,
              hsl(188, 68%, 72%) 0%,
              hsl(192, 60%, 56%) 100%);
  --white-color: #fff;
}

/*=============== BASE ===============*/
* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

body {
  height: 100vh;
  display: grid;
  place-items: center;
  background: var(--body-color);
}

img {
  max-width: 100%;
  height: auto;
}

/*=============== TOGGLE ===============*/
.container{
  display: grid;
  row-gap: 1.25rem;
}
.toggle{
  width: 90px;
  height: 32px;
}
.toggle__check{
  display: none;
}

.toggle__img{
  border-radius: 4rem;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.toggle__base{
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  background-color: var(--bg-off-color);
  border-radius: 4rem;
  box-shadow: inset -2px 2px 6px hsla(0, 0%, 0%, .8);
  cursor: pointer;
}
/* Toggle button */
.toggle__button,
.toggle__button-1,
.toggle__button-2{
  position: absolute;
  border-radius: 4rem;
}
.toggle__button{
  width: 56px;
  height: 30px;
  background: linear-gradient(90deg, hsl(188,96%,76%) 0%,
  hsl(200, 80%,28%) 100%);
  top: 1px;
  left: 2px;
  box-shadow: 0 8px 24px hsla(0,0%,0%,.6),
  0 2px 6px hsla(0, 0%, 0%, .3),
  0 1px 3px hsla(0, 0%, 0%, .3);
  z-index: 2;
  transition: transform .3s ease-in-out;
}

.toggle__button-1{
  width: 46px;
  height: 28px;
  background:linear-gradient(90deg,
  hsl(200,85%,35%) 0%,
  hsl(188,65%,65%) 50%,
  hsl(188,96%,95%) 100%);
  top: 1px;
  left: 5px;
  filter: blur(2px);
}
.toggle__button-2{
  width: 48px;
  height: 28px;
  background:linear-gradient(90deg,
  hsl(200,85%,35%) 0%,
  hsl(188,70%,60%) 50%,
  hsl(188,100%,85%) 100%);
  top: 1px;
  left: 4px;
  box-shadow: 2px 0 4px hsla(0, 0%, 0%, .3);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3px;
}

/* Toggle lines */
.toggle__line{
  display: block;
  width: 2px;
  height: 12px;
  background-color: var(--white-color);
  box-shadow: 1.8px 0 0 hsla(0, 0%, 0%, .3);
}

/* Toggle status */
.toggle__on,
.toggle__off{
  width: 13px;
  height: 13px;
  border-radius: 50%;
  position: absolute;
  top: 0;
  bottom: 0;
  margin: auto 0;
  transition: border .3s ease-in-out;
}

.toggle__on{
  border: 2px solid var(--on-color);
  left: -18px;
}
.toggle__off{
  border: 2px solid var(--off-color);
  right: -18px;
}
.toggle__off::after{
  content:'';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 5px;
  height: 5px;
  background-color: var(--off-color);
  border-radius: 50%;
  transition: background .3 ease-in-out;
}
/* Toggle radial */
.toggle__radial{
  width: inherit;
  height: inherit;
  position: absolute;
  top: 0;
  left: 0;
  border-radius: inherit;
  background: var(--bg-on-color);
  mix-blend-mode: color-dodge;
  filter: blur(4px);
  object-fit: cover;
  object-position: center;
  z-index: 1;
  opacity: 0;
  transition: opacity .3;
}

/* Toggle animation effects */
.toggle__check:checked ~ .toggle__button{
  transform: translate(30px);
}

/* Toggle animation on - off */
.toggle__check:checked ~ .toggle__on{
  border: 2px solid var(--off-color);
}
.toggle__check:checked ~ .toggle__off{
  border: 2px solid var(--on-color);
}
.toggle__check:checked ~ .toggle__off::after{
  background-color:var(--on-color);
}

/* Toggle animation radial */
.toggle__check:checked ~ .toggle__radial{
  opacity: .8;
}