.matter-radio {
    --matter-helper-theme: var(--matter-theme-rgb, var(--matter-primary-rgb, 33, 150, 243));
    z-index: 0;
    position: relative;
    display: inline-block;
    color: rgba(var(--matter-onsurface-rgb, 0, 0, 0), 0.87);
    font-family: var(--matter-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);
    font-size: 16px;
    line-height: 1.5;
}

/* Circle */
.matter-radio > input {
    appearance: none;
    -moz-appearance: none;
    -webkit-appearance: none;
    z-index: 1;
    position: absolute;
    display: block;
    box-sizing: border-box;
    margin: 2px 0;
    border: solid 2px; /* Safari */
    border-color: rgba(var(--matter-onsurface-rgb, 0, 0, 0), 0.6);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

/* Span */
.matter-radio > input + span {
    display: inline-block;
    box-sizing: border-box;
    padding-left: 30px;
    width: inherit;
    cursor: pointer;
}

/* Highlight */
.matter-radio > input + span::before {
    content: "";
    position: absolute;
    left: -10px;
    top: -8px;
    display: block;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    background-color: rgb(var(--matter-onsurface-rgb, 0, 0, 0));
    opacity: 0;
    transform: scale(0);
    pointer-events: none;
    transition: opacity 0.3s, transform 0.2s;
}

/* Check Mark */
.matter-radio > input + span::after {
    content: "";
    display: block;
    position: absolute;
    top: 2px;
    left: 0;
    border-radius: 50%;
    width: 10px;
    height: 10px;
    background-color: rgb(var(--matter-helper-theme));
    transform: translate(5px, 5px) scale(0);
    transition: transform 0.2s;
}

/* Checked */
.matter-radio > input:checked {
    border-color: rgb(var(--matter-helper-theme));
}

.matter-radio > input:checked + span::before {
    background-color: rgb(var(--matter-helper-theme));
}

.matter-radio > input:checked + span::after {
    transform: translate(5px, 5px) scale(1);
}

/* Hover, Focus */
.matter-radio:hover > input + span::before {
    transform: scale(1);
    opacity: 0.04;
}

.matter-radio > input:focus + span::before  {
    transform: scale(1);
    opacity: 0.12;
}

.matter-radio:hover > input:focus + span::before {
    transform: scale(1);
    opacity: 0.16;
}

/* Active */
.matter-radio:active > input {
    border-color: rgb(var(--matter-helper-theme));
}

.matter-radio:active > input + span::before,
.matter-radio:active:hover > input + span::before {
    opacity: 1;
    transform: scale(0);
    transition: transform 0s, opacity 0s;
}

/* Disabled */
.matter-radio > input:disabled {
    border-color: rgba(var(--matter-onsurface-rgb, 0, 0, 0), 0.38);
    cursor: initial;
}

.matter-radio > input:disabled + span {
    color: rgba(var(--matter-onsurface-rgb, 0, 0, 0), 0.38);
    cursor: initial;
}

.matter-radio > input:disabled + span::before {
    opacity: 0;
    transform: scale(0);
}

.matter-radio > input:disabled + span::after {
    background-color: currentColor;
}
