.nologin {
  $gray-dark-for-login: darken(white, 30%);

  // background color
  background:
    linear-gradient(45deg, darken($inverse, 30%)  0%, hsla(340, 100%, 55%, 0) 70%),
    linear-gradient(135deg, $growi-green 10%, hsla(225, 95%, 50%, 0) 70%),
    linear-gradient(225deg, $growi-blue  10%, hsla(140, 90%, 50%, 0) 80%),
    linear-gradient(315deg, darken($inverse, 25%) 100%, hsla(35, 95%, 55%, 0) 70%);
  #page-wrapper {
    background: none;
  }

  // layout
  #wrapper {
    height: 100vh;

    #page-wrapper {
      height: 100vh;
      display: flex;
      align-items: center;

      .main {
        width: 100vw;

        > .row {
          margin-right: 20px;
          margin-left: 20px;
        }

        .login-header {
          padding-top: 30px;
          padding-bottom: 10px;

          display: flex;
          flex-direction: column;
          align-items: center;
        }

        .login-form-errors {
          width: 100%;

          .alert {
            margin-top: 10px;
            margin-bottom: 0;
            padding: 5px;

            ul {
              padding-left: 1.5em;
            }
          }
        }

      }  // .main
    }  // #page-wrapper
  } // #wrapper

  // styles
  .login-header {
    background-color: rgba(white, 0.5);
    .logo {
      .group1, .group2 {
        fill: rgba(black, 0.5);
      }

    }
    h1 {
      color: rgba(black, 0.5);
      font-size: 22px;
      line-height: 1em;
    }
  }
  .login-dialog {
    background-color: rgba(white, 0.5);
  }

  .input-group {
    margin-bottom: 10px;

    .input-group-addon {
      text-align: center;
      border: none;
      border-radius: 0;
      color: $gray-dark-for-login;
      background-color: rgba(black, 0.4);
    }
    .form-control {
      color: white;
      background-color: rgba(lighten(black, 10%), 0.4);
      &::placeholder {
        color: $gray-dark-for-login;
      }
    }
  }
  .input-group:not(.has-error) {
    .form-control {
      border: transparent;
    }
  }

  .collapse-oauth {
    overflow: hidden;
    &:not(.in) {
      height: 0;
      padding: 0 !important;
    }

    form {
      flex: 1;
      @media(min-width: 350px) {
        flex: 0.49;
      }
    }
    .spacer {
      height: 10px;
    }
  }

  // button style
  .btn-login.fcbtn, .btn-register.fcbtn, .btn-login-oauth.fcbtn, .btn-collapse-oauth {
    border: none;
    color: white;
    background-color: rgba(lighten(black, 20%), 0.4);

    .btn-label {
      margin: -8px 20px -8px -20px;
      padding: 9px 15px;
    }
    &:focus {
      border: none;
    }
  }
  .btn-login-oauth {
    flex: 1;
    .btn-label-text {
      flex: 1;
    }
  }
  .btn-login.fcbtn {
    .btn-label {
      background-color: rgba($brand-danger, 0.4);
    }
    &:after {
      background-color: #7e4153;
    }
  }
  .btn-login-oauth.fcbtn#google {
    .btn-label {
      background: rgba(#f13d25, 0.4);
    }
    &:after {
      background-color: #555;
    }
  }
  .btn-login-oauth.fcbtn#github {
    .btn-label {
      background-color: rgba(#24292e, 0.4);
    }
    &:after {
      background-color: #555;
    }
  }
  .btn-login-oauth.fcbtn#facebook {
    .btn-label {
      background-color: rgba(#29487d, 0.4);
    }
    &:after {
      background-color: #555;
    }
  }
  .btn-login-oauth.fcbtn#twitter {
    .btn-label {
      background-color: rgba(#1da1f2, 0.4);
    }
    &:after {
      background-color: #555;
    }
  }
  .btn-login-oauth.fcbtn#saml {
    .btn-label {
      background-color: rgba(#55a79a, 0.4);
    }
    &:after {
      background-color: #555;
    }
  }
  .btn-register.fcbtn {
    .btn-label {
      background-color: rgba($brand-success, 0.4);
    }
    &:after {
      background-color: #3f7263;
    }
  }

  hr {
    margin: 10px 0;
    border-color: #ccc;
  }

  // footer link text
  .link-growi-org {
    color: rgba(black, 0.4);
    font-weight: bold;
    font-size: smaller;

    &, .growi, .org {
      transition: color 0.8s;
    }

    &:hover, &.focus {
      color: black;
      .growi {
        color: darken($growi-green, 20%);
      }
      .org {
        color: darken($growi-blue, 15%);
      }
    }
  }
  .link-switch {
    color: $gray-lighter;
    &:hover {
      color: white;
    }
  }
}


.login-page {
  // layout
  .main .row {
    @media(min-width: 350px) {
      .col-sm-offset-4 {
        margin-left: calc(50% - 160px);
      }
      .col-sm-4 {
        width: 320px;
      }
    }
  }
  .link-growi-org {
    position: absolute;
    z-index: 2;
    bottom: 9px;
  }

  // flip animation
  .login-dialog.flipper {
    transition: min-height 0.2s;

    &.to-flip {
      min-height: 295px;
      // has-error
      &.has-error {
        min-height: #{295px + 32px};
      }
    }

    .front, .back {
      transition: 0.4s;
      backface-visibility: hidden;
      transform-style: preserve-3d;
      // fix https://github.com/weseek/growi/issues/330
      -webkit-backface-visibility: hidden;
      -webkit-transform-style: preserve-3d;
    }
    .front {
      z-index: 2;
    }
    .back {
      position: absolute;
      top: 0;
      left: 15px;
      right: 15px;
    }
    .back,
    &.to-flip .front {
      transform: rotateY(180deg);

      // fix https://github.com/weseek/growi/issues/330
      // 'backface-visibility: hidden' and 'z-index: -1' breaks layout in iOS
      .fcbtn:after {
        z-index: 0;
        opacity: 0.3;
      }
    }
    &.to-flip .back {
      transform: rotateY(0deg);
    }
  }

}


.installer, .invited, .nologin.error {
  // layout
  .main .row {
    @media(min-width: 510px) {
      .col-sm-offset-4 {
        margin-left: calc(50% - 240px);
      }
      .col-sm-4 {
        width: 480px;
      }
    }
  }
}

.nologin.error {
  .alert h2 {
    line-height: 1em;
  }
}
