/// @access private
/// @param {Boolean} $disabled Whether to output disabled state styling
/// @output Styling for box-styled radio inputs
@mixin _oFormsRadioRound($disabled: null, $themes: ()) {
	.o-forms-input--radio-round {
		.o-forms-input__label {
			padding: 0 0 0 $_o-forms-spacing-controls;
			display: inline-block;

			&:before,
			&:after {
				@include _oFormsControlsPseudoElements;
				border-radius: 50%;
				transition: opacity 0.1s ease-in;
				background-color: _oFormsGet('radio-background');
			}

			&:before {
				border: $_o-forms-border;
			}

			&:after {
				background-color: _oFormsGet('controls-base');
				border-radius: 50%;
				height: $_o-forms-spacing-three;
				width: $_o-forms-spacing-three;
				margin: div($_o-forms-spacing-three, 2);
				opacity: 0;
				@media screen and (-ms-high-contrast: active) {
					background-color: windowText;
				}
			}
		}

		input[type='radio'] {
			@include _oFormsControlsBase($disabled);

			&:checked + .o-forms-input__label:before {
				border-color: _oFormsGet('controls-base');
			}

			&:focus {
				@include oPrivateNormaliseFocusUnsetContent();
				& + .o-forms-input__label:before {
					@include oPrivateNormaliseFocusContent();
				}
			}

			// Unset :focus styles where :focus-visible is supported.
			// Ideally we would set `:focus-visible` by default and use
			// `@supports not selector(:focus-visible)` to provide a
			// `:focus` fallback, however some of our supported browsers
			// do not understand `@supports: selector()`.
			@supports selector(:focus-visible) {
				&:focus + .o-forms-input__label:before {
					@include oPrivateNormaliseFocusUnsetContent();
				}

				&:focus-visible {
					& + .o-forms-input__label:before {
						@include oPrivateNormaliseFocusContent();
					}
				}
			}
		}
	}

	@each $theme in $themes {
		@if _oFormsSupports('#{$theme}') {
			.o-forms-field--#{$theme} {
				@include _oFormsRadioRoundThemeContent($theme);
			}
		}
	}
}

/// Output styles required to set a checkbox theme.
/// @param {String} $theme Theme to output
@mixin _oFormsRadioRoundThemeContent($theme) {
	color: _oFormsGet('default-text', $theme);

	.o-forms-input--radio-round {
		input[type='radio'] {
			&:checked + .o-forms-input__label:before {
				border-color: _oFormsGet('controls-base', $theme);
			}
		}
		.o-forms-input__label {
			&:before {
				border: 1px solid _oFormsGet('default-border', $theme);
			}

			&:after {
				background-color: _oFormsGet('controls-base', $theme);
			}
		}
	}

	@if $theme and
		oPrivateColorsColorBrightness(_oFormsGet('default-text', $theme)) >
		65%
	{
		input[type='radio'] {
			&:focus {
				@include oPrivateNormaliseFocusUnsetContent();
				& + .o-forms-input__label:before {
					@include oPrivateNormaliseFocusContentInverse();
				}
			}

			// Unset :focus styles where :focus-visible is supported.
			// Ideally we would set `:focus-visible` by default and use
			// `@supports not selector(:focus-visible)` to provide a
			// `:focus` fallback, however some of our supported browsers
			// do not understand `@supports: selector()`.
			@supports selector(:focus-visible) {
				&:focus + .o-forms-input__label:before {
					@include oPrivateNormaliseFocusUnsetContent();
				}

				&:focus-visible {
					& + .o-forms-input__label:before {
						@include oPrivateNormaliseFocusContentInverse();
					}
				}
			}
		}
	}
}
