
/* ----------------
    Global input
   ---------------- */
.Toggle input[type=checkbox],
.Radio input[type=radio],
.Rating input[type=radio] {
  position: absolute;
  left: -100vw;
}

.Toggle input[type=checkbox] + label,
.Radio input[type=radio] + label,
.Rating input[type=radio] + label {
  position: relative;
  display: block;
  line-height: 3rem;
  cursor: pointer;
  white-space: nowrap;
}

.Toggle input[type=checkbox] + label::before,
.Toggle input[type=checkbox] + label::after,
.Radio input[type=radio] + label::before,
.Radio input[type=radio] + label::after,
.Rating input[type=radio] + label::before,
.Rating input[type=radio] + label::after {
  content: "";
  display: inline-block;
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  transition: 0.5s;
}

/* large */
.Color__large input[type=color] + label,
.Toggle__large input[type=checkbox] + label,
.Radio__large input[type=radio] + label,
.Range__large input[type=range] + label,
.Rating__large .Rating_label {
  font-size: 2rem;
  line-height: 6rem;
}

/* ----------------
    File input
   ---------------- */
.File {
  position: relative;
  text-align: center;
  background: #FF6600;
  border-radius: 1rem;
}

.File input[type=file] {
  position: absolute;
  inset: 0;
  text-align: center;
  padding: 4rem 3rem 0 3rem;
}

.File input[type=file]::file-selector-button {
  display: none;
}

.File input[type=file] + label {
  display: block;
  padding: 2rem 3rem 4rem 3rem;
  height: auto;
  cursor: pointer;
}

.File input[type=file] + label::before {
  pointer-events: none;
}

/* ----------------
    Color input
   ---------------- */
.Color,
.Color > * {
  cursor: pointer;
}

.Color input[type=color] {
  display: inline-block;
  vertical-align: middle;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
}

.Color input[type=color]::-webkit-color-swatch {
  width: 1.3rem;
  height: 1.3rem;
}

.Color input[type=color] + label {
  vertical-align: middle;
  margin-left: 1rem;
}

/* Color large */
.Color__large input[type=color] {
  width: 4rem;
  height: 4rem;
}

.Color__large input[type=color]::-webkit-color-swatch {
  width: 3.3rem;
  height: 3.3rem;
}

/* ----------------
    Rating input
   ---------------- */
.Rating .Rating_label {
  display: block;
  line-height: 1.3;
  margin-bottom: 0.3rem;
}

.Rating_input {
  display: flex;
  justify-content: space-evenly;
  flex-direction: row-reverse;
  max-width: 30rem;
  margin: auto;
  margin-bottom: 1rem;
}

.Rating input[type=radio] + label {
  width: 2rem;
  aspect-ratio: 1/1;
}

.Rating input[type=radio] + label::before {
  content: "★";
  width: 2rem;
  aspect-ratio: 1/1;
  border-radius: 50%;
  background: #ff6600;
  color: #ff9600;
  text-align: center;
  font-size: 2rem;
  line-height: 2rem;
}

.Rating input[type=radio] + label::after {
  left: 0.2rem;
  width: 1.4rem;
  transform: translateY(-50%) scale(0);
}

.Rating input[type=radio]:checked ~ label::after {
  animation: rating 2s linear infinite;
}

.Rating input[type=radio] ~ label > div::before,
.Rating input[type=radio] ~ label > div::after {
  content: "";
  position: absolute;
  width: 0;
  aspect-ratio: 1/1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: 0.5s;
}

.Rating input[type=radio]:checked ~ label > div::before {
  top: 10%;
  width: 33%;
  animation: ratingBubbles 2s linear infinite;
}

.Rating input[type=radio]:checked ~ label > div::after {
  top: 40%;
  left: 100%;
  width: 33%;
  animation: ratingBubbles 2s linear reverse infinite;
}

.Rating input[type=radio]:checked ~ label::before {
  font-size: 0;
}

.Rating input[type=radio]:checked ~ label::after {
  transform: translateY(-50%) scale(1);
}

/* Rating large */
.Rating__large input[type=radio] + label,
.Rating__large input[type=radio] + label::before {
  width: 4rem;
  font-size: 4rem;
  line-height: 4rem;
}

.Rating__large input[type=radio] + label::after {
  left: 0.4rem;
  width: 3rem;
}

/* ----------------
    Range input
   ---------------- */
.Range {
  display: flex;
  flex-direction: column-reverse;
  margin-bottom: 1rem;
}

.Range input[type=range] + label {
  display: block;
  line-height: 1.3;
  margin-bottom: 0.3rem;
}

.Range input[type=range] {
  appearance: none;
  height: 2rem;
  border-radius: 1rem;
  padding: 0.5rem;
  background: #263138;
  cursor: pointer;
}

.Range input[type=range]::-webkit-slider-thumb {
  appearance: none;
  width: 1.4rem;
  height: 1.4rem;
  cursor: pointer;
  transition: 0.5s;
  transition-timing-function: cubic-bezier(0.73, 2, 0.25, -0.7);
}

.Range input[type=range]::-moz-range-thumb {
  appearance: none;
  width: 1.4rem;
  height: 1.4rem;
  cursor: pointer;
  transition: 0.5s;
}

.Range input[type=range]:active::-webkit-slider-thumb {
  transition-timing-function: linear;
  transform: scale(1.3, 0.7);
}

.Range input[type=range]:active::-moz-range-thumb {
  animation: none;
  transform: scale(1.3, 0.7);
}

/*
@media (min-width: 500px) {
  .Range_row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
  }
  .Range_row .Range {
    width: calc(50% - .5rem);
    margin-bottom: 0;
  }
}
*/

/* Toggle large */
.Range__large input[type=range] {
  height: 4rem;
  border-radius: 2rem;
}

.Range__large input[type=range]::-webkit-slider-thumb {
  width: 3rem;
  height: 3rem;
}

.Range__large input[type=range]::-moz-range-thumb {
  width: 3rem;
  height: 3rem;
}

/* ----------------
    Toggles input
   ---------------- */
.Toggle input[type=checkbox] + label {
  padding-left: 5rem;
}

.Toggle input[type=checkbox] + label::before {
  width: 4rem;
  aspect-ratio: 2/1;
  border-radius: 1rem;
  background: #ff6600;
}

.Toggle input[type=checkbox]:checked + label::before {
  background: #dd4400;
}

.Toggle input[type=checkbox] + label::after {
  left: 0.25rem;
  width: 1.4rem;
}

.Toggle input[type=checkbox]:checked + label::after {
  animation: toggle 0.5s linear;
  transform: translate(125%, -50%);
}

/* Toggle large */
.Toggle__large input[type=checkbox] + label {
  padding-left: 9rem;
}

.Toggle__large input[type=checkbox] + label::before {
  width: 8rem;
  border-radius: 2rem;
}

.Toggle__large input[type=checkbox] + label::after {
  left: 0.5rem;
  width: 3rem;
}

/* ----------------
    Radio input
   ---------------- */
.Radio input[type=radio] + label {
  padding-left: 3rem;
}

.Radio input[type=radio] + label::before {
  width: 2rem;
  aspect-ratio: 1/1;
  border-radius: 50%;
  background: #ff6600;
}

.Radio input[type=radio] + label::after {
  left: 0.2rem;
  width: 1.4rem;
  transform: translateY(-50%) scale(0);
}

.Radio input[type=radio]:not(:checked) + label::after {
  animation: radio 0.5s linear;
}

.Radio input[type=radio]:checked + label::after {
  transform: translateY(-50%) scale(1);
}

/* Radio large */
.Radio__large input[type=radio] + label {
  padding-left: 5rem;
}

.Radio__large input[type=radio] + label::before {
  width: 4rem;
}

.Radio__large input[type=radio] + label::after {
  left: 0.4rem;
  width: 3rem;
}

/* ----------------
    Bubble display
   ---------------- */
.Toggle input[type=checkbox] + label::after,
.Radio input[type=radio] + label::after,
.Rating input[type=radio] + label::after,
.Rating input[type=radio]:checked ~ label > div::before,
.Rating input[type=radio]:checked ~ label > div::after,
.Range input[type=range]::-webkit-slider-thumb,
.Color input::-webkit-color-swatch {
  aspect-ratio: 1/1;
  border: 0.1rem solid #ff9600;
  border-radius: 50%;
  background: radial-gradient(circle at 70% 30%, #ff9600, rgba(0, 0, 0, 0) 25%), radial-gradient(circle at 60% 55%, rgba(0, 0, 0, 0) 60%, rgba(255, 0, 255, 0.8) 100%), radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0) 40%, rgba(0, 255, 255, 0.2) 60%, rgba(0, 0, 0, 0) 68%), radial-gradient(circle at 50% 55%, rgba(0, 0, 0, 0) 35%, rgba(255, 255, 0, 0.2) 45%, rgba(0, 0, 0, 0) 55%);
}

.Range input[type=range]::-moz-range-thumb {
  aspect-ratio: 1/1;
  border: 0.1rem solid #ff9600;
  border-radius: 50%;
  background: radial-gradient(circle at 70% 30%, #ff9600, transparent 25%), radial-gradient(circle at 60% 55%, transparent 60%, rgba(255, 0, 255, 0.8) 100%), radial-gradient(circle at 50% 50%, transparent 40%, rgba(0, 255, 255, 0.2) 60%, transparent 68%), radial-gradient(circle at 50% 55%, transparent 35%, rgba(255, 255, 0, 0.2) 45%, transparent 55%);
}

/* squar aspect */
.File input[type=file] + label::before {
  content: "";
  position: absolute;
  inset: 0.5rem;
  border: 0.1rem solid #ff9600;
  border-radius: 1rem;
  background: linear-gradient(rgba(0, 0, 0, 0) 5%, rgba(255, 255, 0, 0.2) 8%, rgba(0, 0, 0, 0) 15%, rgba(0, 0, 0, 0) 90%, rgba(255, 255, 0, 0.2)) no-repeat;
  box-shadow: inset -10px -10px 15px 0px rgba(0, 255, 255, 0.2), inset 5px 5px 15px -9px rgba(255, 0, 255, 0.8);
}

/* ----------------
    Animation
   ---------------- */
@keyframes toggle {
  0% {
    transform: translate(0, -50%);
  }
  25% {
    transform: translate(32%, -75%);
  }
  35% {
    transform: translate(44.8%, -75%);
  }
  65% {
    transform: translate(84.06%, -40%);
  }
  75% {
    transform: translate(96%, -40%);
  }
  100% {
    transform: translate(125%, -50%);
  }
}
@keyframes radio {
  0% {
    transform: translateY(-50%) scale(1);
  }
  100% {
    transform: translateY(-50%) scale(1.7);
  }
}
@keyframes rating {
  0%, 100% {
    top: 45%;
  }
  50% {
    top: 55%;
  }
}
@keyframes ratingBubbles {
  0%, 100% {
    transform: translate(-50%, 0%);
  }
  25% {
    transform: translate(-50%, 50%);
  }
  75% {
    transform: translate(-50%, -50%);
  }
}

