.c-form-star-rating__stars {
    position: relative;
    display: inline-flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 2px;
    padding: .5rem 0;
}

.c-form-star-rating__input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.c-form-star-rating__star {
    --color-stars: #ffe200;
    width: 24px;
    height: 24px;
    background: grey;
    cursor: pointer;
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22.888' width='24' height='24'><path d='M24,8.87c0,.211-.124.443-.374.692l-5.235,5.106,1.241,7.211c.008.067.013.164.013.29,0,.202-.05.372-.151.511-.101.141-.246.208-.44.208-.183,0-.374-.057-.576-.172l-6.476-3.403-6.476,3.403c-.21.116-.404.172-.576.172-.202,0-.353-.067-.454-.208-.101-.139-.151-.309-.151-.511,0-.059.009-.156.028-.29l1.242-7.211L.361,9.562c-.241-.26-.361-.49-.361-.692,0-.355.269-.577.808-.664l7.24-1.053L11.293.591c.183-.394.419-.591.707-.591s.524.197.707.591l3.246,6.563,7.24,1.053c.538.086.808.308.808.664Z' stroke-width='0'/></svg>");
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22.888' width='24' height='24'><path d='M24,8.87c0,.211-.124.443-.374.692l-5.235,5.106,1.241,7.211c.008.067.013.164.013.29,0,.202-.05.372-.151.511-.101.141-.246.208-.44.208-.183,0-.374-.057-.576-.172l-6.476-3.403-6.476,3.403c-.21.116-.404.172-.576.172-.202,0-.353-.067-.454-.208-.101-.139-.151-.309-.151-.511,0-.059.009-.156.028-.29l1.242-7.211L.361,9.562c-.241-.26-.361-.49-.361-.692,0-.355.269-.577.808-.664l7.24-1.053L11.293.591c.183-.394.419-.591.707-.591s.524.197.707.591l3.246,6.563,7.24,1.053c.538.086.808.308.808.664Z' stroke-width='0'/></svg>");
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

/*
 * DOM order is 5..1 and the flex direction is reversed, so a sibling
 * selector fills every star up to the hovered or selected one.
 */
.c-form-star-rating__stars:not(:hover) .c-form-star-rating__input:checked ~ .c-form-star-rating__star,
.c-form-star-rating__stars .c-form-star-rating__star:hover,
.c-form-star-rating__stars .c-form-star-rating__star:hover ~ .c-form-star-rating__star {
    background: var(--color-stars);
}

.c-form-star-rating__input:focus-visible + .c-form-star-rating__star {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.c-form-star-rating__text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
