form {
    font: 1.1em/120% Arial;
}

label {
    min-width: 8em;
    display: inline-block;
    text-align: left;
}

input {
    width: 20em;
    padding: 0.7em;
    font-family: Arial;
    color: gray;
}

textarea {
    width: 24em;
    padding: 0.1em;
    font-family: Arial;
    color: gray;
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
}

form div {
    padding: 0.2em;
}

label:first-child {
    vertical-align: top;
}

input[type="checkbox"],
input[type="submit"] {
    margin-left: 12em;
}

input[type="submit"],
input[type="reset"] {
    width: 12em;
    padding-top: 0.5em;
    padding-bottom: 0.5em;
    background: #dcdcdc;
    border: 2px solid #6c6c6c;
    color: black;
} 


/* Styles */

fieldset {
    width: 90%;
    ;
    padding-top: 1.5em;
    padding-left: 1.5em;
    background: rgb(240, 240, 240);
}

input:hover,
textarea:hover {
    background: #fffff0;
    border: 2px solid #efe816;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

input[type="submit"]:hover,
input[type="reset"]:hover {
    background: #c9c9c9;
    border: 2px solid #6c6c6c;
}

input[type="submit"]:active,
input[type="reset"]:active {
    background: #8f8f8f;
}

input:required+label::after {
    color: red;
    content: " ⨉";
}

textarea:required+label::after {
    color: red;
    content: " ⨉";
}

input[type='email']:valid+label::after {
    color: green;
    content: " ✓";
}

textarea:valid+label::after {
    color: green; 
    content: " ✓";
}

input[type='checkbox']:valid+label::after {
    color: green;
    content: " ✓";
} 


/* Single-column pagination at 640 pixels */
 @media screen and (max-width: 40em) {
    label:not(.nobreak) {
        display: block;
    }
    label {
        padding-bottom: 0.4em;
    }
    input:not(.nobreak) {
        display: block;
    }
    input[type="checkbox"],
    input[type="submit"],
    input[type="radio"] {
        margin-left: 0;
        ;
    }
} 