@import (reference) "../defs.less";
@import (reference) "./admin.less";
@import (reference) "djblets/css/config-forms.less";

@img_base: "../../images/";

#custom_policy_editor {
  margin: 0;
  width: 65em;

  p {
    font-size: 110%;
    margin: 1em;
  }

  .CodeMirror {
    border-top: 1px #DDD solid;
    border-bottom: 1px #DDD solid;
  }
}

.config-forms-container .config-forms-page-content {
  .box-main {
    > p,
    form > p {
      margin-top: 0;
    }
  }

  .config-forms-list-item {
    white-space: unset;
  }

  .help {
    margin: 1em 2em;
  }
}

#page_authentication {
  .api-tokens .config-forms-list {
    border-bottom: none;

    &:empty {
      display: none;

      + .generate-api-token {
        border-top: 1px solid @config-forms-list-border-color;
      }
    }

    > :last-child {
      border-bottom: 1px @config-forms-list-item-border-color solid;
    }
  }

  .config-site-api-tokens {
    .config-api-token-note {
      color: #888;

      &.empty {
        color: #CCC;
        font-style: italic;
      }
    }

    .config-api-token-value {
      font-family: monospace;
      font-size: 120%;
    }

    .config-forms-list-action-label-policy-custom {
      color: blue;
      cursor: pointer;
      text-decoration: underline;
    }

    .config-forms-list-action-policy {
      text-align: right;
      width: 6.5em;
    }

    .rb-icon {
      vertical-align: middle;
    }
  }

  .generate-api-token {
    background: white;
    border-bottom: 1px solid @config-forms-list-border-color;

    a {
      color: blue;
      font-size: 90%;
      text-decoration: none;
    }
  }
}

#page_groups {
  .config-group-display-name {
    color: #A0A0A0;
    font-size: 90%;
  }

  .config-group-name {
    display: inline-block;
    min-width: 15em;
    padding-right: 2em;
  }

  .config-forms-list-action-join,
  .config-forms-list-action-leave {
    min-width: 3em;
  }
}

#page_oauth2 {
  .app-entry-wrapper {
    overflow: hidden;
  }

  .config-app-name {
    &.disabled a {
      font-style: italic;
    }

    .rb-icon {
      vertical-align: middle;
    }

    a {
      vertical-align: middle;
    }
  }

  .config-forms-list-item {
    white-space: unset;
  }

  .disabled-warning {
    margin-bottom: 1em;
  }

  p {
    line-height: normal;
  }
}

.oauth-add-app {
  margin-top: 1em;
}

.edit-oauth2-app {
  fieldset:extend(.change-form fieldset all) {
    margin: 0;
    padding:0;
  }

  h2:extend(.module h2) {
    border-top: 1px solid @box-border-color;
    border-bottom: 1px solid @box-border-color;
    margin: 0;
    padding: 4px (2 * @box-main-padding);
    text-transform: none;
  }

  input[type="text"]:extend(input) {}

  ul.errorlist:extend(ul.errorlist all) {}

  #id_client_secret_container:extend(
    #application_form #id_client_secret_container) {}

  #id_redirect_uris_container li {
    padding: 0.25em 0;
  }

  .box-main {
    padding: 0;

    > .errorlist {
      border-bottom: 1px solid @box-border-color;
      display: block;

      li {
        margin-bottom: 0;
      }
    }
  }

  .form-actions {
    padding: 0 @box-padding @box-padding @box-padding;

    a.btn, input {
      margin-right: 1em;
    }
  }

  .form-row {
    margin: inherit -1px;
    padding: auto (2 * @box-main-padding);

    &.errors:extend(.errors all) {}
  }

  .help:extend(.help) {}

  .list-edit-widget ul {
    list-style: none;
  }

  .regenerate-secret-button {
    margin-top: 1px;
  }
}
