/* Shared form presentation across the application. */

:root {
    --app-form-border: #dbe6f1;
    --app-form-border-focus: #1565c0;
    --app-form-radius: 10px;
    --app-form-text: #0f2036;
    --app-form-label: #244b70;
    --app-form-muted: #64748b;
    --app-form-disabled: #f5f7fa;
}

body .mdk-drawer-layout__content form .form-control:not(.form-control-sm):not(.form-control-plaintext):not(.no-form-theme),
body .mdk-drawer-layout__content form .form-select:not(.form-select-sm):not(.no-form-theme),
body .modal form .form-control:not(.form-control-sm):not(.form-control-plaintext):not(.no-form-theme),
body .modal form .form-select:not(.form-select-sm):not(.no-form-theme) {
    min-height: 42px !important;
    padding: 9px 12px !important;
    border: 1px solid var(--app-form-border) !important;
    border-radius: var(--app-form-radius) !important;
    background-color: #fff !important;
    color: var(--app-form-text) !important;
    font-size: 14px !important;
    line-height: 1.45 !important;
    box-shadow: none !important;
}

body .mdk-drawer-layout__content form textarea.form-control:not(.form-control-sm):not(.no-form-theme),
body .modal form textarea.form-control:not(.form-control-sm):not(.no-form-theme) {
    min-height: 96px !important;
    resize: vertical;
}

body .mdk-drawer-layout__content form .form-control:focus:not(.no-form-theme),
body .mdk-drawer-layout__content form .form-select:focus:not(.no-form-theme),
body .modal form .form-control:focus:not(.no-form-theme),
body .modal form .form-select:focus:not(.no-form-theme) {
    border-color: var(--app-form-border-focus) !important;
    box-shadow: 0 0 0 3px rgba(21, 101, 192, .12) !important;
    outline: 0;
}

body .mdk-drawer-layout__content form .form-control:disabled,
body .mdk-drawer-layout__content form .form-control[readonly],
body .mdk-drawer-layout__content form .form-select:disabled,
body .modal form .form-control:disabled,
body .modal form .form-control[readonly],
body .modal form .form-select:disabled {
    background-color: var(--app-form-disabled) !important;
    color: var(--app-form-muted) !important;
    cursor: not-allowed;
}

body .mdk-drawer-layout__content form .form-control::placeholder,
body .modal form .form-control::placeholder {
    color: #90a4ae;
    opacity: 1;
}

body .mdk-drawer-layout__content form .form-label:not(.form-check-label):not(.no-form-theme),
body .mdk-drawer-layout__content form .form-group > label:not(.form-check-label):not(.no-form-theme),
body .modal form .form-label:not(.form-check-label):not(.no-form-theme),
body .modal form .form-group > label:not(.form-check-label):not(.no-form-theme) {
    display: block;
    margin-bottom: 7px !important;
    color: var(--app-form-label) !important;
    font-size: 12.8px !important;
    font-weight: 600 !important;
    line-height: 1.4;
    letter-spacing: normal !important;
    text-transform: none !important;
}

body .mdk-drawer-layout__content form .form-group,
body .modal form .form-group {
    margin-bottom: 1rem;
}

body .mdk-drawer-layout__content form .form-check-input,
body .modal form .form-check-input {
    width: 18px;
    height: 18px;
    margin-top: .18em;
    border-color: #94a3b8;
    accent-color: var(--app-form-border-focus);
}

body .mdk-drawer-layout__content form .form-check-label,
body .modal form .form-check-label {
    color: #455a64;
    font-size: 14px;
}

body .mdk-drawer-layout__content form .errorlist,
body .modal form .errorlist,
body .mdk-drawer-layout__content form .invalid-feedback,
body .modal form .invalid-feedback {
    margin: 5px 0 0;
    padding-left: 17px;
    color: #dc2626;
    font-size: 12px;
    font-weight: 500;
}

body .mdk-drawer-layout__content form .help-block,
body .mdk-drawer-layout__content form .form-text,
body .modal form .help-block,
body .modal form .form-text {
    margin-top: 5px;
    color: var(--app-form-muted);
    font-size: 12px;
}

body .mdk-drawer-layout__content form .chosen-container,
body .modal form .chosen-container {
    width: 100% !important;
}
/* Legacy label columns rendered as plain text instead of <label> */
body .mdk-drawer-layout__content form .row:has(> .offset-sm-2) > [class*="col-"]:first-child,
body .mdk-drawer-layout__content form .row:has(> .offset-md-2) > [class*="col-"]:first-child {
    color: var(--app-form-label) !important;
    font-size: 12.8px !important;
    font-weight: 600 !important;
    line-height: 1.4;
    letter-spacing: normal !important;
    text-transform: none !important;
}

/* Multi-column layout for legacy form rows. */
form.app-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 20px;
    align-items: start;
}

form.app-form-grid > .row,
form.app-form-grid > .form-group.row {
    display: block !important;
    margin: 0 !important;
}

form.app-form-grid > .row > [class*="col-"],
form.app-form-grid > .form-group.row > [class*="col-"] {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

form.app-form-grid > .row > [class*="col-"]:first-child,
form.app-form-grid > .form-group.row > [class*="col-"]:first-child {
    margin-bottom: 6px !important;
    color: var(--app-form-label) !important;
    font-size: 12.8px !important;
    font-weight: 600 !important;
    line-height: 1.4;
    letter-spacing: normal !important;
    text-transform: none !important;
}

form.app-form-grid > h2,
form.app-form-grid > h3,
form.app-form-grid > h4,
form.app-form-grid > .form-section-title,
form.app-form-grid > .alert,
form.app-form-grid > .row:has(> .col-sm-12),
form.app-form-grid > .row:has(> [class*="col-"] p) {
    grid-column: 1 / -1;
}

form.app-form-grid > .row:has(input[type="submit"]),
form.app-form-grid > .row:has(button[type="submit"]),
form.app-form-grid > .form-group.row:has(input[type="submit"]),
form.app-form-grid > .form-group.row:has(button[type="submit"]) {
    grid-column: 1 / -1;
    text-align: right;
}

@media (max-width: 767.98px) {
    form.app-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

body form .form-control:not(.form-control-sm):not(.form-control-plaintext):not(.no-form-theme),
body form .form-select:not(.form-select-sm):not(.no-form-theme) {
    width: 100% !important;
}

body form .chosen-container,
body form .chosen-container-single .chosen-single {
    width: 100% !important;
}
body form .row:has(> [class*="col-"] input[type="submit"]),
body form .row:has(> [class*="col-"] button[type="submit"]) {
    text-align: right;
}

.required {
    margin-left: 2px;
    color: #dc2626;
}
body form .row:has(input[type="submit"]) > [class*="col-"],
body form .row:has(button[type="submit"]) > [class*="col-"] {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    text-align: right !important;
}
/* Site theme for the jQuery timepicker used by schedule and excuse forms. */
.ui-timepicker-wrapper {
    z-index: 2000 !important;
    min-width: 190px;
    max-height: 240px;
    margin: 6px 0 0;
    padding: 6px;
    overflow-y: auto;
    border: 1px solid #dbe6f1;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(15, 45, 80, .14);
}

.ui-timepicker-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ui-timepicker-list li {
    margin: 1px 0;
    padding: 8px 10px;
    border-radius: 7px;
    color: #244b70;
    font-size: 13px;
    line-height: 1.35;
    white-space: nowrap;
    cursor: pointer;
}

.ui-timepicker-list li:hover {
    background: #eef7ff;
    color: #1565c0;
}

.ui-timepicker-list li.ui-timepicker-selected,
.ui-timepicker-list li.ui-timepicker-selected:hover {
    background: #1565c0;
    color: #fff;
}

.ui-timepicker-wrapper::-webkit-scrollbar {
    width: 7px;
}

.ui-timepicker-wrapper::-webkit-scrollbar-thumb {
    border-radius: 99px;
    background: #c5d4e3;
}
/* Course Syllabus list status filter */
.coursemaster-status-filter label.form-label {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    margin-bottom: 0 !important;
    color: #536072 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.4;
}
/* Keep Bootstrap input-group addons and fields on one row. */
body form .input-group {
    flex-wrap: nowrap !important;
}
body form .input-group > .form-control,
body form .input-group > .form-select {
    flex: 1 1 auto !important;
    width: 1% !important;
    min-width: 0;
}
body form .input-group > .input-group-text {
    flex: 0 0 auto;
}
form.app-form-grid > .form-group.row:has(button[type="submit"]) > [class*="col-"] {
    display: flex;
    justify-content: flex-end;
}
form.app-form-grid > .row.d-none,
form.app-form-grid > .form-group.row.d-none {
    display: none !important;
}
/* Match the site dropdown surface on Student Semester Groups and Cesure Return. */
.ssg-page .ssg-field .chosen-container-single .chosen-single,
.jv-page .jv-field .chosen-container-single .chosen-single {
    min-height: 44px !important;
    height: 44px !important;
    padding: 0 12px !important;
    border: 1px solid #dbe6f1 !important;
    border-radius: 10px !important;
    background: #fff !important;
    color: #0f2036 !important;
    font-size: 14px !important;
    line-height: 42px !important;
    box-shadow: none !important;
}
.ssg-page .ssg-field .chosen-container-single .chosen-single span,
.jv-page .jv-field .chosen-container-single .chosen-single span {
    line-height: 42px !important;
    margin-right: 28px !important;
}
.ssg-page .ssg-field .chosen-container-single .chosen-single div,
.jv-page .jv-field .chosen-container-single .chosen-single div {
    top: 0 !important;
    height: 44px !important;
}
.ssg-page .ssg-field .chosen-container-active .chosen-single,
.jv-page .jv-field .chosen-container-active .chosen-single {
    border-color: #1565c0 !important;
    box-shadow: 0 0 0 3px rgba(21, 101, 192, .12) !important;
}
.ssg-page .ssg-field .chosen-container .chosen-drop,
.jv-page .jv-field .chosen-container .chosen-drop {
    border: 1px solid #dbe6f1 !important;
    border-radius: 0 0 12px 12px !important;
    box-shadow: 0 12px 30px rgba(15, 45, 80, .14) !important;
}

