/******************************************
/* RESET FORM ELEMENTS / DEFAULTS
******************************************/
fieldset, form, label, legend, input, select, textarea, option {
    border: 0;
    font-size: 100%;
    font: inherit;
    margin: 0;
    padding: 0;
    vertical-align: baseline;
}


:root {
    --nf-main-color: #4c566a;
    --nf-main-color-faded: #EDF4FC;
    --nf-main-color-hover-color: #434c5e;

    --nf-success-border-color: #8fbcbb;

    --nf-error-border-color: #EFADB5;
    --nf-error-bg-color: #FEF7F8;
}

/******************************************
/* NORMFORM CSS
******************************************/
/* Shared styles */
label,
input,
textarea,
select {
    display: block;
    position: relative;
    width: 100%;
}
input,
textarea,
input[type=checkbox] + label,
input[type=radio] + label {
    margin-bottom: 20px;
}

/* Fieldset */
fieldset {
    border: 1px solid lightgrey;
    border-radius: 2px;
    box-shadow: 0 2px 8px 0 rgba(0,0,0,0.05);
    margin: 20px 0;
    padding: 20px 20px 0;
}

/* Legend */
legend {
    color: grey;
    font-size: 80%;
    padding:  0 10px;
    text-transform: uppercase;
}

/* Labels */
label {
    font-size: 90%;
    margin-bottom: 5px;
}

/* Successful inputs */
input[type=text]:valid:not(:placeholder-shown),
input[type=email]:valid:not(:placeholder-shown),
input[type=password]:valid:not(:placeholder-shown),
input[type=number]:valid:not(:placeholder-shown),
textarea:valid:not(:placeholder-shown) {
    -ms-transition: none;
    -webkit-transition: none;
    transition: none;
}

/* Inputs / Textareas */
input,
textarea,
select,
input[type=checkbox] + label,
input[type=radio] + label {
    border: 1px solid lightgrey;
    outline: none;
    padding: 10px 15px;
}
input:required,
textarea:required,
select:required {
    border-left: 5px solid #b48ead;
}
input:focus,
input[type=checkbox]:focus + label,
input[type=radio]:focus + label,
textarea:focus,
select:focus {
    box-shadow: 0 2px 5px 0 rgba(0,0,0,0.1);
}

/* Invalid errors */
input:invalid:not(:focus):not(:placeholder-shown),
input:invalid:focus:not(:placeholder-shown) {
    background: var(--nf-error-bg-color);
    border-color: var(--nf-error-border-color);
}
input:invalid:focus:not(:placeholder-shown) ~ .requirements {
    max-height: 150px;
    padding: 0 0 10px 10px;
}


/* Select Default Styles */
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: white;
    margin: 0;
    padding-right: 40px;
}

/* Radio Buttons & Checkboxes */
input[type=checkbox], input[type=radio],
input[type=checkbox] + label, input[type=radio] + label {
    cursor: pointer;
    display: inline-block;
}
input[type=checkbox] + label, input[type=radio] + label {
    border: 1px solid lightgrey;
    font-size: 100%;
    padding-left: 30px;
    position: relative;
}
input[type=checkbox] + label:before,
input[type=radio] + label:before {
    background: white;
    border-radius: 2px;
    border: 1px solid black;
    content: '';
    height: 9px;
    left: 10px;
    position: absolute;
    top: calc(50% - 5px);
    width: 9px;
}
input[type=radio] + label:before {
    border-radius: 100px;
}
input[type=radio]:checked + label:before {
    background: var(--nf-main-color);
    border-color: var(--nf-main-color);
}
input[type=checkbox] + label:after {
    color: white;
    content: '✓';
    display: none;
    font-size: 14px;
    font-weight: bold;
    left: 11px;
    position: absolute;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
    top: calc(50% - 10px);
}
input[type=radio] + label:after {
    background: white;
    border-radius: 100px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.4);
    content: '';
    display: none;
    position: absolute;
    width: 5px;
    height: 5px;
    left: 13px;
    top: calc(50% - 2px);
}
input[type=radio]:checked + label:after {
    display: block;
}
input[type=checkbox]:focus + label,
input[type=radio]:focus + label {
    border-color: var(--nf-main-color);
}
input[type=checkbox]:checked + label,
input[type=radio]:checked + label {
    background: var(--nf-main-color-faded);
    border-color: var(--nf-main-color);
}
input[type=checkbox]:checked + label:before {
    background: var(--nf-main-color);
    border-color: var(--nf-main-color);;
}
input[type=checkbox]:checked + label:after {
    display: block;
}

input[type=checkbox],
input[type=radio] {
    margin-right: 5px;
    position: absolute;
    width: auto;
    z-index: -1;
}

/* Submit & reset buttons */
input[type=submit],
input[type=reset] {
    border-radius: 4px;
    cursor: pointer;
    display: inline-block;
    margin: 0;
    padding: 12px 15px;
    position: relative;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    top: 0;
}
input[type=submit]:hover,
input[type=reset]:hover {
    box-shadow: 0 5px 10px 0 rgba(0,0,0,0.1);
}
input[type="submit"] {
    background: var(--nf-main-color);
    color: white;
}
input[type=submit]:hover {
    background: var(--nf-main-color-hover-color);
}
input[type="reset"] {
    background: white;
    border: 1px solid lightgrey;
    color: grey;
}
