button,
input {
    border: unset;
}

.custom-checkbox-wrapper {
    display: flex;
    position: relative;
    flex: 0 0 24px;
    justify-content: center;
    align-items: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;

    --checkbox-background: var(--assets-bg-color);
}

.custom-checkbox-wrapper input {
    opacity: 0;
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 24px;
    height: 24px;
    margin: 0;
    cursor: pointer;
}

.custom-checkbox {
    position: relative;
    width: 24px;
    height: 24px;
    border: 2px solid var(--ui-dark);
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 200ms ease;
}

.custom-checkbox-wrapper:has(input:hover) {
    background: var(--ui-light-hover);

    --checkbox-background: var(--ui-light-hover);
}

.custom-checkbox-wrapper:has(input:focus-visible) {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

.custom-checkbox::before,
.custom-checkbox::after {
    position: absolute;
    width: 3px;
    height: 0;
    background: var(--ui-dark);
    border-radius: 4px;
    content: "";
    transform-origin: left top;
}

.custom-checkbox::before {
    top: 17px;
    left: 10px;
    box-shadow: 0 0 0 3px var(--checkbox-background);
    transform: rotate(-140deg);
}

.custom-checkbox::after {
    top: 9px;
    left: 2px;
    transform: rotate(-40deg);
}

.custom-checkbox-wrapper input:checked + .custom-checkbox::after {
    height: 10px;
    animation: custom-check-short 200ms ease forwards;
}

.custom-checkbox-wrapper input:checked + .custom-checkbox::before {
    height: 24px;
    animation: custom-check-long 400ms ease forwards;
}

@keyframes custom-check-short {
    from {
        height: 0;
    }

    to {
        height: 10px;
    }
}

@keyframes custom-check-long {
    0%,
    50% {
        height: 0;
    }

    100% {
        height: 24px;
    }
}

.back-arrow-button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    border-radius: 50%;
}

.back-arrow-button:hover {
    background-color: var(--ui-light-hover);
    transform: scale(1.01);
}

.back-arrow-button:focus-visible {
    box-shadow: 0 0 0 2px var(--divider-color-blue);
    outline: none;
}

/**
 * Consistent keyboard focus indication for controls that do not provide their
 * own component-specific focus state.
 */
:where(
    button,
    select,
    [role="radio"]
):focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
}

:where(a[href]):focus-visible {
    box-shadow: 0 0 0 2px var(--focus-ring);
    outline: none;
}

:root :is(.login-footer, footer, .textbox-checkbox) a:focus-visible {
    border-radius: 3px;
}

:root .signup-btn:focus-visible {
    box-shadow:
        0 0 0 2px var(--assets-bg-color),
        0 0 0 4px var(--focus-ring);
    outline: none;
}

/** Preserve the original focus treatment of board cards and column controls. */
:root .task-card:focus-visible {
    border-color: var(--ui-dark);
    box-shadow: 0 0 10px var(--shadow-black-08);
    outline: none;
}

:root .add-column-task:focus-visible {
    box-shadow: none;
    outline: 2px solid var(--divider-color-blue);
    outline-offset: 2px;
}

/** Navigation items use their existing full-width background highlight. */
:root :is(.sidebar, .mobile-nav) a:focus-visible {
    background: var(--ui-dark-hover);
    box-shadow: inset 0 0 0 2px var(--focus-surface-translucent);
    outline: none;
}

:root :is(
    .subtask-cancel,
    .subtask-check,
    .edit-dialog-subtask,
    .save-dialog-subtask,
    .delete-dialog-subtask
):focus-visible {
    border-radius: 4px;
    outline: 2px solid var(--focus-ring);
    outline-offset: 1px;
}

:root :is(.open-task-delete, .open-task-edit):focus-visible {
    border-radius: 6px;
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

/** Form controls use their border as focus indicator and do not get a double ring. */
:root :is(
    input:not([type="checkbox"], [type="radio"]),
    textarea
):focus-visible {
    border-color: var(--form-input-border-focus);
    box-shadow: inset 0 0 0 1px var(--form-input-border-focus);
    outline: none;
}

:where(a[href], button, input, select, textarea, [tabindex]):focus:not(:focus-visible) {
    outline: none;
}

*::-webkit-scrollbar {
    width: 8px;
    height: 4px;
}

*::-webkit-scrollbar-track {
    background: var(--scrollbar-track-bg-color);
    border-radius: 999px;
    box-shadow: inset 0 0 8px var(--scrollbar-track-shadow-color);
}

*::-webkit-scrollbar-track:hover {
    background: var(--scrollbar-track-hover-color);
}

*::-webkit-scrollbar-track:active {
    background: var(--scrollbar-track-active-color);
}

*::-webkit-scrollbar-thumb {
    min-height: 50px;
    background: linear-gradient(180deg, var(--scrollbar-primary-thumb-color), var(--scrollbar-secondary-thumb-color), var(--scrollbar-tertiary-thumb-color));
    border: 1px solid var(--scrollbar-thumb-border-color);
    border-radius: 999px;
    box-shadow:
        0 0 10px var(--scrollbar-primary-thumb-shadow-color),
        0 0 18px var(--scrollbar-secondary-thumb-shadow-color);
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover-color);
}

*::-webkit-scrollbar-thumb:active {
    background: var(--scrollbar-thumb-active-color);
}

*::-webkit-scrollbar-corner {
    background: var(--transparent);
}

*::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

@media (width <=480px) {
    * {
        scrollbar-width: thin;
    }

    *::-webkit-scrollbar {
        width: 4px;
        height: 4px;
    }
}
