:root {
    --form-bg: #f5f5f5;
    --form-height: 56px;
    --form-bg-hover1: rgba(0,0,0,0.08);
    --form-bbc: rgba(0,0,0,.42);
    --form-opaq1: .08;
    --form-padding: 8px 16px 6px;
    --form-fz: 18px;
}

.form label {
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
}

.form .fc-checkbox,
.form input[type="radio"] {
    display: inline-block;
    margin-right: 0.5rem;
}

.form .fc-checkbox + label,
.form input[type="radio"] + label {
    width: calc(98% - 18px) !important;
    top: 0 !important;
}

.form .fc-checkbox + label:not(:last-of-type),
.form input[type="radio"] + label:not(:last-of-type) {
    margin-bottom: 0;
}

.form .fc-checkbox + label:last-of-type,
.form input[type="radio"] + label:last-of-type {
    margin-bottom: 2rem;
}

.form label > span::after,
.form label > span::before {
    position: absolute;
    transition: 200ms ease-in-out;
}

.form label > span::before {
    content: attr(data-label);
    left: 16px;
    top: 0;
    bottom: 0;
    margin: auto;
    pointer-events: none;
    height: var(--form-fz);
    font-size: var(--form-fz);
    color: gray;
    line-height: 1;
}

.form label > input:focus ~ span::before,
.form label > input:valid ~ span::before,
.form label > textarea:focus ~ span::before,
.form label > textarea:valid ~ span::before {
    font-size: 12px;
    color: var(--color-primary);
}


.form input:not([type="checkbox"], [type="radio"]),
.form textarea {
    width: 100%;
    border: 0;
    height: var(--form-height);
    padding: var(--form-padding);
    font-size: 16px;
}

.form input:not([type="checkbox"], [type="radio"]):focus,
.form input:not([type="checkbox"], [type="radio"]):active,
.form textarea:focus,
.form textarea:active {
    outline: 0;
    border: 0;
}

.form .filled {
    border-bottom: 1px solid var(--form-bbc);
}

.form .filled > input,
.form .filled > textarea {
    background-color: var(--form-bg);
    border-radius: 4px 4px 0 0;
}

.form .filled > input:hover,
.form .filled > textarea:hover {
    background-color: var(--form-bg-hover1);
}

.form .filled > input:focus ~ span::before,
.form .filled > input:valid ~ span::before,
.form .filled > textarea:focus ~ span::before,
.form .filled > textarea:valid ~ span::before {
    transform: translateY(-12px);
    font-size: 12px;
    color: var(--color-primary);
}

.form .filled > input:focus ~ span::after,
.form .filled > input:valid ~ span::after,
.form .filled > textarea:focus ~ span::after,
.form .filled > textarea:valid ~ span::after {
    width: 100%;
}

.form .filled > span::after {
    content: "";
    width: 0;
    height: 1px;
    background-color: var(--color-primary);
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
    transition: 300ms;
}

.form .outlined > input,
.form .outlined > textarea {
    border: 1px solid var(--form-bbc);
    border-radius: 4px;
}

.form .outlined > input:focus,
.form .outlined > textarea:focus {
    box-shadow: 0 0 0 2px var(--color-primary);
    border-color: transparent;
}

.form .outlined > input:focus ~ span::before,
.form .outlined > input:valid ~ span::before,
.form .outlined > textarea:focus ~ span::before,
.form .outlined > textarea:valid ~ span::before,
.form .outlined.always-open > input ~ span::before {
    transform: translateY(-28px);
    background-color: white;
    padding: 2px 4px;
}

.form .outlined.always-open > input ~ span::before {
    font-size: 12px;
}