/* Lumen.UI.Mvc - ui-inputs.css. TextBox, TextArea, NumericTextBox, CheckBox, RadioButton, Switch.
   Linked by @Html.UiStyles() (not loaded on demand) so server-rendered form fields are styled at once.
   Floating labels, the clear button and every toggle state are pure CSS: they work before any script.
   Colours come from the shared --ui-* tokens in ui-core.css. Sizes and colours of the defaults are those
   of Syncfusion's Fluent 2 theme (e-input-group, e-checkbox-wrapper, e-radio, e-switch-wrapper). */

/* Fluent 2 values that have no shared token. The other themes reset them, so there every rule falls back
   to the theme's own tokens. */
:root {
    --ui-placeholder: #707070;
    --ui-input-icon: #424242;
    --ui-input-hover-border: #c7c7c7;      /* sides and top while hovered; the bottom line stays */
    --ui-input-hover-underline: #616161;
    --ui-input-disabled-sides: transparent; /* disabled: only the bottom line is left */
    --ui-input-disabled-line: #e0e0e0;
    --ui-input-disabled-bg: #ffffff;
    --ui-input-readonly-bg: #ffffff;
    --ui-float-label-focus: #242424;       /* a floated label stays in the text colour */
    --ui-toggle-hover-border: #575757;
    --ui-toggle-disabled-border: #e0e0e0;
    --ui-toggle-bg: #fafafa;            /* unchecked checkbox / radio button */
}

.ui-theme-fluent2-dark,
.ui-theme-bootstrap5,
.ui-theme-bootstrap5-dark,
.ui-theme-material3,
.ui-theme-material3-dark,
.ui-theme-tailwind,
.ui-theme-tailwind-dark,
.ui-theme-fabric,
.ui-theme-highcontrast {
    --ui-placeholder: initial;
    --ui-input-icon: initial;
    --ui-input-hover-border: initial;
    --ui-input-hover-underline: initial;
    --ui-input-disabled-sides: initial;
    --ui-input-disabled-line: initial;
    --ui-input-disabled-bg: initial;
    --ui-input-readonly-bg: initial;
    --ui-float-label-focus: initial;
    --ui-toggle-hover-border: initial;
    --ui-toggle-disabled-border: initial;
    --ui-toggle-bg: initial;
}

/* ---------- text box, text area, numeric text box ---------- */

.ui-input-control {
    --ui-input-height: 32px;
    position: relative;
    display: block;
    box-sizing: border-box;
    width: 100%;
    color: var(--ui-text);
    font-family: var(--ui-font);
    font-size: var(--ui-font-size);
    color-scheme: var(--ui-color-scheme);
}

.ui-input-control.ui-input-small { --ui-input-height: 26px; }
.ui-input-control.ui-input-large { --ui-input-height: 40px; }

/* Room above the box for a label that is (or floats) there. */
.ui-float-auto,
.ui-float-always {
    padding-top: 20px;
}

.ui-input-group {
    position: relative;
    display: flex;
    align-items: stretch;
    box-sizing: border-box;
    min-height: var(--ui-input-height);
    border: 1px solid var(--ui-input-border);
    border-bottom-color: var(--ui-input-underline);
    border-radius: var(--ui-radius);
    background: var(--ui-surface);
    transition: border-color 0.1s ease;
}

.ui-input-group:hover {
    border-color: var(--ui-input-hover-border, var(--ui-input-border));
    border-bottom-color: var(--ui-input-hover-underline, var(--ui-text));
}

/* Focus, as Syncfusion's: a 2px accent line grows from the middle of the bottom edge to both sides. */
.ui-input-group::before,
.ui-input-group::after {
    content: "";
    position: absolute;
    bottom: -1px;
    width: 0;
    height: 2px;
    background: var(--ui-accent);
    pointer-events: none;
    transition: width 0.2s cubic-bezier(0.4, 0, 0.4, 1);
}

.ui-input-group::before {
    left: 50%;
    border-bottom-right-radius: var(--ui-radius);
}

.ui-input-group::after {
    right: 50%;
    border-bottom-left-radius: var(--ui-radius);
}

.ui-input-group:focus-within::before,
.ui-input-group:focus-within::after {
    width: 50%;
}

/* MVC (and jQuery unobtrusive validation) put input-validation-error on an invalid field. */
.ui-input-group:has(.input-validation-error) {
    border-color: var(--ui-danger-solid, var(--ui-danger));
}

.ui-input-group:has(.input-validation-error)::before,
.ui-input-group:has(.input-validation-error)::after {
    background: var(--ui-danger-solid, var(--ui-danger));
}

/* Variants (CssClass = "ui-input-outlined" / "ui-input-filled"): Syncfusion's Outlined and Filled text boxes. */
.ui-input-outlined .ui-input-group {
    border: 1px solid var(--ui-input-border);
    border-radius: calc(var(--ui-radius) + 2px);
}

.ui-input-outlined .ui-input-group:hover {
    border-color: var(--ui-input-hover-border, var(--ui-text));
}

.ui-input-outlined .ui-input-group:focus-within {
    border-color: var(--ui-accent);
    box-shadow: 0 0 0 1px var(--ui-accent);
}

.ui-input-outlined .ui-input-group::before,
.ui-input-outlined .ui-input-group::after {
    display: none;
}

.ui-input-filled .ui-input-group {
    border-color: transparent;
    border-bottom-color: var(--ui-input-underline, var(--ui-input-border));
    border-radius: var(--ui-radius) var(--ui-radius) 0 0;
    background: color-mix(in srgb, var(--ui-text) 7%, var(--ui-surface));
}

.ui-input-filled .ui-input-group:hover {
    background: color-mix(in srgb, var(--ui-text) 11%, var(--ui-surface));
}

/* States (CssClass = "ui-input-success" / "ui-input-warning" / "ui-input-error"): the colour of the line and of the focus line. */
.ui-input-success .ui-input-group { border-color: var(--ui-success-solid, #107c10); }
.ui-input-warning .ui-input-group { border-color: var(--ui-warning-solid, #c75a00); }
.ui-input-error .ui-input-group { border-color: var(--ui-danger-solid, var(--ui-danger)); }

.ui-input-success .ui-input-group::before,
.ui-input-success .ui-input-group::after { background: var(--ui-success-solid, #107c10); }
.ui-input-warning .ui-input-group::before,
.ui-input-warning .ui-input-group::after { background: var(--ui-warning-solid, #c75a00); }
.ui-input-error .ui-input-group::before,
.ui-input-error .ui-input-group::after { background: var(--ui-danger-solid, var(--ui-danger)); }

/* Disabled: Fluent 2 keeps only a light bottom line; the other themes grey the box. */
.ui-input-disabled .ui-input-group {
    border-color: var(--ui-input-disabled-sides, var(--ui-button-disabled-bg));
    border-bottom-color: var(--ui-input-disabled-line, var(--ui-button-disabled-bg));
    background: var(--ui-input-disabled-bg, var(--ui-button-disabled-bg));
    color: var(--ui-disabled);
}

.ui-input-disabled .ui-input-group::before,
.ui-input-disabled .ui-input-group::after {
    display: none;
}

.ui-input-readonly .ui-input-group {
    background: var(--ui-input-readonly-bg, var(--ui-row-hover-bg));
}

.ui-input {
    flex: 1 1 auto;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: 0 8px;
    border: 0;
    outline: 0;
    border-radius: var(--ui-radius);
    background: transparent;
    box-shadow: none;
    color: inherit;
    font: inherit;
}

input.ui-input {
    height: calc(var(--ui-input-height) - 2px);
}

textarea.ui-input {
    display: block;
    min-height: max(34px, calc(var(--ui-input-height) - 2px));
    padding: 4px 8px 4px 12px;
    line-height: 1.5;
    resize: vertical;
}

.ui-resize-horizontal textarea.ui-input { resize: horizontal; }
.ui-resize-both textarea.ui-input { resize: both; }
.ui-resize-none textarea.ui-input { resize: none; }

.ui-input::placeholder {
    color: var(--ui-placeholder, var(--ui-muted));
    opacity: 1;
}

.ui-input:disabled {
    color: var(--ui-disabled);
    cursor: not-allowed;
}

.ui-input::-ms-reveal,
.ui-input::-ms-clear {
    display: none; /* Edge's own password eye / clear: the control has its own */
}

.ui-input-prefix,
.ui-input-suffix {
    display: flex;
    flex: none;
    align-items: center;
    color: var(--ui-muted);
    white-space: nowrap;
    user-select: none;
}

.ui-input-prefix { padding-left: 8px; }
.ui-input-suffix { padding-right: 8px; }
.ui-input-prefix + .ui-input { padding-left: 4px; }
.ui-input-group:has(.ui-input-suffix) .ui-input { padding-right: 4px; }

/* PrependTemplate / AppendTemplate (Syncfusion's adornments): icons, separators and buttons inside the box. */
.ui-input-prepend,
.ui-input-append {
    display: flex;
    flex: none;
    align-items: center;
    gap: 6px;
    color: var(--ui-muted);
    white-space: nowrap;
}

.ui-input-prepend { padding-left: 8px; }
.ui-input-append { padding-right: 8px; }
.ui-input-prepend + .ui-input,
.ui-input-prepend + .ui-input-prefix { padding-left: 6px; }

/* A thin line between an adornment and the value (Syncfusion's e-input-separator). */
.ui-input-separator {
    align-self: stretch;
    width: 1px;
    margin: 6px 0;
    background: var(--ui-border);
}

.ui-textarea .ui-input-prepend,
.ui-textarea .ui-input-append {
    align-self: flex-start;
    padding-top: 6px;
}

/* ---------- buttons inside the box (clear, password eye, numeric spin) ---------- */

.ui-input-button {
    position: relative;
    flex: none;
    align-self: center;
    width: 28px;
    height: min(28px, calc(var(--ui-input-height) - 6px));
    margin: 0 2px;
    padding: 0;
    border: 0;
    border-radius: var(--ui-radius);
    background: transparent;
    color: var(--ui-input-icon, var(--ui-muted));
    cursor: pointer;
}

.ui-input-button:last-child {
    margin-right: 4px;
}

/* Syncfusion's clear icon is a round 28px button. */
.ui-input-clear {
    border-radius: 999px;
}

.ui-input-button::before {
    content: "";
    position: absolute;
    inset: 0;
    width: 14px;
    height: 14px;
    margin: auto;
    background-color: currentColor;
    -webkit-mask: no-repeat center / contain;
    mask: no-repeat center / contain;
}

.ui-input-button:hover {
    background: color-mix(in srgb, var(--ui-text) 8%, transparent);
    color: var(--ui-input-icon, var(--ui-text));
}

.ui-input-button:active {
    background: transparent;
    color: var(--ui-muted);
}

.ui-input-button:focus-visible {
    outline: 2px solid var(--ui-accent);
    outline-offset: -2px;
}

/* Clear button: only while the box has a value and is hovered or focused. */
.ui-input-clear {
    visibility: hidden;
}

.ui-input-group:hover .ui-input:not(:placeholder-shown) ~ .ui-input-clear,
.ui-input-group:focus-within .ui-input:not(:placeholder-shown) ~ .ui-input-clear {
    visibility: visible;
}

.ui-textarea .ui-input-clear {
    align-self: flex-start;
    margin-top: 2px;
}

.ui-input-clear::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2.5 2.5l9 9M11.5 2.5l-9 9' stroke='%23000' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2.5 2.5l9 9M11.5 2.5l-9 9' stroke='%23000' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.ui-input-eye::before {
    width: 16px;
    height: 16px;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17a5 5 0 1 1 0-10 5 5 0 0 1 0 10zm0-8a3 3 0 1 0 0 6 3 3 0 0 0 0-6z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17a5 5 0 1 1 0-10 5 5 0 0 1 0 10zm0-8a3 3 0 1 0 0 6 3 3 0 0 0 0-6z'/%3E%3C/svg%3E");
}

/* Characters shown: the eye is crossed out. */
.ui-input-eye[aria-pressed="true"]::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 7a5 5 0 0 1 5 5c0 .65-.13 1.26-.36 1.83l2.92 2.92A11.8 11.8 0 0 0 23 12c-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46A11.8 11.8 0 0 0 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55A3 3 0 0 0 9 12a3 3 0 0 0 3 3c.22 0 .44-.03.65-.08l1.55 1.55A5 5 0 0 1 7.53 9.8zm4.31-.78 3.15 3.15.02-.16a3 3 0 0 0-3-3l-.17.01z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 7a5 5 0 0 1 5 5c0 .65-.13 1.26-.36 1.83l2.92 2.92A11.8 11.8 0 0 0 23 12c-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46A11.8 11.8 0 0 0 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55A3 3 0 0 0 9 12a3 3 0 0 0 3 3c.22 0 .44-.03.65-.08l1.55 1.55A5 5 0 0 1 7.53 9.8zm4.31-.78 3.15 3.15.02-.16a3 3 0 0 0-3-3l-.17.01z'/%3E%3C/svg%3E");
}

.ui-numeric-spin {
    display: flex;
    flex: none;
    align-items: center;
}

.ui-numeric-spin .ui-input-button {
    width: 24px;
    margin: 0 1px;
}

.ui-numeric-up::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3 9l4-4 4 4' fill='none' stroke='%23000' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3 9l4-4 4 4' fill='none' stroke='%23000' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.ui-numeric-down::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3 5l4 4 4-4' fill='none' stroke='%23000' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3 5l4 4 4-4' fill='none' stroke='%23000' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.ui-numeric .ui-input {
    font-variant-numeric: tabular-nums;
}

/* ---------- labels ---------- */

.ui-float-label {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1; /* above the box, which is positioned for its focus line */
    max-width: 100%;
    overflow: hidden;
    color: var(--ui-float-label-focus, var(--ui-muted));
    font-size: calc(var(--ui-font-size) * 0.92); /* Syncfusion: the resting label scaled to 0.92 */
    line-height: 20px;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: top 0.25s cubic-bezier(0.25, 0.8, 0.25, 1), left 0.25s cubic-bezier(0.25, 0.8, 0.25, 1),
        font-size 0.25s cubic-bezier(0.25, 0.8, 0.25, 1), color 0.25s ease;
}

.ui-input-control:focus-within .ui-float-label {
    color: var(--ui-float-label-focus, var(--ui-accent));
}

.ui-input-control:has(.input-validation-error) .ui-float-label {
    color: var(--ui-danger);
}

.ui-input-disabled .ui-float-label {
    color: var(--ui-disabled);
}

.ui-required::after {
    content: " *";
    color: var(--ui-danger);
}

/* Auto: while the box is empty and not focused, the label rests inside it like a placeholder. */
.ui-float-auto:not(:focus-within):has(.ui-input:placeholder-shown) .ui-float-label {
    top: calc(20px + var(--ui-input-height) / 2 - 10px);
    left: 9px;
    max-width: calc(100% - 18px);
    color: var(--ui-placeholder, var(--ui-muted));
    font-size: var(--ui-font-size);
    pointer-events: none;
}

.ui-textarea.ui-float-auto:not(:focus-within):has(.ui-input:placeholder-shown) .ui-float-label {
    top: 25px;
    left: 13px;
}

/* The resting label takes the placeholder's place; the placeholder shows once focused. */
.ui-float-auto .ui-input::placeholder {
    color: transparent;
}

.ui-float-auto .ui-input:focus::placeholder {
    color: var(--ui-placeholder, var(--ui-muted));
}

.ui-textarea-counter {
    margin-top: 4px;
    color: var(--ui-muted);
    font-size: 12px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.ui-textarea-counter.ui-textarea-full {
    color: var(--ui-danger);
}

/* ---------- checkbox, radio button, switch (Syncfusion e-checkbox-wrapper, e-radio, e-switch-wrapper) ---------- */

.ui-toggle {
    --ui-toggle-box: 16px;
    --ui-track-width: 40px;
    --ui-track-height: 20px;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
    margin: 0;
    color: var(--ui-text);
    font-family: var(--ui-font);
    font-size: var(--ui-font-size);
    line-height: 20px;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    color-scheme: var(--ui-color-scheme);
}

/* Syncfusion: 8px between the box and its label for radios and switches, 12px for checkboxes. */
.ui-checkbox.ui-toggle {
    gap: 12px;
}

.ui-toggle.ui-input-small { --ui-toggle-box: 14px; --ui-track-width: 32px; --ui-track-height: 16px; min-height: 24px; }
.ui-toggle.ui-input-large { --ui-toggle-box: 20px; --ui-track-width: 48px; --ui-track-height: 24px; min-height: 36px; }

.ui-label-before {
    flex-direction: row-reverse;
}

.ui-toggle.ui-input-disabled {
    color: var(--ui-disabled);
    cursor: not-allowed;
}

/* The real input stays in the page (focusable, posted, read by screen readers) but invisible;
   the spans after it draw the control. */
.ui-toggle-input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.ui-toggle-input:focus-visible ~ .ui-checkbox-box,
.ui-toggle-input:focus-visible ~ .ui-radio-circle,
.ui-toggle-input:focus-visible ~ .ui-switch-track {
    outline: 2px solid var(--ui-accent);
    outline-offset: 2px;
}

/* checkbox */

.ui-checkbox-box,
.ui-radio-circle {
    position: relative;
    flex: none;
    box-sizing: border-box;
    width: var(--ui-toggle-box);
    height: var(--ui-toggle-box);
    border: 1px solid var(--ui-input-underline);
    background: var(--ui-toggle-bg, var(--ui-surface));
    transition: background-color 0.1s ease, border-color 0.1s ease;
}

.ui-checkbox-box {
    border-radius: calc(var(--ui-radius) / 2);
}

.ui-toggle:not(.ui-input-disabled):hover .ui-checkbox-box,
.ui-toggle:not(.ui-input-disabled):hover .ui-radio-circle {
    border-color: var(--ui-toggle-hover-border, var(--ui-text));
}

.ui-checkbox-box::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: var(--ui-on-accent);
    -webkit-mask: no-repeat center / 70%;
    mask: no-repeat center / 70%;
    opacity: 0;
}

.ui-toggle-input:checked ~ .ui-checkbox-box,
.ui-toggle:not(.ui-input-disabled):hover .ui-toggle-input:checked ~ .ui-checkbox-box {
    border-color: var(--ui-accent);
    background: var(--ui-accent);
}

.ui-toggle:not(.ui-input-disabled):hover .ui-toggle-input:checked ~ .ui-checkbox-box {
    border-color: var(--ui-accent-hover);
    background: var(--ui-accent-hover);
}

/* A thin check mark, like Fluent 2's icon. */
.ui-toggle-input:checked ~ .ui-checkbox-box::after {
    opacity: 1;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.3l2.6 2.6L10 3.5' fill='none' stroke='%23000' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.3l2.6 2.6L10 3.5' fill='none' stroke='%23000' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Indeterminate, as Syncfusion's e-stop: an accent border and a small accent square on the normal background. */
.ui-toggle-input:indeterminate ~ .ui-checkbox-box,
.ui-toggle:not(.ui-input-disabled):hover .ui-toggle-input:indeterminate ~ .ui-checkbox-box {
    border-color: var(--ui-accent);
    background: var(--ui-surface);
}

.ui-toggle-input:indeterminate ~ .ui-checkbox-box::after {
    inset: 3px;
    border-radius: 1px;
    background-color: var(--ui-accent);
    -webkit-mask: none;
    mask: none;
    opacity: 1;
}

.ui-toggle:not(.ui-input-disabled):hover .ui-toggle-input:indeterminate ~ .ui-checkbox-box {
    border-color: var(--ui-accent-hover);
}

/* radio button */

.ui-radio-circle {
    border-radius: 50%;
}

.ui-radio-circle::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 50%;
    height: 50%;
    margin: auto;
    border-radius: 50%;
    background: var(--ui-accent);
    transform: scale(0);
    transition: transform 0.1s ease;
}

.ui-toggle-input:checked ~ .ui-radio-circle,
.ui-toggle:not(.ui-input-disabled):hover .ui-toggle-input:checked ~ .ui-radio-circle {
    border-color: var(--ui-accent);
}

.ui-toggle:not(.ui-input-disabled):hover .ui-toggle-input:checked ~ .ui-radio-circle {
    border-color: var(--ui-accent-hover);
}

.ui-toggle:not(.ui-input-disabled):hover .ui-toggle-input:checked ~ .ui-radio-circle::after {
    background: var(--ui-accent-hover);
}

.ui-toggle-input:checked ~ .ui-radio-circle::after {
    transform: scale(1);
}

/* switch: a 14px handle in a 40 x 20 track, 2px from the border. */

.ui-switch-track {
    position: relative;
    flex: none;
    box-sizing: border-box;
    width: var(--ui-track-width);
    height: var(--ui-track-height);
    overflow: hidden;
    border: 1px solid var(--ui-input-underline);
    border-radius: calc(var(--ui-track-height) / 2);
    background: transparent;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

.ui-toggle:not(.ui-input-disabled):hover .ui-switch-track {
    border-color: var(--ui-toggle-hover-border, var(--ui-text));
}

.ui-switch-thumb {
    position: absolute;
    top: 50%;
    left: 2px;
    z-index: 1;
    width: calc(var(--ui-track-height) - 6px);
    height: calc(var(--ui-track-height) - 6px);
    border-radius: 50%;
    background: var(--ui-input-underline);
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.14), 0 0 2px 0 rgba(0, 0, 0, 0.12);
    transform: translateY(-50%);
    transition: left 0.2s linear, background-color 0.2s linear;
}

.ui-toggle:not(.ui-input-disabled):hover .ui-switch-thumb {
    background: var(--ui-toggle-hover-border, var(--ui-text));
}

.ui-toggle-input:checked ~ .ui-switch-track {
    border-color: var(--ui-accent);
    background: var(--ui-accent);
}

.ui-toggle:not(.ui-input-disabled):hover .ui-toggle-input:checked ~ .ui-switch-track {
    border-color: var(--ui-accent-hover);
    background: var(--ui-accent-hover);
}

.ui-toggle-input:checked ~ .ui-switch-track .ui-switch-thumb,
.ui-toggle:not(.ui-input-disabled):hover .ui-toggle-input:checked ~ .ui-switch-track .ui-switch-thumb {
    left: calc(100% - 2px - (var(--ui-track-height) - 6px));
    background: var(--ui-on-accent);
}

.ui-switch-texts {
    --ui-track-width: 56px;
}

.ui-switch-on,
.ui-switch-off {
    position: absolute;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    font-size: 12px;
    line-height: 1;
}

.ui-switch-on {
    left: 7px;
    color: var(--ui-on-accent);
    visibility: hidden;
}

.ui-switch-off {
    right: 7px;
    color: var(--ui-text);
}

.ui-toggle-input:checked ~ .ui-switch-track .ui-switch-on { visibility: visible; }
.ui-toggle-input:checked ~ .ui-switch-track .ui-switch-off { visibility: hidden; }

/* disabled and invalid toggles: as Syncfusion, outlines only, in the light disabled colours. */

.ui-toggle-input:disabled ~ .ui-checkbox-box,
.ui-toggle-input:disabled ~ .ui-radio-circle,
.ui-toggle-input:disabled ~ .ui-switch-track,
.ui-toggle:not(.ui-input-disabled):hover .ui-toggle-input:disabled ~ .ui-checkbox-box,
.ui-toggle:not(.ui-input-disabled):hover .ui-toggle-input:disabled ~ .ui-radio-circle,
.ui-toggle:not(.ui-input-disabled):hover .ui-toggle-input:disabled ~ .ui-switch-track {
    border-color: var(--ui-toggle-disabled-border, var(--ui-disabled));
    background: transparent;
}

.ui-toggle-input:disabled:checked ~ .ui-checkbox-box::after {
    background-color: var(--ui-disabled);
}

.ui-toggle-input:disabled:indeterminate ~ .ui-checkbox-box::after,
.ui-toggle-input:disabled:checked ~ .ui-radio-circle::after {
    background: var(--ui-disabled);
}

.ui-toggle-input:disabled:checked ~ .ui-radio-circle {
    border-color: var(--ui-disabled);
}

.ui-toggle-input:disabled ~ .ui-switch-track .ui-switch-thumb,
.ui-toggle-input:disabled:checked ~ .ui-switch-track .ui-switch-thumb {
    background: var(--ui-toggle-disabled-border, var(--ui-disabled));
    box-shadow: none;
}

.ui-toggle-input:disabled ~ .ui-switch-track .ui-switch-on,
.ui-toggle-input:disabled ~ .ui-switch-track .ui-switch-off {
    color: var(--ui-disabled);
}

.ui-toggle-input.input-validation-error ~ .ui-checkbox-box,
.ui-toggle-input.input-validation-error ~ .ui-radio-circle,
.ui-toggle-input.input-validation-error ~ .ui-switch-track {
    border-color: var(--ui-danger-solid, var(--ui-danger));
}

/* radio button list */

.ui-radiogroup {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    color: var(--ui-text);
    font-family: var(--ui-font);
    font-size: var(--ui-font-size);
}

.ui-radiogroup-legend {
    float: none;
    width: auto;
    margin: 0 0 2px;
    padding: 0;
    color: var(--ui-text);
    font-size: var(--ui-font-size);
    font-weight: 600;
    line-height: 20px;
}

.ui-radiogroup-items {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.ui-radiogroup-horizontal .ui-radiogroup-items {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 2px 24px;
}

@media (prefers-reduced-motion: reduce) {
    .ui-float-label,
    .ui-input-group::before,
    .ui-input-group::after,
    .ui-switch-thumb,
    .ui-radio-circle::after {
        transition: none;
    }
}
