/* Hide hard-coded "Back" button on public forms */
.isPrelogin #main .back {
    display: none;
}

#main form {
    margin: 0 2rem;
}

#main form input[type='text'],
#main form select,
#main form textarea {
    width: 100%;
}

.legacyLabelledField {
    width: 100%;
}

html:not(.mobile) .customform label,
html:not(.mobile) .publicform label {
    margin: 0 0.4rem;
    font-size: 0.75rem;
    color: #767676;
}

.fieldGroupPrompt {
    color: inherit;
}

@media screen and (min-width: 769px) {
    /* Grid system */
    .sanford-row {
        float: left;
    }

    .sanford-row .sanford-column {
        margin: 0 0.5%;
        float: left;
    }

    .sanford-row .sanford-column:first-of-type {
        margin-left: 0;
    }

    .sanford-row .sanford-column:last-of-type {
        margin-right: 0;
    }

    .sanford-row.is-halves .sanford-column {
        width: 49.5%;
    }

    .sanford-row.is-thirds .sanford-column {
        width: 32.66%;
    }

    .sanford-row.is-fourths .sanford-column {
        width: 24.25%;
    }
}

@media screen and (max-width: 768px) {
    .tbContainer {
        display: block;
    }

    label.togglebutton[for] {
        width: 100%;
    }
}

/* Restore look and feel for checkboxes. */
.question input[type='checkbox'].togglebutton + label.togglebutton {
    margin: 0.25rem 0;
    padding: 0 0 0.5rem 1.75rem;
    line-height: 1.6;
    text-align: left;
    color: inherit;
    background: none;
    box-shadow: none;
    border: none;
}

.question input[type='checkbox'].togglebutton + label.togglebutton::before {
    content: "";
    display: block !important; /* Not needed if "pre-2017 workarounds backout" is not assigned */
    height: 1rem;
    width: 1rem;
    position: absolute;
    top: 0.25rem;
    left: 0.15rem;
    background: #fff none center/80% no-repeat;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.125rem;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
}

.question input[type='checkbox'].togglebutton:checked + label.togglebutton {
    top: 0;
}

.question input[type='checkbox'].togglebutton:checked + label.togglebutton::before {
    background-color: #6aade4;
    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4AIYEjQPAcoESgAAAKVJREFUSMft1rENgzAQQFGKbAAsEUoaZxyycYCKDWhQFoCfIk4Tgm2k8yEF//70Gp91WZZKCQRcjkBL4AHctdGOd7MK/oWigm+gnyag0EafwC2hx6J7l10KbYAWKLXR2Q71PjwGig+XQnO71L9a4aKvFzB2yIlbtBddmQD8Ko4G4osDNRKfgQuPg+7EZdFAPA7qweOiG/gI1Jq3kwEGoDrHifpXvQANql+AlGeZnQAAAABJRU5ErkJggg==');
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 2px 1px rgba(0, 0, 0, 0.13);
}

.question input[type='checkbox'].togglebutton:not(:checked) + label.togglebutton:hover::before,
.question input[type='checkbox'].togglebutton:not(:checked):focus + label.togglebutton::before {
    border: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 3px 1px rgba(0, 0, 0, 0.13);
}

/* Pull up validation messages closer to checkbox groups. */
.section .question + p.helptext.alert {
    /* Not needed, but we may want to add a bototm margin to alerts */
    /* Or move the alert inside the .ghostInput */
    /*margin-top: -1em !important;
    margin-bottom: 1em !important;*/
}

.questiongroup > legend {
    margin-left: -2rem;
    padding: 0.75rem 0 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
}

/* Hide empty question legends so they don't take up white space. */
.question legend:empty {
    display: none;
}


input.date.withCalendar {
    display: block;
}

input.date.withCalendar ~ .calendar {
    display: block;
    line-height: 1; /* 1.25rem to account for padding-bottom of input */

    vertical-align: middle;
    right: 0.5rem;
    bottom: 0.5rem;

    position: absolute;
}

.mobile input.date.withCalendar ~ .calendar {
    bottom: 1.25rem;
}






@media screen and (min-width: 769px) {
    /* Two-column checkbox layout. The .two-column class needs to be added to the desired fieldset via
     * JavaScript.
     */
    .section .question.two-column .tbContainer,
    .section .question.three-column .tbContainer,
    .section .question.four-column .tbContainer {
        float: left;
    }

    .section .question.two-column .tbContainer {
        width: 50%;
    }

    .section .question.three-column .tbContainer {
        width: 33.33%;
    }

    .section .question.four-column .tbContainer {
        width: 25%;
    }
}

/* Mobile-specific styles. */
.mobile #main form {
    margin: 0;
}

.mobile .section .questiongroup {
    padding: 0.5rem;
    border: none;
    border-radius: 0.25rem;
}

.mobile .section.questionsContainer .questiongroup:not(.tablelayout) .question,
.mobile .section .questiongroup:not(.tablelayout) .question {
    margin: 0 0 0.5rem;
    max-width: 100%;
}

.mobile .questiongroup > legend {
    margin-left: 0;
    padding-top: 0;
}

.mobile .section .alert .clearlabel {
    display: none;
}

/* Styles for Medical Record Request form. */

/* Make "Abstract" option take up width of form. */
#medical-record-request .question[data-lql='informationToBeReleased'] .tbContainer:first-of-type {
    width: 99%;
}

/* Add description for "Abstract" option. */
#medical-record-request #informationToBeReleased_Abstract::after {
    content: " (history & physical, discharge summary, operative reports, consults, outpatient visit notes, test results, labs, ER notes, provider notes related to specific timeframe)";
    vertical-align: top;
    font-size: small;
    font-style: italic;
    line-height: initial;
}

/* Add disclaimer for "Entire Medical Record" option. */
#medical-record-request [id="informationToBeReleased_Entire Medical Record"]::after {
    content: "(charge may apply)";
    display: block;
    font-size: small;
    font-style: italic;
    line-height: initial;
}

/* Styles for TytoCare form. */

[id^='tytocare'] .section .terms {
    margin-bottom: 0;
    height: 220px;
}

/* Styles for Video Visit form. */

#video-visit-request .section p.helptext:not(.alert) {
    margin-top: -1em !important;
    margin-bottom: 1em !important;
}




#main form {
    margin: 0;
}

.questiongroup {
    margin: 0 2rem;
    padding: 0;
}

.question {
    margin: 0 0 0.5rem;
    padding: 0;
}
