form {
    box-sizing: border-box;
    /* Just to center the form on the page */
    min-width: 450px;
    max-width: 700px;
    width: 78%;
    margin: 0 auto;
    /* To see the outline of the form */
    padding: 1em;
    border: 1px solid #CCC;
    border-radius: 1em;
}

form div {
    width: 100%;
    overflow: auto;
}

form div + div {
    margin-top: 1em;
}

label {
    /* To make sure that all labels have the same size and are properly aligned */
    display: inline-block;
    width: 25%;
    text-align: right;
}

input, textarea, select{
    /* To make sure that all text fields have the same font settings
       By default, textareas have a monospace font */
    font: 1em sans-serif;

    /* To give the same size to all text field */
    width: 70%;
    -moz-box-sizing: border-box;
    box-sizing: border-box;

    /* To harmonize the look & feel of text field border */
    border: 1px solid #999;
}

input:focus, textarea:focus {
    /* To give a little highlight on active elements */
    border-color: #000;
}

textarea {
    /* To properly align multiline text fields with their labels */
    vertical-align: top;

    /* To give enough room to type some text */
    height: 5em;

    /* To allow users to resize any textarea vertically
       It does not work on every browsers */
    resize: vertical;
}

.button {
    /* To position the buttons to the same position of the text fields */
    padding-left: 90px; /* same size as the label elements */
    box-sizing: border-box;
}

.radio {
    margin: 0;
    float: left;
    width: 30%;
}

.radio input[type="radio"] {
    /* This extra margin represent roughly the same space as the space

       between the labels and their text fields */
    width: 10%;
}

.radio label {
    width: 80%;
}

input[type="submit"] {
    /* This extra margin represent roughly the same space as the space
       between the labels and their text fields */
    margin-left: .5em;
    box-sizing: border-box;
}

@media (max-width: 580px) {
    form { width: 100%; min-width: 200px; }
    label { float: left; width: 100%; min-width: 200px; box-sizing: border-box; text-align: center;}
    input, textarea { float: left; width: 100%; min-width: 200px; box-sizing: border-box; }
    .button { width: 100%; min-width: 200px; }
    input[type="submit"] { float: none; margin-top: 15px; width: 200px; height: 50px; }  
}
