.form-group {
    position: relative;
}
label {
    display: block;
    margin-top: 10px;
}

label.radio {
    display: inline-block;
}

input {
    width: 100%;
    border: 0;
    background: #e9e9ff;
    border-radius: 2px;
    line-height: 36px;  /* default font-size * 2 */
    padding: 5px 15px;
}

input:focus {
    outline-color: #FFA828;
    background-color: rgba(255, 168, 40, .25);
}

.invalid, input:focus.invalid {
    outline-color: darkred;
    background-color: rgba(255, 0, 0, .25);
    padding-right: 40px /* to make room for icon */
}

.icon-validation {
    color: red;
    position: absolute;
    /* label top margin: 5px
       label font-size: 18px
       input top padding: 5px
       icon font size: 20px
       we need move 5+18+5+(20/2)=38 pixels to center vertically */
    top: calc(50% - 8px);
    left: calc(100% - 30px);
}

.radio-control .icon-validation {
    top: 0;
}

input[type="radio"] {
    width: auto;
}

textarea {
    width: 100%;
    border: 0;
    background: #e9e9ff;
    border-radius: 2px;
    line-height: 36px; /* default font size * 2 */
    padding: 5px 15px;
}

button {
    border: 0;
    border-radius: 2px;
    padding: 15px;
    min-width: 100px;
}

button.submit {
    width: 100%;
    background-color: #FFB241;
    margin: 10px 0;
    font-weight: bold;
}

button:focus.submit {
    outline-color: #dF8808;
    background-color: #FFB241;
}

button:disabled.submit {
    background-color: rgba(255, 178, 65, .6);
    color: gray;
}

.form-error-text {
    color: red;
    font-size: small;
}

.radio-control .form-error-text {
    position: absolute;
    top: 2.5px; /* label font size - message font size*/
    right: 40px;
}

/* Customizing radio buttons */

.radio-control {
    margin-left: 8px;
}

/* first, hide the original radio button */
.form-group > .radio-control > input[type=radio] {
    position: absolute;
    display: none;
}

/* make some space to draw custom radio before field label */
.form-group > .radio-control > input[type=radio] + label {
    position: relative;
    padding-left: 2em;
    vertical-align: middle;
    user-select: none;
    cursor: pointer;
}

/* Draw custom radio before field label
   This is the 'unchecked' state. */
.form-group > .radio-control > input[type=radio] + label:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 14px;
    height: 14px;
    margin-top: -9px;
    border: 2px solid #ccd;
    border-radius: 50%;
    transition: border 0.4s ease;
}

/* change color if checked */
.form-group > .radio-control > input[type=radio]:checked + label:before {
    border: 2px solid #B2700E;
}

/* draw checked state, but hide until checked */
.form-group > .radio-control > input[type=radio] + label:after {
    border-radius: 50%;
    content: '';
    background-color: #FFA828;
    position: absolute;
    top: 50%;
    left: 4px;
    width: 10px;
    height: 10px;
    margin-top: -5px;
    /* use scale to make some smooth check-in */
    transform: scale(0);
    transform-origin: 50%;
    transition: transform .04s ease;
}

/* show checked state */
.form-group > .radio-control > input[type=radio]:checked + label:after {
    transform: scale(1);
}

#knownbyother {
    visibility: hidden;
    margin-top: 34px;
}

/* we can do this with JavaScript, but it's a presentation concern */
#knownby4:checked ~ #knownbyother {
    visibility: visible;
}
