input[type="checkbox"],
input[type="date"],
input[type="datetime-local"],
input[type="email"],
input[type="month"],
input[type="number"],
input[type="password"],
input[type="radio"],
input[type="search"],
input[type="tel"],
input[type="text"],
input[type="time"],
input[type="url"],
input[type="week"],
select,
textarea {
    background: #ffffff;
    border: 0.125rem solid #000000;
}

input[type="checkbox"]:disabled,
input[type="date"]:disabled,
input[type="datetime-local"]:disabled,
input[type="email"]:disabled,
input[type="month"]:disabled,
input[type="number"]:disabled,
input[type="password"]:disabled,
input[type="radio"]:disabled,
input[type="search"]:disabled,
input[type="tel"]:disabled,
input[type="text"]:disabled,
input[type="time"]:disabled,
input[type="url"]:disabled,
input[type="week"]:disabled,
select:disabled,
textarea:disabled {
    background-color: lightgrey;
    border-color: darkgray;
}

input[type="checkbox"][readonly],
input[type="date"][readonly],
input[type="datetime-local"][readonly],
input[type="email"][readonly],
input[type="month"][readonly],
input[type="number"][readonly],
input[type="password"][readonly],
input[type="radio"][readonly],
input[type="search"][readonly],
input[type="tel"][readonly],
input[type="text"][readonly],
input[type="time"][readonly],
input[type="url"][readonly],
input[type="week"][readonly],
select[readonly],
textarea[readonly] {
    background-color: lightgrey;
    border-color: darkgray;
}

input[type="date"],
input[type="datetime-local"],
input[type="email"],
input[type="file"],
input[type="month"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="text"],
input[type="time"],
input[type="url"],
input[type="week"],
select,
textarea {
    max-width: 25rem;
    width: 100%;
}

input[type="date"],
input[type="datetime-local"],
input[type="email"],
input[type="month"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="text"],
input[type="time"],
input[type="url"],
input[type="week"],
select,
textarea {
    padding: 0.5rem;
}

input[type="file"] {
    padding: 0.5rem 0;
}

input[type="checkbox"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="email"]:focus,
input[type="month"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="radio"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="text"]:focus,
input[type="time"]:focus,
input[type="url"]:focus,
input[type="week"]:focus,
select:focus,
textarea:focus {
    box-shadow: 0 0 0 1px #000000;
    outline-offset: 4px;
}

/* Safari focus outline is further outside then other browsers */
@media not all and (min-resolution:.001dpcm) {
    @media {
        input[type="checkbox"]:focus,
        input[type="date"]:focus,
        input[type="datetime-local"]:focus,
        input[type="email"]:focus,
        input[type="month"]:focus,
        input[type="number"]:focus,
        input[type="password"]:focus,
        input[type="radio"]:focus,
        input[type="search"]:focus,
        input[type="tel"]:focus,
        input[type="text"]:focus,
        input[type="time"]:focus,
        input[type="url"]:focus,
        input[type="week"]:focus,
        select:focus,
        textarea:focus {
            outline-offset: 0;
        }
    }
}

input[type="date"]::placeholder,
input[type="datetime-local"]::placeholder,
input[type="email"]::placeholder,
input[type="month"]::placeholder,
input[type="number"]::placeholder,
input[type="password"]::placeholder,
input[type="search"]::placeholder,
input[type="tel"]::placeholder,
input[type="text"]::placeholder,
input[type="time"]::placeholder,
input[type="url"]::placeholder,
input[type="week"]::placeholder,
textarea::placeholder {
    color: darkgrey;
}

input[type="checkbox"],
input[type="radio"] {
    -webkit-appearance: initial;
    -moz-appearance: initial;
    appearance: initial;
    box-sizing: border-box;
    flex-shrink: 0;
    height: 1.5rem;
    margin-right: 1rem;
    min-width: auto;
    padding: 0;
    position: relative;
    width: 1.5rem;
}

input[type="radio"] {
    border-radius: 50%;
}

input[type="checkbox"]:hover,
input[type="radio"]:hover {
    box-shadow: 0 0 0 1px #000000;
}

input[type="checkbox"]:checked {
    background-color: #000000;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxOCIgaGVpZ2h0PSIxMiI+PHBhdGggZmlsbD0iI0ZGRiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMCA1LjY0NyAxLjUwNCA0IDcgOS4yNSAxNi41IDAgMTggMS40MTIgNyAxMnoiLz48L3N2Zz4=');
    background-repeat: no-repeat;
    background-position: center center
}

input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    left: 50%;
}

input[type="radio"]:checked::after {
    background-color: #000000;
    border-radius: 50%;
    height: 1rem;
    width: 1rem;
    top: 50%;
    transform: translate(-50%, -50%);
}

input[type="search"] {
    -webkit-appearance: textfield;
}

input[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
}

select {
    -moz-appearance: none;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 0;
}

select:not([multiple="multiple"]) {
    background-image:
            linear-gradient(45deg, transparent 50%, #000000 50%),
            linear-gradient(135deg, #000000 50%, transparent 50%),
            linear-gradient(to right, #000000, #000000);
    background-position:
            calc(100% - 1.25rem) 50%,
            calc(100% - 0.75rem) 50%,
            calc(100% - 2.5rem) 0.25rem;
    background-size:
            0.5rem 0.5rem,
            0.5rem 0.5rem,
            1px calc(100% - 0.5rem);
    background-repeat: no-repeat;
    padding-right: 3rem;
}

textarea {
    display: block;
    min-height: 7rem;
}
