.radio {
    --size-default: 14px;
    line-height: 1.5;
}

.radio input {
    position: absolute;
    opacity: 0;
}

.radio input + label {
    display: inline-flex;
    flex-direction: column;
    font-size: var(--size-default);
    margin-right: var(--space-half);
    padding-left: calc(var(--space-half) + var(--space-quarter));
    position: relative;
}

.radio input + label::before,
.radio input + label::after {
    background: var(--background-secondary);
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    position: absolute;
    top: 4px;
    left: 0;
    transition: all 100ms ease;
}

.radio input + label::before {
    border: 1px solid var(--background-tertiary);
    border-radius: 1em;
}

.radio input + label::after {
    background: var(--color-blue);
    border-radius: 1em;
    width: 10px;
    height: 10px;
    position: absolute;
    top: 6px;
    left: 2px;
    opacity: 0;
    transform: scale(0);
}

/* checked */

.radio input:checked + label::before {
    background-color: var(--background-secondary);
}

.radio input:checked + label::after {
    opacity: 1;
    transform: scale(1);
}

/* focus */

.radio input[type="radio"]:focus + label::before {
    box-shadow: 0px 0px 2px 2px var(--color-blue);
    outline: none;
    outline-offset: 0;
}

.radio input[type="radio"]:checked:focus + label::before {
    box-shadow: 0px 0px 2px 2px var(--color-blue);
}


/* disabled */

.radio input:disabled + label::before {
    background: rgb(248, 248, 248);
    border-color: rgb(220, 220, 220);
    cursor: not-allowed;
}
