.root {
  position: relative;
  box-sizing: border-box;
}

.root input {
  position: absolute;
  opacity: 0;
  width: 1em;
  height: 1em;
  margin: 0;
}

.star {
  transition: color 150ms;
}

.root input + label {
  margin: 0;
  padding: var(--size-medium);
  line-height: 1;
  border: 1px solid var(--color-greyLighter);
  display: block;
  cursor: pointer;
}

.root input:checked + label:before,
.active input + label:before {
  content: '';
  height: 5px;
  width: 98%;
  top: calc(100% - 5px);
  box-shadow: 0 2px 4px 0 var(--color-greyLightest);
  position: absolute;
  left: 1%;
  z-index: 0;
  pointer-events: none;
}

.root input + label .star {
  color: var(--color-greyLighter);
}

.root input + label:hover {
  box-shadow: inset 0 0 2px var(--color-transparent-black-iv);
}

.root input + label:hover:before {
  content: none;
}

.root input + label:hover .star,
.root input:checked + label .star,
.active input + label .star {
  color: var(--color-primary);
}

.root input:focus + label {
  outline-color: var(--color-focusRing);
  outline-style: auto;
  outline-width: 5px;
}

.root input:checked + label .star svg,
.active .star svg {
  fill: currentColor;
}