// shared styles
// used in both login and
// create account modals
.login-modal,
.create-account {
  &.fixed-modal .modal-inner-container {
    max-width: 350px;
    max-height: 90vh;
  }

  .close {
    padding: 0;
  }

  #login-buttons:not(.hidden) {
    display: flex;
    flex: 1 0 auto;
    flex-wrap: wrap;
    justify-content: center;
    width: 102%;
    padding-bottom: 10px;
    margin-left: -2%;

    button {
      flex: 1 1 47%;
      max-width: 70%;
      margin: 1% 0 1% 2%;
      font-size: $font-0;
      white-space: nowrap;
      @media screen and (max-width: 360px) {
        font-size: $font-0;
      }
    }

    + #login-form {
      border-top: 1px solid $primary-low;
    }
  }

  form {
    display: flex;
    justify-content: center;
    flex-direction: column;
  }

  table {
    width: 100%;
  }

  tr {
    &.input td label {
      margin-top: 0.75em;
    }

    td label {
      max-width: 280px;
      display: block;
      overflow: hidden;
      word-wrap: break-word;
    }

    &:not(.instructions) td {
      padding: 2px 0 0 0;
    }

    &:not(.password-confirmation) {
      display: flex;
      flex-direction: column;
    }
  }

  .tip {
    &:not(:empty) + td {
      display: none;
    }
  }

  .modal-body input[type="text"],
  .modal-body input[type="email"],
  .modal-body input[type="password"],
  .modal-body input[type="tel"] {
    margin-top: 0;
    width: 100%;
    box-sizing: border-box;
  }

  .modal-footer {
    box-sizing: border-box;
    margin: 0 auto;
    font-size: $font-down-1;
  }

  .alert.alert-error {
    padding: 0.5em 1em;
    margin: 0;
  }

  #new-account-link {
    white-space: nowrap;
  }
}

// Styles for the
// login modal only
.d-modal.login-modal {
  #credentials {
    width: 100%;
    tr {
      display: flex;
      flex-direction: column;
    }
  }

  #login-form {
    margin-bottom: 0.75em;
    td {
      padding: 0;
      width: 100%;
      margin: 0 auto;
    }

    label {
      float: left;
      display: block;
    }
    textarea,
    input,
    select {
      font-size: $font-up-1;
      clear: left;
      margin-top: 0;
    }
  }

  tr {
    td label {
      margin-top: 0.75em;
      padding: 4px 0;
    }
  }
}

// styles for the
// create account
// modal only

#discourse-modal .create-account .modal-body {
  max-height: 60vh !important;
  @media screen and (max-height: 575px) {
    max-height: 50vh !important;
  }
}

.create-account .modal-body {
  display: flex;
  flex-direction: column;
  tr.instructions {
    label {
      color: dark-light-choose($primary-medium, $secondary-medium);
    }
  }

  #login-buttons {
    border-bottom: 1px solid $primary-low;
  }

  .login-form {
    margin-bottom: 0.75em;
  }
}

.create-account {
  .user-fields {
    display: flex;
    flex-direction: column;
  }

  .user-field {
    display: flex;
    flex-direction: column;

    > label {
      width: auto;
    }
    .controls {
      margin-left: 0;
      label {
        line-height: $line-height-medium;
      }
    }
  }
}

.password-reset,
.email-login,
.invites-show {
  margin-top: 30px;
  .col-image {
    padding-top: 12px;
  }
  .password-reset-img {
    width: 50px;
    height: 50px;
  }
  .col-form {
    padding-left: 8px;
  }
  h2 {
    margin-bottom: 12px;
  }
  .tip {
    display: block;
    margin: 6px 0;
  }
}

.password-reset .tip {
  max-width: 180px;
}

.discourse-touch .password-reset {
  .instructions {
    margin-bottom: 16px;
  }
}

.invites-show {
  .col-image {
    display: none;
  }
}
