.path-backup .mform {
    legend {
        width: auto;
        padding: 5px 20px;
        border-radius: $border-radius;
        background-color: $theme-color-3;
        color: $theme-color-9;

        font-size: $font-size-sm;
        font-weight: $font-weight-sm-bold;

    }

    .checkbox .form-check {
        background-color: transparent;
        padding: 3px 0;
    }

    .form-control-static {
        line-height: 2;

        padding: 0;
        margin: 0;
        background-color: transparent;
        box-shadow: none;

        .icon {
            font-size: 12px;
            height: auto!important;
        }

    }

    .fcontainer {
        margin: 0 0 1rem;
    }

    .grouped_settings {
        clear: both;
        overflow: hidden;

        .icon {
          margin: 0 .25rem;
          width: 30px;
        }

        /* Use card styles but avoid extend because that brings in too much. */
        &.section_level {
            @include border-radius($card-border-radius);
            @include clearfix;
            margin-bottom: $card-spacer-x;
        }
    }

    /* These are long labels with checkboxes on the right. */
    .include_setting {
        width: 50%;
        display: inline-block;

        &.section_level {
            padding: 0;
        }
    }
    .normal_setting {
        width: 50%;
        display: inline-block;
    }

    .backup_selector {
        padding: 10px 15px;
        background-color: $theme-color-9;
    }

}

.path-backup {
    .section_level {
        font-weight: $font-weight-sm-bold;
    }
    .section_level .activity_level {
        padding-left: 20px;
    }
    .proceedbutton {
        margin-left: auto;
    }

    .detail-pair {
        border-bottom: 1px solid $border-color;
        padding: 10px 0;

        &:last-of-type {
            border-bottom: 0;
        }

        .backup-restore & {
            display: inline-flex;
        }

        .detail-pair-label {
            margin: 0;
            padding-right: 10px;
            font-weight: $font-weight-bold;

            &:empty {
                display: none;
            }
        }
    }

    h2.header {
        font-size: 1.25rem;
    }

    .subheader {
        margin: 1rem 0;
        font-size: 1rem;
    }
}

/* Override the columns width to leave more room for the labels. */
.path-backup .mform {

    .felement {
        font-size: $font-size-xs;
        font-weight: $font-weight-sm-bold;
    }

    .custom-select {
        padding: 10px 20px 10px 10px;
    }

    .root_setting,
    .grouped_settings {
        /* Striped rows like a table */
        &:nth-of-type(odd) {
            border-bottom: 1px solid $border-color;

            &:last-of-type {
                border-bottom: 0;
            }
        }

        .form-group {
            margin: 0;

            .col-md-3.checkbox {
                width: 0%;
            }
            .col-md-9.checkbox {
                width: 100%;
                left: 0;
            }
        }
    }
}

/* Detail pair is (usually) some short label with a longer value */
.path-backup .detail-pair {
    padding: 0;
    display: block;
    width: 100%;

    .detail-pair-label,
    .detail-pair-value
    {
        display: block;
        width: 100%;
    }

}

    .detail-pair {

        .rcs-search {
            margin-top: 10px;
        }

        .pl-2 {
            padding: 0!important;
        }

    }

    .ics-results {
        margin-bottom: 1rem;
    }

/* Make these bits full width and work with the detail-pair */
#id_rootsettings,
#id_coursesettings {
    font-size: $font-size-sm!important;

    border-radius: $border-radius;
    border: 2px solid $theme-color-3;

    padding: $card-spacer-x;
    margin-bottom: $card-spacer-x;

    .col-form-label {
        padding: 5px 0;
        line-height: 1.3;
    }
}

.path-backup .backup-section
{
    font-size: $font-size-xs;

    border-radius: $border-radius;

    @include clearfix;
    padding: $card-spacer-x;
    margin-bottom: $card-spacer-x;

    .generaltable {
        margin-bottom: 0;
    }

    .sub-header,
    .backup-sub-section,
    .singlebutton {
        width: 100%;
        float: left;
        clear: both;
    }

    /* Fix for nested table headers */
    th.header {
        width: auto;
        float: none;
    }

    /* Add card styles to backup sections */
    ::after {
        content: "";
        display: table;
        clear: both;
    }

    .ics-totalresults {
        margin-top: 1rem;
        margin-bottom: 1rem;
        font-size: $font-size-base;
        font-weight: $font-weight-sm-bold;
    }
}

.backup-restore .backup-section {
    border: 1px solid $border-color;
    border-radius: $border-radius;

    .detail-pair {
        display: inline-flex;
        padding: 10px 0 0!important;
        align-items: center;

        label {
            margin-bottom: 0!important;
        }

        .detail-pair-label, .detail-pair-value {
            display: inline-flex;
            width: auto;
            margin-bottom: 0!important;
        }
    }

    .w-25, .w-75 {
        width: 100%!important;
    }

    .subheader {
        margin: 2rem 0 0.5rem;
    }
}

.path-backup .notification.dependencies_enforced {
    color: $state-danger-text;
    font-weight: bold;
}

.path-backup .backup_progress {
    margin-top: $spacer-y;
    margin-bottom: $spacer-y;

    font-size: $font-size-xs;
    font-weight: $font-weight-sm-bold;
    color: $body-color-secondary;

    .sep {
      margin: 0;
    }

    .backup_stage {
        display: inline-flex;
        align-items: center;

        padding: $badge-padding-y $badge-padding-x;
        font-size: $badge-font-size;
        font-weight: $badge-font-weight;
        vertical-align: baseline;
        border-radius: $badge-border-radius;
        transition: $general-transition;
        @extend .badge-light;
        @extend .badge-link;

        &.backup_stage_current {
            @extend .badge-primary;
        }

        &.backup_stage_next {
            opacity: 0.5;
            cursor: not-allowed;

            & + .accesshide + .arrow + .backup_stage,
            & + .accesshide + .arrow + .backup_stage + .accesshide + .arrow + .backup_stage,
            & + .accesshide + .arrow + .backup_stage + .accesshide + .arrow + .backup_stage + .accesshide + .arrow + .backup_stage,
            & + .accesshide + .arrow + .backup_stage + .accesshide + .arrow + .backup_stage + .accesshide + .arrow + .backup_stage + .accesshide + .arrow + .backup_stage
            {
                opacity: 0.5;
                cursor: not-allowed;
            }
        }
    }


}

.path-backup .backup_progress span.backup_stage.backup_stage_complete {
    color: inherit;
}

#page-backup-restore .filealiasesfailures {
    background-color: $state-danger-bg;

    .aliaseslist {
        background-color: $body-bg;
    }
}


.path-backup .wibbler {
    width: 500px;
    margin: 0 auto 10px;
    border-bottom: 1px solid black;
    border-right: 1px solid black;
    border-left: 1px solid black;
    position: relative;
    min-height: 4px;

    .wibble {
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        height: 4px;
    }

    .state0 {
        background: #eee;
    }
    .state1 {
        background: #ddd;
    }
    .state2 {
        background: #ccc;
    }
    .state3 {
        background: #bbb;
    }
    .state4 {
        background: #aaa;
    }
    .state5 {
        background: #999;
    }
    .state6 {
        background: #888;
    }
    .state7 {
        background: #777;
    }
    .state8 {
        background: #666;
    }
    .state9 {
        background: #555;
    }
    .state10 {
        background: #444;
    }
    .state11 {
        background: #333;
    }
    .state12 {
        background: #222;
    }
}

#page-backup-backup {
  [role="main"] {
    .form-group {
      margin: 0;
      padding: 0 0.25rem;

      .icon {
        margin: 0 0 0 0.5rem;
        width: 20px;
        height: 20px;
      }

      label {
        margin: 0;
      }
    }
  }
}

.path-backup .mform .grouped_settings.section_level {
    padding: 10px;
    border: 1px solid $theme-color-8;

    &:last-child {
        margin-bottom: 0;
    }
}


  .backup-restore {
    span.error {
        margin: 15px 0 0;
        padding: 10px;
        display: inline-flex;

        font-size: $font-size-xs;
        font-weight: $font-weight-sm-bold;
        color: $white;
        background-color: $red-600;

        border-radius: $border-radius $border-radius 0 0;
    }

    fieldset.error {
        padding: 1rem;
        background-color: $white;
        border-radius: 0 $border-radius $border-radius $border-radius;
        border: 2px solid $red-600;
    }

    td, th {
        padding: 3px;
        font-size: $font-size-xs;
    }

    .error {
        .detail-pair {
            align-items: flex-start;
        }
    }

  }
